RedNote-MCP
RedNote-MCP copied to clipboard
feat: Add tool annotations for improved LLM tool understanding
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: trueto read-only tools (search, get content, get comments) - Added
openWorldHint: trueto all tools (they interact with external Xiaohongshu API) - Added human-readable
titleannotations - Bumped
@modelcontextprotocol/sdkfrom^1.9.0to1.11.0for annotation support - Fixed TypeScript type errors in
stdioLogger.tsfor 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
- [x] Build passes (
npm run build) - [x]
tools/listreturns annotations for all 4 tools - [x] 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