Skip to content

feat(fetch): add tool annotations#3643

Open
owendevereaux wants to merge 1 commit intomodelcontextprotocol:mainfrom
owendevereaux:add-fetch-tool-annotations
Open

feat(fetch): add tool annotations#3643
owendevereaux wants to merge 1 commit intomodelcontextprotocol:mainfrom
owendevereaux:add-fetch-tool-annotations

Conversation

@owendevereaux
Copy link

Summary

Adds tool annotations to the fetch server's single tool, implementing the request in #3572.

Changes

Added ToolAnnotations to the fetch tool with:

Annotation Value Rationale
readOnlyHint true Uses HTTP GET only, doesn't modify data
destructiveHint false Read-only operation
idempotentHint true Same URL returns same content (modulo server changes)
openWorldHint true Makes outbound HTTP requests to arbitrary URLs

The openWorldHint: true is particularly important — the fetch tool can reach any URL on the internet, making it a key vector for data exfiltration in multi-server setups. Accurate annotations help clients enforce "allow reads, gate sends" policies.

Testing

  • Verified syntax with python -m py_compile
  • Pattern follows existing servers (time, git) that use ToolAnnotations

Closes #3572

…nt, openWorld hints

Adds ToolAnnotations to the fetch tool:
- readOnlyHint: true (GET requests only, no modifications)
- destructiveHint: false (read-only operation)
- idempotentHint: true (same URL returns same content)
- openWorldHint: true (makes outbound HTTP requests to arbitrary URLs)

The openWorldHint is particularly important as fetch can reach any URL,
making it a key consideration for clients enforcing data exfiltration policies.

Closes modelcontextprotocol#3572
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.

Add tool annotations to server-fetch (1 tool, 0 annotated)

2 participants