Support JSON Schema `allOf`, `oneOf`, etc.
Describe the bug
It doesn't look like the Inspector supports allOf, oneOf, or other JSON schema like joins:
For example, for a valid JSON schema like so being sent to the inspector:
{
"tools": [
{
"name": "POST_f9e30d74-56ca-4f1e-bcb3-75fe305ea5e4",
"description": "Creates a todo list item.",
"inputSchema": {
"type": "object",
"required": [
"userId",
"title"
],
"allOf": [
{
"type": "object",
"title": "Todo Insert Schema",
"required": [
"userId",
"title",
"completed"
],
"additionalProperties": false,
"properties": {
"userId": {
"type": "integer",
"description": "The userId that created the todo list item.",
"examples": [
1
]
},
"title": {
"type": "string",
"description": "The title of the todo list item.",
"examples": [
"Wash the dishes"
]
},
"completed": {
"type": "boolean",
"description": "Whether or not the todo list item is completed.",
"examples": [
false
]
}
}
}
]
}
}
]
}
I'm getting nothing in the actual tool invocation:
which will obviously fail because it's missing required params.
To Reproduce
Steps to reproduce the behavior:
- Build a tool with a schema that uses
allOforoneOf - Notice that the inspector doesn't consume that correctly
Expected behavior
Because the specification defines inputSchema to be:
inputSchema: JSON Schema defining expected parameters
I'd expect any JSON schema to work here. Not just simple { type: object, properties: { ... } } - this is especially problematic since some libraries and tools may attempt to do fancier consolidation of JSON schema based on programmatic params.
Maybe related? Maybe a broader issue with JSON schema support at large in the protocol?
- https://github.com/modelcontextprotocol/modelcontextprotocol/issues/156
- https://github.com/modelcontextprotocol/python-sdk/issues/494
- https://github.com/orgs/modelcontextprotocol/discussions/90
Related #445