Skip to content

Conversation

@iqdoctor
Copy link
Contributor

feat: add comprehensive ToolAnnotations to all MCP tools

  • Add openWorldHint=True to all 63+ @mcp.tool decorators
  • Add readOnlyHint=True to read-only operations (get/list/search/export functions)
  • Add destructiveHint=True to state-changing operations (send/create/delete/edit functions)
  • Add idempotentHint=True to safely repeatable operations (block/unblock/pin/unpin/ban/unban/etc.)
  • Fix syntax errors: openWorldHint(True) → openWorldHint=True
  • Remove incorrect idempotentHint from non-idempotent operations (send_file, press_inline_button, import_contacts)

These annotations help MCP clients understand tool behavior:

  • readOnlyHint: tool doesn't modify environment
  • destructiveHint: tool performs destructive updates
  • idempotentHint: repeated calls with same args have no additional effect
  • openWorldHint: tool interacts with external entities (Telegram API)

Improves tool discoverability and helps AI agents make better decisions about tool usage.

iqdoctor and others added 2 commits November 13, 2025 01:33
22 commits behind chigwell/telegram-mcp:main.
- Add openWorldHint=True to all 63+ @mcp.tool decorators
- Add readOnlyHint=True to read-only operations (get/list/search/export functions)
- Add destructiveHint=True to state-changing operations (send/create/delete/edit functions)
- Add idempotentHint=True to safely repeatable operations (block/unblock/pin/unpin/ban/unban/etc.)
- Fix syntax errors: openWorldHint(True) → openWorldHint=True
- Remove incorrect idempotentHint from non-idempotent operations (send_file, press_inline_button, import_contacts)

These annotations help MCP clients understand tool behavior:
- readOnlyHint: tool doesn't modify environment
- destructiveHint: tool performs destructive updates
- idempotentHint: repeated calls with same args have no additional effect
- openWorldHint: tool interacts with external entities (Telegram API)

Improves tool discoverability and helps AI agents make better decisions about tool usage.
@chigwell chigwell merged commit 6fca222 into chigwell:main Nov 18, 2025
3 checks passed
@dmitry-simple-it
Copy link
Contributor

@iqdoctor I got an error to your updates because of old version of mcp in uv.lock
I suppose we also need to update uv.lock file with mcp 1.6.0 → 1.22.0

dmitry-simple-it added a commit to dmitry-simple-it/telegram-mcp that referenced this pull request Nov 27, 2025
Fixes chigwell#37

The mcp package was locked at version 1.6.0 which does not include
the ToolAnnotations type. This caused the server to fail on startup
with:

  ImportError: cannot import name 'ToolAnnotations' from 'mcp.types'

Updated mcp from 1.6.0 to 1.22.0 which includes ToolAnnotations
and is compatible with the code added in PR chigwell#34.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@iqdoctor
Copy link
Contributor Author

@dmitry-simple-it I am sorry for pause, and thank you for fix in PR #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants