inspector icon indicating copy to clipboard operation
inspector copied to clipboard

Support JSON Schema `allOf`, `oneOf`, etc.

Open jpmcb opened this issue 7 months ago • 2 comments

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:

Image

which will obviously fail because it's missing required params.

To Reproduce

Steps to reproduce the behavior:

  1. Build a tool with a schema that uses allOf or oneOf
  2. 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.

jpmcb avatar Jun 06 '25 19:06 jpmcb

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

jpmcb avatar Jun 06 '25 19:06 jpmcb

Related #445

richardkmichael avatar Aug 19 '25 18:08 richardkmichael