feat(everything): add tool-level annotations to get-annotated-message#3246
feat(everything): add tool-level annotations to get-annotated-message#3246olaservo wants to merge 9 commits intomodelcontextprotocol:mainfrom
Conversation
Add readOnlyHint, destructiveHint, idempotentHint, and openWorldHint annotations to the tool config. Update docs to reflect that this tool now demonstrates both tool-level and content annotations. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously only get-annotated-message had ToolAnnotations. Now all 18 tools explicitly declare readOnlyHint, destructiveHint, idempotentHint, and openWorldHint so the server serves as a complete reference for developers implementing tool annotations per the MCP spec. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update get-annotated-message description: all tools now have tool-level annotations, not just this one - Add missing tool entries: simulate-research-query, trigger-elicitation-request-async, trigger-sampling-request-async - Add these tools to the file tree listing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| │ ├── get-sum.ts | ||
| │ ├── get-tiny-image.ts | ||
| │ ├── gzip-file-as-resource.ts | ||
| │ ├── simulate-research-query.ts |
There was a problem hiding this comment.
Unrelated updates - these were just missing from the docs.
|
@claude review |
|
Claude finished @cliffhall's task in 2m 15s —— View job PR Review: feat(everything): add tool-level annotationsTasks:
SummaryThis PR adds Annotation SemanticsThe annotation values are correct across the board. A few noteworthy choices worth confirming:
Minor Issue: Comment Inconsistency
annotations: {
readOnlyHint: true, // This tool only returns data, no side effects
destructiveHint: false, // Does not delete or modify anything
idempotentHint: true, // Same input always produces same output
openWorldHint: false, // Does not interact with external systems
},None of the other 17 tools have these comments. For a reference server, this inconsistency is noticeable — developers scanning multiple tool files will see comments in one and not others. Since this file is specifically designed to demonstrate annotations, keeping the comments here is understandable, but the pattern could confuse readers into thinking the comments only matter for Doc ChangesThe
VerdictApprove with nit. The core goal is well-executed — all 18 tools now have semantically correct annotations. The only actionable item is the comment inconsistency in |
Description
Add
ToolAnnotationsto all 18 tools in the Everything example server. Previously onlyget-annotated-messagehad annotations; now every tool explicitly declaresreadOnlyHint,destructiveHint,idempotentHint, andopenWorldHintso the server serves as a complete reference for developers implementing tool annotations per the MCP spec.Server Details
Motivation and Context
Tool annotations are part of the MCP specification and provide hints to clients about tool behavior:
readOnlyHintdestructiveHintidempotentHintopenWorldHintThe Everything server is the canonical MCP reference/demo server, yet only 1 of its 18 tools had
ToolAnnotations. Adding annotations to all tools makes it a complete reference for:Tool Annotations Added
echotruefalsetruefalseget-annotated-messagetruefalsetruefalseget-envtruefalsetruefalseget-resource-linkstruefalsetruefalseget-resource-referencetruefalsetruefalseget-roots-listtruefalsetruefalseget-structured-contenttruefalsetruefalseget-sumtruefalsetruefalseget-tiny-imagetruefalsetruefalsetrigger-long-running-operationtruefalsetruefalsetoggle-simulated-loggingfalsefalsefalsefalsetoggle-subscriber-updatesfalsefalsefalsefalsetrigger-elicitation-requestfalsefalsefalsefalsetrigger-elicitation-request-asyncfalsefalsefalsefalsetrigger-sampling-requestfalsefalsefalsetruetrigger-sampling-request-asyncfalsefalsefalsetruegzip-file-as-resourcefalsefalsetruetruesimulate-research-queryfalsefalsefalsefalseHow Has This Been Tested?
npm run build)tools/listresponsesTested with this version of Inspector in this open PR: modelcontextprotocol/inspector#1066
Breaking Changes
None. Annotations are optional metadata hints and do not affect tool behavior.
Types of changes
Checklist
Additional context
The annotation values follow the MCP spec semantics:
truewhen the tool only returns data with no side effectsfalsefor all tools since none delete or overwrite external datatruewhen repeated calls with the same args produce the same result and no additional environmental effect;falsefor toggles, user-interactive tools, and task-creating toolstrueonly for tools that interact with external systems (URL fetching, LLM sampling);falsefor tools operating within the closed MCP server/client domain