Skip to content

Conversation

@triepod-ai
Copy link

Summary

Add MCP tool annotations to the execute_sql tool to help LLM clients understand the tool's safety characteristics.

Changes

  • Added ToolAnnotations import from mcp.types
  • Added annotations to execute_sql tool:
    • title: "Execute SQL"
    • readOnlyHint: False - tool can execute INSERT, UPDATE, DELETE queries
    • destructiveHint: True - tool can execute DROP TABLE, DROP DATABASE queries

Why This Matters

The execute_sql tool can run any SQL query, including:

  • Read operations: SELECT, SHOW, DESCRIBE
  • Write operations: INSERT, UPDATE, DELETE
  • Destructive operations: DROP TABLE, DROP DATABASE, TRUNCATE

Without annotations, MCP clients (like Claude) have no way to know the tool can modify or destroy data. Adding destructiveHint: True helps the LLM exercise appropriate caution when using this tool.

Test Plan

  • Minimal change (1 file, 7 lines added)
  • Uses standard MCP SDK ToolAnnotations class
  • No functional changes to tool behavior

🤖 Generated with Claude Code

Add ToolAnnotations to the execute_sql tool to improve LLM decision-making
about tool safety characteristics:

- readOnlyHint: False - tool can execute INSERT, UPDATE, DELETE queries
- destructiveHint: True - tool can execute DROP TABLE, DROP DATABASE queries

This helps MCP clients (like Claude) understand that this tool can modify
and potentially destroy data, prompting appropriate caution.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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