Skip to content

Conversation

@triepod-ai
Copy link

Summary

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

Changes

  • Bump @modelcontextprotocol/sdk from ^1.5.0 to ^1.8.0 for annotation support
  • Added readOnlyHint: true to 3 read-only tools (queries)
  • Added destructiveHint: false to memory_bank_write (creates new files only)
  • Added destructiveHint: true to memory_bank_update (modifies existing files)
  • Added title annotations for human-readable display

Why This Matters

  • Annotations provide semantic metadata that helps LLMs understand tool behavior
  • LLMs can make better decisions about when to use tools and in what order
  • readOnlyHint: true enables MCP clients to auto-approve safe operations
  • destructiveHint: true signals tools that modify data (prompt for confirmation)
  • destructiveHint: false signals additive-only tools (safe to use without confirmation)

Tool Classification

Tool Title Annotation
list_projects List Projects readOnlyHint: true
list_project_files List Project Files readOnlyHint: true
memory_bank_read Read Memory Bank readOnlyHint: true
memory_bank_write Write Memory Bank destructiveHint: false
memory_bank_update Update Memory Bank destructiveHint: true

Testing

  • npm install succeeds with updated SDK (1.25.1 installed)
  • npm run build passes
  • Live verification: Started server and confirmed tools/list returns annotations
  • All 5 tools have correct annotations

Before/After

Before:

router.setTool({
  schema: {
    name: "memory_bank_update",
    description: "Update an existing memory bank file...",
    inputSchema: { ... }
  },
  handler: ...
});

After:

router.setTool({
  schema: {
    name: "memory_bank_update",
    description: "Update an existing memory bank file...",
    inputSchema: { ... },
    annotations: {
      title: "Update Memory Bank",
      destructiveHint: true,
    },
  },
  handler: ...
});

🤖 Generated with Claude Code

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

Changes:
- Bump MCP SDK from ^1.5.0 to ^1.8.0 for annotation support
- Added readOnlyHint: true to 3 read-only tools (list_projects,
  list_project_files, memory_bank_read)
- Added destructiveHint: false to memory_bank_write (creates new files)
- Added destructiveHint: true to memory_bank_update (modifies existing)
- Added human-readable title annotations to all tools

This improves tool safety metadata for MCP clients.

🤖 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