-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Describe the bug
Related: modelcontextprotocol/inspector#552
Both tool inputSchema and outputSchema do not properly support JSON Schema as they have hard coded literal object types:
Lines 885 to 894 in cb4743d
| /** | |
| * A JSON Schema object defining the expected parameters for the tool. | |
| */ | |
| inputSchema: z | |
| .object({ | |
| type: z.literal("object"), | |
| properties: z.optional(z.object({}).passthrough()), | |
| required: z.optional(z.array(z.string())), | |
| }) | |
| .passthrough(), |
Lines 895 to 906 in cb4743d
| /** | |
| * An optional JSON Schema object defining the structure of the tool's output returned in | |
| * the structuredContent field of a CallToolResult. | |
| */ | |
| outputSchema: z.optional( | |
| z.object({ | |
| type: z.literal("object"), | |
| properties: z.optional(z.object({}).passthrough()), | |
| required: z.optional(z.array(z.string())), | |
| }) | |
| .passthrough() | |
| ), |
inputSchema: JSON Schema defining expected parameters
outputSchema: Optional JSON Schema defining expected output structure
JSON Schema may have type array, string, etc. etc.: https://json-schema.org/understanding-json-schema/reference/type
To Reproduce
- Using the following valid JSON Schema as an
outputSchema:
{
"type": "array",
"items": {
"type": "object",
"required": [ "id" ],
"properties": {
"id": {
"type": "integer"
}
}
}
}- Notice that
outputSchemathrows an error related totype
Expected behavior
Support any JSON Schema type
Mihailoff, vanyauhalin, logseq-cldwalker, findleyr and meiraleal
Metadata
Metadata
Assignees
Labels
No labels