docs(time): correct example tool responses to match server output - #4597
Open
latent-9 wants to merge 1 commit into
Open
docs(time): correct example tool responses to match server output#4597latent-9 wants to merge 1 commit into
latent-9 wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
get_current_timeandconvert_timeexample responses insrc/time/README.mddon't match what the server actually returns. Corrected them againstsrc/time/src/mcp_server_time/server.py.Corrections
get_current_timeandconvert_timeboth omittedday_of_week, whichTimeResultalways includes (server.pypopulates it viastrftime("%A")).convert_time(inputsource=America/New_York,time=16:30,target=Asia/Tokyo):source.datetimeshowed12:30; the requested time is16:30, and the server builds it from the parsed hour/minute →2024-01-01T16:30:00-05:00.target.datetimeshowed2024-01-01T12:30:00+09:00;target = source.astimezone(Asia/Tokyo)is +14h → next day,2024-01-02T06:30:00+09:00.time_differenceshowed+13.0h;(+09:00) − (−05:00)is 14 hours →+14.0h.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_differenceline while keeping the incorrect+13.0h; this PR also fixes the value and the other example inaccuracies, so it covers that change too.