Skip to content

Add schema constraints to time server strings - #4282

Open
bmtriet wants to merge 1 commit into
modelcontextprotocol:mainfrom
bmtriet:codex/time-schema-constraints
Open

Add schema constraints to time server strings#4282
bmtriet wants to merge 1 commit into
modelcontextprotocol:mainfrom
bmtriet:codex/time-schema-constraints

Conversation

@bmtriet

@bmtriet bmtriet commented Jun 5, 2026

Copy link
Copy Markdown

Summary

  • add maxLength/pattern schema hints for time server timezone inputs
  • add a bounded 24-hour time pattern for convert_time
  • cover the advertised input schemas and representative pattern examples in tests

Context

This is a small defensive follow-up for #3537. It only adds schema-level constraints for clients that validate tool schemas; existing runtime validation through ZoneInfo/time parsing remains the final check.

Tests

  • cd src/time && uv run pyright
  • cd src/time && uv run ruff check src/mcp_server_time/server.py test/time_server_test.py
  • cd src/time && uv run pytest

@bmtriet
bmtriet force-pushed the codex/time-schema-constraints branch from bd29867 to 6c176e8 Compare June 5, 2026 10:35

@LuuOW LuuOW 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.

Technical audit: Verified MCP server implementation for consistency with current SDK patterns.

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.

2 participants