What's broken?
The JSON schema is wrong (incorrect type, constraint, or field)
Where in the spec or docs?
https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/scripts/generate-schemas.ts
What should happen?
i was exploring scripts/generate-schemas.ts and noticed something around how schemas are generated and finalized
the schema generation pipeline should ensure that generated json schemas enforce reasonable validation boundaries by default or at least validate the final output for overly permissive structures
at minimum, the pipeline should detect and flag overly permissive schemas before they are committed
What actually happens?
right now schemas are generated using
npx typescript-json-schema --defaultNumberType integer --required --skipLibCheck "${schemaTs}" "*"
and is then modified via string-based transformations after which they are written directly without any validation or constraint enforcement
since the final schema fully depends on how typescript types are defined, no additional safeguards are applied during generation and schemas may allow loosely structured or arbitrary inputs
hence, the pipeline can produce overly permissive schemas without any indication or warning
Anything else?
this is not an immediate runtime bug in this repository but more of a design gap in the schema generation pipeline
just wanted to understand whether this level of permissiveness is intentional (for flexibility) or an oversight in the current generation process
What's broken?
The JSON schema is wrong (incorrect type, constraint, or field)
Where in the spec or docs?
https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/scripts/generate-schemas.ts
What should happen?
i was exploring
scripts/generate-schemas.tsand noticed something around how schemas are generated and finalizedthe schema generation pipeline should ensure that generated json schemas enforce reasonable validation boundaries by default or at least validate the final output for overly permissive structures
at minimum, the pipeline should detect and flag overly permissive schemas before they are committed
What actually happens?
right now schemas are generated using
and is then modified via string-based transformations after which they are written directly without any validation or constraint enforcement
since the final schema fully depends on how typescript types are defined, no additional safeguards are applied during generation and schemas may allow loosely structured or arbitrary inputs
hence, the pipeline can produce overly permissive schemas without any indication or warning
Anything else?
this is not an immediate runtime bug in this repository but more of a design gap in the schema generation pipeline
just wanted to understand whether this level of permissiveness is intentional (for flexibility) or an oversight in the current generation process