Skip to content

Add tool annotations to both tools in every weather server - #278

Open
a-akimov wants to merge 1 commit into
mainfrom
feat/tool-annotations
Open

a-akimov wants to merge 1 commit into
mainfrom
feat/tool-annotations

Conversation

@a-akimov

@a-akimov a-akimov commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

Closes #271

Both tools only read data from an outside service (the NWS API), so every server now declares readOnlyHint: true and openWorldHint: true on get_alerts and get_forecast.

destructiveHint: false and idempotentHint: true are set explicitly as well. The Go SDK always sends idempotentHint, and the Ruby gem always sends all four hints with defaults meant for tools that write (destructive, not idempotent). Setting all four keeps the five servers' tools/list output identical.

How Has This Been Tested?

The test client now fails a server whose tools don't carry these four annotations. Each server README gets a short section on what the hints mean to a host.

Breaking Changes

N/a

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Assisted by Claude Code, reviewed by me.

Both tools only read data from an outside service (the NWS API), so every
server now declares readOnlyHint: true and openWorldHint: true on get_alerts
and get_forecast.

destructiveHint: false and idempotentHint: true are set explicitly as well.
The Go SDK always sends idempotentHint, and the Ruby gem always sends all four
hints with defaults meant for tools that write (destructive, not idempotent).
Setting all four keeps the five servers' tools/list output identical.

The test client now fails a server whose tools don't carry these four
annotations. Each server README gets a short section on what the hints mean
to a host.

Closes #271

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NkL34oWhufSSqj9FbPx5dr
Copilot AI balanced review requested due to automatic review settings November 2, 2026 07:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are blocking the tool-annotation updates across the five weather servers.

No open issues 🎉

What changed in this PR

Adds consistent tool annotations across all five weather servers, addressing #271 by describing both tools as read-only consumers of the external NWS API.

Changes:

  • Explicitly sets all four annotation hints on both tools in each server.
  • Updates the shared test client to reject missing or incorrect annotation values.
  • Documents the hints and their trust limitations in each server README.
File Description
weather-server-typescript/​src/​index.ts Applies shared annotations to both tools.
weather-server-typescript/​README.md Explains annotation values and host trust.
weather-server-rust/​src/​main.rs Adds annotations to both tool macros.
weather-server-rust/​README.md Explains annotation values and host trust.
weather-server-ruby/​weather.rb Applies explicit shared annotations, overriding gem defaults.
weather-server-ruby/​README.md Explains annotation values and host trust.
weather-server-python/​weather.py Supplies shared ToolAnnotations to both tool decorators.
weather-server-python/​README.md Explains annotation values and host trust.
weather-server-go/​README.md Explains annotation values and host trust.
weather-server-go/​main.go Adds an annotation helper used by both tools.
tests/​helpers/​mcp-test-client.ts Validates all four expected hints on every listed tool.

Review effort: Balanced

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 both tools in every server

2 participants