Skip to content

feat: add MCP tool annotations for spec compliance - #49

Merged
rahulcrl merged 1 commit into
mainfrom
tool-annotations
Jul 24, 2026
Merged

feat: add MCP tool annotations for spec compliance#49
rahulcrl merged 1 commit into
mainfrom
tool-annotations

Conversation

@rahulcrl

@rahulcrl rahulcrl commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds readOnlyHint, destructiveHint, idempotentHint, and openWorldHint annotations to all 15 tools per the MCP spec
  • All read tools: readOnlyHint: true, openWorldHint: false
  • Write tools: openWorldHint: false with per-tool destructiveHint and idempotentHint matching their semantics
  • Aligns tool annotations with the MCP spec so clients render correct read-only, destructive, idempotent, and closed-world hints:
    • readOnlyHint - Whether the tool only reads and never modifies its environment.
    • destructiveHint - For write tools, whether the update can overwrite or remove existing data (true) versus being purely additive (false). Meaningful only when readOnlyHint is false.
    • idempotentHint - Whether calling the tool again with the same arguments has no additional effect on the environment. Meaningful only when readOnlyHint is false.
    • openWorldHint - Whether the tool interacts with an open, external world (like web search) versus a closed, well-defined domain.

Annotation matrix

Tool readOnly destructive idempotent openWorld
list_databases true n/a n/a false
list_tables true n/a n/a false
get_table_schema true n/a n/a false
show_running_queries true n/a n/a false
get_cluster true n/a n/a false
list_sql_users true n/a n/a false
list_cluster_nodes true n/a n/a false
select_query true n/a n/a false
explain_query true n/a n/a false
show_statement true n/a n/a false
create_database false false false false
create_table false false false false
insert_rows false true false false
update_rows false true false false
delete_rows false true true false

Test plan

  • go test ./... passes (all 8 packages)
  • New subtests verify every annotation field per tool

@rahulcrl rahulcrl changed the title feat: add MCP tool annotations for connector directory compliance feat: add MCP tool annotations for spec compliance Jul 22, 2026
@rahulcrl
rahulcrl marked this pull request as ready for review July 22, 2026 09:06
Comment thread tools/tools.go
Comment thread tools/tools.go Outdated
Comment thread tools/tools.go
Comment thread tools/tools.go
Comment thread tools/tools.go
Comment thread tools/tools.go
@cockroachlabs-cla-agent

cockroachlabs-cla-agent Bot commented Jul 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread tools/tools.go Outdated
Comment thread tools/tools.go
Add readOnlyHint, destructiveHint, idempotentHint, and openWorldHint
annotations to all tools per the MCP spec so clients render correct
read-only, destructive, and closed-world hints.
@rahulcrl
rahulcrl requested a review from arjunmahishi July 24, 2026 07:00
@rahulcrl
rahulcrl merged commit d66fc43 into main Jul 24, 2026
4 checks passed
@rahulcrl
rahulcrl deleted the tool-annotations branch July 24, 2026 08:53
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.

3 participants