fix: conform input schema to JSON Schema draft 2020-12#20
Merged
crowecawcaw merged 2 commits intocrowecawcaw:mainfrom Jan 12, 2026
Merged
Conversation
The generated tool input schemas were invalid according to JSON Schema
draft 2020-12 specification. The issue was that parameter properties
were wrapped in a nested "schema" field instead of having the type
directly in the property definition.
Changes:
- Remove invalid nested "schema" field from parameter properties
- Add "type" directly to parameter properties (conforming to spec)
- Only include "description" field when help text is non-empty
- Preserve support for "enum", "default", and other valid fields
Before (invalid):
{
"properties": {
"param": {
"description": null,
"schema": { "type": "boolean" }
}
}
}
After (valid):
{
"properties": {
"param": {
"type": "boolean"
}
}
}
This fixes API errors when using click-mcp tools with Claude API:
"tools.X.custom.input_schema: JSON schema is invalid"
Co-Authored-By: Claude <noreply@anthropic.com>
Updated test assertions to check for the correct JSON Schema format without the invalid nested "schema" field. Changes: - Remove ["schema"] accessor from property type checks - Tests now expect properties to have "type" directly - All 59 tests now pass Co-Authored-By: Claude <noreply@anthropic.com>
Owner
|
Released with 0.6.0 |
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.
The generated tool input schemas were invalid according to JSON Schema draft 2020-12 specification. The issue was that parameter properties were wrapped in a nested "schema" field instead of having the type directly in the property definition.
Changes:
Before (invalid):
{
"properties": { "param": { "description": null, "schema": { "type": "boolean" } } } }
After (valid):
{
"properties": { "param": { "type": "boolean" } } }
This fixes API errors when using click-mcp tools with Claude API: "tools.X.custom.input_schema: JSON schema is invalid"