Skip to content

Conversation

@triepod-ai
Copy link

Summary

Adds MCP tool annotations (readOnlyHint, openWorldHint, title) to all 4 tools to help LLMs better understand tool behavior and make safer decisions about tool execution.

Changes

Tool title readOnlyHint openWorldHint
search_notes "Search Notes" true true
get_note_content "Get Note Content" true true
get_note_comments "Get Note Comments" true true
login "Login" - true
  • Added readOnlyHint: true to read-only tools (search, get content, get comments)
  • Added openWorldHint: true to all tools (they interact with external Xiaohongshu API)
  • Added human-readable title annotations
  • Bumped @modelcontextprotocol/sdk from ^1.9.0 to 1.11.0 for annotation support
  • Fixed TypeScript type errors in stdioLogger.ts for SDK compatibility

Why This Matters

  • readOnlyHint enables MCP clients to auto-approve safe operations without user confirmation
  • openWorldHint indicates tools access external services, helping clients apply appropriate policies
  • title provides human-readable names for better tool display

Testing

  • Build passes (npm run build)
  • tools/list returns annotations for all 4 tools
  • Annotation values match actual tool behavior

Before/After

Before:

{
  "name": "search_notes",
  "description": "根据关键词搜索笔记"
}

After:

{
  "name": "search_notes",
  "description": "根据关键词搜索笔记",
  "annotations": {
    "title": "Search Notes",
    "readOnlyHint": true,
    "openWorldHint": true
  }
}

🤖 Generated with Claude Code

Add readOnlyHint and openWorldHint annotations to all MCP tools to help
LLMs better understand tool behavior and make safer decisions.

Changes:
- Add readOnlyHint: true to read-only tools (search_notes, get_note_content, get_note_comments)
- Add openWorldHint: true to all tools (they interact with external Xiaohongshu API)
- Add human-readable title annotations for better display
- Bump @modelcontextprotocol/sdk from ^1.9.0 to 1.11.0 for annotation support
- Fix TypeScript type errors in stdioLogger.ts for SDK compatibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

1 participant