fix: override tools/list handler to emit raw JSON Schema 2020-12#1378
fix: override tools/list handler to emit raw JSON Schema 2020-12#1378
Conversation
- Move conformance server to src/conformance/everything-server.ts - Add scripts/run-server-conformance.sh to start server and run tests - Add server conformance scripts to package.json - Update GitHub Actions workflow with both client and server jobs - Add src/conformance/README.md with usage instructions - Add express, cors, and @modelcontextprotocol/server to root devDependencies
- Remove unused Tool type import - Remove unused JSON_SCHEMA_2020_12_INPUT_SCHEMA constant (SEP-1613 test is pending - SDK validation supports the fields via PR #1135, but tool registration doesn't yet support generating raw JSON Schema) - Remove emoji from console.log - Alphabetize devDependencies in package.json
Pass through all arguments to conformance CLI instead of just suite name. This allows passing --scenario, --suite, or any other flags.
Runs the conformance server standalone for debugging.
The Zod-to-JSON-Schema conversion strips $schema, $defs, and additionalProperties fields. Override the ListToolsRequestSchema handler to inject the raw JSON Schema for the SEP-1613 test tool. This enables all server conformance tests to pass, including the json-schema-2020-12 scenario that tests SEP-1613 compliance.
|
commit: |
|
Closing - this server-side hack isn't the right approach. PR #1135 fixed the client side (preserving JSON Schema 2020-12 fields when parsing). The conformance test should be a client test instead, verifying that clients correctly preserve $schema, $defs, and additionalProperties when receiving tool definitions. |
Summary
The Zod-to-JSON-Schema conversion strips
$schema,$defs, andadditionalPropertiesfields. This overrides theListToolsRequestSchemahandler in the conformance server to inject the raw JSON Schema for the SEP-1613 test tool.Changes
tools/listhandler to inject raw JSON Schema for thejson_schema_2020_12_toolTesting
All 31 server conformance tests pass, including the
json-schema-2020-12scenario (4/4 checks).Related
.catchall()on inputSchema/outputSchema to support JSON Schema 2020-12 #1135