Optional text content MIME type #180
topherbullock
started this conversation in
Ideas - General
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. |
1 reply
|
Would be awesome to have text/html as a specified mimeType as well! https://github.com/orgs/modelcontextprotocol/discussions/287 |
0 replies
|
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. |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
All reactions