You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The value of "additionalProperties" MUST be a valid JSON Schema. #445
Workaround until this is fixed in the SDK: register a Jackson mixin that replaces the record's default deserialization for additionalProperties. Coerce any JSON object to null (or true, depending on your semantics) and pass booleans through as-is:
Thanks for the report and for the recent Notion MCP example.
I took a look at the current main branch, and it seems that the main Tool.inputSchema path now uses Map<String, Object> rather than the deprecated JsonSchema record. With that shape, schema-valued additionalProperties, for example:
{
"additionalProperties": { "type": "string" }
}
should be preserved when deserializing and serializing a tool schema.
The deprecated McpSchema.JsonSchema helper still has additionalProperties typed as Boolean, so that helper cannot represent the schema-object form. Since JsonSchema is now deprecated in favor of Map<String, Object>, I am not sure whether the intended fix should be to change the deprecated helper API, or simply add a regression test for the current Tool.inputSchema map path.
If this is still reproducible on current main, or on a version that includes #749, I would be happy to help with a focused regression test or a narrow compatibility fix.
Activity
tzolov commentedon Aug 7, 2025
@lp2jx0309, please elaborate.
the JsonSchema has additionalProperties filed:
java-sdk/mcp/src/main/java/io/modelcontextprotocol/spec/McpSchema.java
Line 1206 in 110a8d1
topikachu commentedon Sep 29, 2025
@tzolov
additionalPropertiesin the current JsonSchema definition is too restrictive.According to the JSON Schema spec,
additionalPropertiescan be either abooleanor a schema object (e.g.{ "type": "boolean" }).Defining it only as
Booleanmakes it impossible to handle the schema form.Please check the official JSON Schema test example.
david-christ commentedon May 19, 2026
This is actively biting us via Notion's MCP server. Their
tools/listresponse includes tools like:{ "name": "API-post-page", "inputSchema": { "type": "object", "properties": { ... }, "additionalProperties": { "type": "string" } } }Workaround until this is fixed in the SDK: register a Jackson mixin that replaces the record's default deserialization for
additionalProperties. Coerce any JSON object tonull(ortrue, depending on your semantics) and pass booleans through as-is:Then register it on your
ObjectMapper:This is a stopgap — ideally
additionalPropertieswould be typed asObject(or a sealedBooleanOrSchematype) to faithfully represent the spec.DragonFSKY commentedon May 21, 2026
Thanks for the report and for the recent Notion MCP example.
I took a look at the current
mainbranch, and it seems that the mainTool.inputSchemapath now usesMap<String, Object>rather than the deprecatedJsonSchemarecord. With that shape, schema-valuedadditionalProperties, for example:{ "additionalProperties": { "type": "string" } }should be preserved when deserializing and serializing a tool schema.
The deprecated
McpSchema.JsonSchemahelper still hasadditionalPropertiestyped asBoolean, so that helper cannot represent the schema-object form. SinceJsonSchemais now deprecated in favor ofMap<String, Object>, I am not sure whether the intended fix should be to change the deprecated helper API, or simply add a regression test for the currentTool.inputSchemamap path.If this is still reproducible on current
main, or on a version that includes #749, I would be happy to help with a focused regression test or a narrow compatibility fix.tzolov commentedon Aug 17, 2026
As pointed out by @DragonFSKY this should have been resolved by moving the input schema to
Map<String, Object>in 2.0GA+.Closing as resolved.