Skip to content

Conversation

@triepod-ai
Copy link

Summary

This PR adds MCP tool annotations (readOnlyHint and destructiveHint) to all 13 tools, improving client integration and enabling features like confirmation prompts for destructive operations.

Annotation Mapping

Read-only tools (readOnlyHint: true, destructiveHint: false):

  • chroma_list_collections
  • chroma_peek_collection
  • chroma_get_collection_info
  • chroma_get_collection_count
  • chroma_query_documents
  • chroma_get_documents

Write tools (readOnlyHint: false, destructiveHint: false):

  • chroma_create_collection
  • chroma_modify_collection
  • chroma_fork_collection
  • chroma_add_documents
  • chroma_update_documents

Destructive tools (readOnlyHint: false, destructiveHint: true):

  • chroma_delete_collection
  • chroma_delete_documents

Motivation

MCP tool annotations provide hints to clients about tool behavior:

  • readOnlyHint: true - Tool only reads data, no modifications
  • destructiveHint: true - Tool performs irreversible operations (deletions)

These annotations help MCP clients:

  1. Display appropriate UI (e.g., confirmation dialogs for destructive operations)
  2. Make informed decisions about automatic tool execution
  3. Better communicate tool capabilities to users

Changes

  • Added annotations={"readOnlyHint": ..., "destructiveHint": ...} to all @mcp.tool() decorators
  • No functional changes to tool behavior
  • No breaking changes

Test plan

  • Verify server starts without errors
  • Verify tools are exposed with annotations via MCP protocol
  • Test destructive operations still require appropriate permissions

Add tool annotations to all 13 MCP tools to improve client behavior hints:

Read-only tools (readOnlyHint: true):
- chroma_list_collections
- chroma_peek_collection
- chroma_get_collection_info
- chroma_get_collection_count
- chroma_query_documents
- chroma_get_documents

Write tools (readOnlyHint: false, destructiveHint: false):
- chroma_create_collection
- chroma_modify_collection
- chroma_fork_collection
- chroma_add_documents
- chroma_update_documents

Destructive tools (destructiveHint: true):
- chroma_delete_collection
- chroma_delete_documents

These annotations help MCP clients make informed decisions about
tool execution, enabling features like confirmation prompts for
destructive operations.
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