Skip to content

Mark read_sop and validate_step read-only - #798

Merged
gerardrecinto merged 1 commit into
masterfrom
improve-tool-annotations
Nov 28, 2026
Merged

gerardrecinto merged 1 commit into
masterfrom
improve-tool-annotations

Conversation

@gerardrecinto

Copy link
Copy Markdown
Collaborator

Glama showed read_sop as Destructive (grade C) and validate_step as B. With no annotations MCP assumes a tool is destructive. Both tools change nothing, so they now set readOnly, non-destructive, idempotent, and closed-world. read_sop also gets an output schema, field descriptions, and a fuller description. Added a test for the annotations.

Not run: Glama regrade, which needs a new release after this merges.

Thanks,
Gerard

MCP treats a tool with no annotations as destructive, so Glama graded
read_sop as Destructive. Both tools change nothing, so they now say so,
and read_sop gets an output schema and a fuller description.

Thanks,
Gerard
@gerardrecinto gerardrecinto self-assigned this Nov 28, 2026
@gerardrecinto
gerardrecinto enabled auto-merge (squash) November 28, 2026 03:35
@github-actions

Copy link
Copy Markdown

Gemini PR Review

Reviewed commit: 41e4a3d3fd56ecd829e025cbf219590b06d93ad6
Verdict: PASS

  • tools/mcpserver/server.go: The read_sop and validate_step tools are now correctly annotated with WithReadOnlyHintAnnotation(true), WithDestructiveHintAnnotation(false), and WithIdempotentHintAnnotation(true). This improves the clarity and discoverability of the tools' properties, allowing client systems to make correct assumptions about their side effects and idempotency, which is beneficial for security (e.g., authorization, logging) and correctness (e.g., caching, retries).
  • tools/mcpserver/server_test.go: A new test TestReadOnlyToolsDeclareThemselvesReadOnly has been added. This test correctly verifies that read_sop and validate_step tools declare themselves as read-only and idempotent, ensuring that the new annotations are correctly applied and maintained.

@gerardrecinto
gerardrecinto merged commit ad80b51 into master Nov 28, 2026
31 checks passed
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