Skip to content

Conversation

@felixweinberger
Copy link
Contributor

Add unit tests that verify the Python SDK correctly preserves JSON Schema 2020-12 keywords in tool schemas.

Summary

  • Add test_tool_preserves_json_schema_2020_12_fields: Verifies Tool.inputSchema preserves $schema, $defs, and additionalProperties through creation and serialization
  • Add test_list_tools_result_preserves_json_schema_2020_12_fields: Verifies fields survive ListToolsResult deserialization

Motivation and Context

SEP-1613 establishes JSON Schema 2020-12 as the default dialect for MCP. These tests document that the Python SDK already correctly handles this due to using dict[str, Any] for inputSchema (unlike the TypeScript SDK which needed explicit changes in PR #1135).

How Has This Been Tested?

  • All tests pass locally: pytest tests/test_types.py -v

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Add unit tests that verify Tool.inputSchema preserves JSON Schema 2020-12
keywords ($schema, $defs, additionalProperties) through serialization and
deserialization. These tests document that the Python SDK already correctly
handles SEP-1613 due to using dict[str, Any] for inputSchema.

Tests:
- test_tool_preserves_json_schema_2020_12_fields: Direct Tool creation
- test_list_tools_result_preserves_json_schema_2020_12_fields: Deserialization
@felixweinberger felixweinberger merged commit 397089a into main Nov 20, 2025
38 of 39 checks passed
@felixweinberger felixweinberger deleted the fweinberger/sep-1613-tests branch November 20, 2025 20:51
@felixweinberger felixweinberger linked an issue Nov 20, 2025 that may be closed by this pull request
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.

Implement SEP-1613: JSON Schema 2020-12 as Default Dialect

3 participants