Disable write tools (tg_send, tg_read) for read-only mode

- Removed tg_send and tg_read tool registration
- Now only read-only tools are available: tg_me, tg_dialogs, tg_dialog
- Ensures complete read-only mode
This commit is contained in:
isogonalconguate 2026-04-12 02:50:47 +03:00
parent 359e8dbc79
commit 7b8393af2e
2 changed files with 9 additions and 8 deletions

View file

@ -103,15 +103,16 @@ func serve(ctx context.Context, cmd *cli.Command) error {
return fmt.Errorf("register dialogs tool: %w", err)
}
err = server.RegisterTool("tg_send", "Send draft message to dialog", client.SendDraft)
if err != nil {
return fmt.Errorf("register dialogs tool: %w", err)
}
// Disabled write tools for read-only mode
// err = server.RegisterTool("tg_send", "Send draft message to dialog", client.SendDraft)
// if err != nil {
// return fmt.Errorf("register dialogs tool: %w", err)
// }
err = server.RegisterTool("tg_read", "Mark dialog messages as read", client.ReadHistory)
if err != nil {
return fmt.Errorf("register read tool: %w", err)
}
// err = server.RegisterTool("tg_read", "Mark dialog messages as read", client.ReadHistory)
// if err != nil {
// return fmt.Errorf("register read tool: %w", err)
// }
if err := server.Serve(); err != nil {
return fmt.Errorf("serve: %w", err)

BIN
telegram-mcp Executable file

Binary file not shown.