Skip to content

docs(time): correct example tool responses to match server output - #4597

Open
latent-9 wants to merge 1 commit into
modelcontextprotocol:mainfrom
latent-9:docs/time-readme-example-output
Open

docs(time): correct example tool responses to match server output#4597
latent-9 wants to merge 1 commit into
modelcontextprotocol:mainfrom
latent-9:docs/time-readme-example-output

Conversation

@latent-9

Copy link
Copy Markdown

What

The get_current_time and convert_time example responses in src/time/README.md don't match what the server actually returns. Corrected them against src/time/src/mcp_server_time/server.py.

Corrections

get_current_time and convert_time both omitted day_of_week, which TimeResult always includes (server.py populates it via strftime("%A")).

convert_time (input source=America/New_York, time=16:30, target=Asia/Tokyo):

  • source.datetime showed 12:30; the requested time is 16:30, and the server builds it from the parsed hour/minute → 2024-01-01T16:30:00-05:00.
  • target.datetime showed 2024-01-01T12:30:00+09:00; target = source.astimezone(Asia/Tokyo) is +14h → next day, 2024-01-02T06:30:00+09:00.
  • time_difference showed +13.0h; (+09:00) − (−05:00) is 14 hours → +14.0h.
  • the response object had a trailing comma, which is invalid JSON.

Resulting time_difference, offsets, and day-of-week are now internally consistent (Mon → Tue rollover).

Note

PR #4142 removes only the trailing comma on the time_difference line while keeping the incorrect +13.0h; this PR also fixes the value and the other example inaccuracies, so it covers that change too.

The get_current_time and convert_time examples in the time server README did
not match what the server actually returns:

- both responses omitted the day_of_week field, which TimeResult always includes
- convert_time's source datetime showed 12:30 instead of the requested 16:30
- convert_time's target datetime ignored the +14h shift into the next day
  (should be 2024-01-02T06:30:00+09:00)
- time_difference read +13.0h, but UTC+9 - UTC-5 is 14 hours (+14.0h)
- the response object had a trailing comma, making it invalid JSON

Values verified against src/time/src/mcp_server_time/server.py.
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