Skip to content

Conversation

@triepod-ai
Copy link

Summary

Adds MCP tool annotations (destructiveHint) to the mysql_query tool to help LLMs better understand tool behavior and make safer decisions about tool execution.

Changes

  • Added destructiveHint: true to mysql_query tool (since it can execute INSERT, UPDATE, DELETE, and DDL operations)
  • Added title annotation ("MySQL Query") for human-readable display

Why This Matters

  • Annotations provide semantic metadata that helps LLMs understand tool behavior
  • MCP clients can make better decisions about when to use tools and how to present them to users
  • Enables safer tool execution by distinguishing read-only from destructive operations
  • Claude Code auto-approves tools with readOnlyHint: true without user confirmation; destructive tools trigger confirmation prompts

Testing

  • Server builds successfully (npm run build)
  • Live verification: Started server and confirmed tools/list returns annotations
  • Annotation values match actual tool behavior (destructive since it can execute write operations)

Before/After

Before:

{
  "name": "mysql_query",
  "description": "Run SQL queries against MySQL database...",
  "inputSchema": { ... }
}

After:

{
  "name": "mysql_query",
  "description": "Run SQL queries against MySQL database...",
  "inputSchema": { ... },
  "annotations": {
    "title": "MySQL Query",
    "destructiveHint": true
  }
}

🤖 Generated with Claude Code

Add destructiveHint annotation to the mysql_query tool to help LLMs
better understand tool behavior and make safer decisions.

Changes:
- Added destructiveHint: true to mysql_query tool (supports INSERT/UPDATE/DELETE/DDL)
- Added title annotation for human-readable display

This improves tool safety metadata for MCP clients.

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

Co-Authored-By: Claude <[email protected]>
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.

2 participants