feat(time): default to configured timezone when omitted#3740
Open
Christian-Sidak wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
feat(time): default to configured timezone when omitted#3740Christian-Sidak wants to merge 1 commit intomodelcontextprotocol:mainfrom
Christian-Sidak wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
When --local-timezone is configured, the timezone parameters in get_current_time and convert_time now default to the local timezone instead of raising an error. This means LLMs no longer need to explicitly pass the timezone on every call. - get_current_time: timezone is now optional, defaults to local_tz - convert_time: source_timezone and target_timezone are optional, default to local_tz. Only time remains required. - Updated tool descriptions to reflect the default behavior Fixes modelcontextprotocol#2853
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.
Summary
When
--local-timezoneis configured, the time server currently only uses it as a hint in the tool description, hoping the LLM will pass it explicitly. If the LLM omits thetimezoneargument, the call fails with "Missing required argument."This PR makes the configured timezone an actual default:
get_current_time:timezoneis now optional. Defaults tolocal_tzwhen not provided.convert_time:source_timezoneandtarget_timezoneare now optional, both defaulting tolocal_tz. Onlytimeremains required.This means a user can say "what time is it?" and the LLM can call
get_current_timewith no arguments, getting the local time. Previously this would error.Fixes #2853
Test plan
get_current_timewith no timezone uses local_tzconvert_timewith no source_timezone uses local_tzconvert_timewith no target_timezone uses local_tz