Replies: 2 comments 2 replies
-
@redox |
Beta Was this translation helpful? Give feedback.
-
The results of a tool are defined to be text or binary together with a mime type. If the resulting output is structured such as JSON or xml, it seems like there should be a way for the tool definition (and potentially resources too) to have an annotation that describes the schema of the resulting data. The reason for adding the schema is to be able to give the extra annotations on what each field in the data represents - and using the schema as an existing/well-known format seems sensible. While it could have a schema URL embedded in the data payload, that would mean that the client would have to fetch the schema which it may not always be feasible, it may be proprietary for that MCP server and they don't want to make it public. I don't think you would want to embed the schema data on every result either, as that could be duplicative and potentially exhaustive. |
Beta Was this translation helpful? Give feedback.
-
Pre-submission Checklist
Your Idea
While the
inputSchema
of a tool expects a JSON Schema object - the specification is not clear about whether this applies to the underlyingproperties
.In most examples you read online, it looks like it is as most of them are in the form
But in the TS code, it's simply:
and in the schema.json it's similar:
Yet, the "official" inspector suggests that properties are also following the JSON Schema for its properties:
There are a few great features coming with the entire support of JSON Schema for properties, including support enumerated values (as I initially tried to implemented in modelcontextprotocol/inspector#196) but also defined formats which could be very convenient to use.
I would love to hear from others how this sounds and whether I'm missing something.
Scope
Beta Was this translation helpful? Give feedback.
All reactions