Optional text content MIME type #180
Replies: 3 comments 5 replies
-
|
Yep, makes sense. I think this is basically just an oversight. We have a MIME type on all resources, for example. |
Beta Was this translation helpful? Give feedback.
-
|
Would be awesome to have text/html as a specified mimeType as well! https://github.com/orgs/modelcontextprotocol/discussions/287 |
Beta Was this translation helpful? Give feedback.
-
|
Testing the waters before I cut an RFC PR. I think we can deprecate the current
Mapping existing examples in the spec to a unified format: TextDeprecate{
"type": "text",
"text": "Tool result text"
}Do instead{
"mimeType": "text/plain",
"data": "Tool result text"
}Image & AudioDeprecate{
"type": "image",
"data": "base64-encoded-data",
"mimeType": "image/png"
}{
"type": "audio",
"data": "base64-encoded-audio-data",
"mimeType": "audio/wav"
}Do instead{
"mimeType": "image/png",
"data": "base64-encoded-data",
"encoding": "base64"
}{
"mimeType": "audio/wav",
"data": "base64-encoded-audio-data",
"encoding": "base64"
}Or: {
"mimeType": "audio/wav",
"data": "hex-encoded-audio-data",
"encoding": "hex"
}And if a refresh URI is available: {
"mimeType": "audio/wav",
"data": "base64-encoded-audio-data",
"encoding": "base64",
"uri": "https://example.com/ding.wav"
}Confusion/ambiguityShould embedding the data as a data URI be allowed? {
"uri": "data:image/jpeg;base64,<base64>"
}Embedded ResourcesDeprecate{
"type": "resource",
"resource": {
"uri": "resource://example",
"mimeType": "text/plain",
"text": "Resource content"
}
}Do instead{
"mimeType": "text/plain",
"content": "Resource content",
"uri": "resource://example"
}i.e. embedded resources don't get a different treatment. Structured ContentUntouched. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Your Idea
Image content requires a MIME Type field to specify the encoding of the image data.
An optional MIME type on text content would be useful, specifically for tool responses that involved structured data. Currently all text is assumed to be
text/plain, but supporting alternate mime types eg.application/jsontext/csvwould aid in clients using tool replies and allow rich text display of tool responses on host applications.Scope
Beta Was this translation helpful? Give feedback.
All reactions