Skip to content

Conversation

@triepod-ai
Copy link

Summary

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

Changes

  • Added readOnlyHint: true to read-only tools:
    • list_containers
    • fetch_container_logs
    • list_images
    • list_networks
    • list_volumes
  • Added destructiveHint: true to tools that create/update/delete data:
    • create_container, run_container, recreate_container
    • start_container, stop_container, remove_container
    • pull_image, push_image, build_image, remove_image
    • create_network, remove_network
    • create_volume, remove_volume
  • Added title annotations for human-readable display on all tools
  • Bump MCP SDK dependency from >=1.1.0 to >=1.8.0 for annotation support

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
  • Enables safer tool execution by distinguishing read-only from destructive operations
  • Read-only tools can be used for information gathering without side effects
  • Destructive operations can be batched or confirmed before execution

Testing

  • Server builds successfully with uv sync
  • All 19 tools have annotations verified programmatically
  • Annotation values match actual tool behavior

Before/After

Before:

types.Tool(
    name="list_containers",
    description="List all Docker containers",
    inputSchema=ListContainersInput.model_json_schema(),
)

After:

types.Tool(
    name="list_containers",
    description="List all Docker containers",
    inputSchema=ListContainersInput.model_json_schema(),
    annotations=ToolAnnotations(
        title="List Containers",
        readOnlyHint=True,
    ),
)

🤖 Generated with Claude Code

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

Changes:
- Added readOnlyHint: true to read-only tools (list_*, fetch_*)
- Added destructiveHint: true to tools that modify data (create, run, start, stop, remove, pull, push, build)
- Added title annotations for human-readable display
- Bump MCP SDK from >=1.1.0 to >=1.8.0 for annotation support

This improves tool safety metadata for MCP clients.

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

Co-Authored-By: Claude <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