Skip to content

docs(time): fix example responses to match actual server output#4439

Open
alvabillwu wants to merge 1 commit into
modelcontextprotocol:mainfrom
alvabillwu:docs/time-readme-fix-example-responses
Open

docs(time): fix example responses to match actual server output#4439
alvabillwu wants to merge 1 commit into
modelcontextprotocol:mainfrom
alvabillwu:docs/time-readme-fix-example-responses

Conversation

@alvabillwu

Copy link
Copy Markdown

Summary

Fixes the example tool-call responses in src/time/README.md so they match what mcp-server-time actually returns. I verified the expected output against src/time/src/mcp_server_time/server.py (the TimeResult / TimeConversionResult models and the convert_time logic) and recomputed the conversions with Python's zoneinfo.

Problems fixed

1. get_current_time example response omitted the day_of_week field that TimeResult includes.

2. convert_time example response had several errors:

Field Before After Why
source.datetime 2024-01-01T12:30:00-05:00 2024-01-01T16:30:00-05:00 the request used time: "16:30", not 12:30
source.day_of_week (missing) Monday TimeResult includes it
target.datetime 2024-01-01T12:30:00+09:00 2024-01-02T06:30:00+09:00 16:30 EST → next-day 06:30 JST
target.day_of_week (missing) Tuesday next calendar day
time_difference +13.0h +14.0h on 2024-01-01 NY is EST (UTC−5), Tokyo is UTC+9 → +14h. (+13h only applies during US DST.)

3. Removed the trailing comma after time_difference (invalid JSON).

Verification

from datetime import datetime
from zoneinfo import ZoneInfo
src = datetime(2024,1,1,16,30,tzinfo=ZoneInfo("America/New_York"))
tgt = src.astimezone(ZoneInfo("Asia/Tokyo"))
# source: 2024-01-01T16:30:00-05:00  day=Monday  dst=False
# target: 2024-01-02T06:30:00+09:00  day=Tuesday dst=False
# time_difference: +14.0h

The time_difference format (+14.0h) matches the server's f"{hours_difference:+.1f}h" for integer offsets.

Doc-only change; no code or behavior affected.

🤖 Generated with Claude Code

…tch server output

The example responses in src/time/README.md did not match what the server
actually returns (verified against src/time/src/mcp_server_time/server.py):

- Both examples omitted the  field that TimeResult includes.
- convert_time example: source datetime showed 12:30 but the request used
  16:30; target datetime and the +13.0h difference were wrong for a
  2024-01-01 (EST, no DST) America/New_York -> Asia/Tokyo conversion.
  Corrected to 16:30-05:00 -> 06:30+09:00 (next day), +14.0h.
- Removed the trailing comma after time_difference (invalid JSON).

Co-Authored-By: Claude <noreply@anthropic.com>
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