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:
parent
359e8dbc79
commit
7b8393af2e
2 changed files with 9 additions and 8 deletions
17
serve.go
17
serve.go
|
|
@ -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
BIN
telegram-mcp
Executable file
Binary file not shown.
Loading…
Reference in a new issue