Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Incorrect content shown in 5.2.2 Binary Content #1621

@stephentoub

Description

@stephentoub

Describe the bug
https://github.com/modelcontextprotocol/modelcontextprotocol/blob/d262272c506d71adc56ae5ea07823d966f1a6df7/docs/specification/2025-06-18/server/resources.mdx#data-types suggests the resource contents contain a name/title property. But I do not see anything in the specification's schema that suggests name/title are valid on a resource contents:

export interface ResourceContents {
/**
* The URI of this resource.
*
* @format uri
*/
uri: string;
/**
* The MIME type of this resource, if known.
*/
mimeType?: string;
/**
* See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
*/
_meta?: { [key: string]: unknown };
}
export interface TextResourceContents extends ResourceContents {
/**
* The text of the item. This must only be set if the item can actually be represented as text (not binary data).
*/
text: string;
}
export interface BlobResourceContents extends ResourceContents {
/**
* A base64-encoded string representing the binary data of the item.
*
* @format byte
*/
blob: string;
}

"BlobResourceContents": {
"properties": {
"_meta": {
"additionalProperties": {},
"description": "See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.",
"type": "object"
},
"blob": {
"description": "A base64-encoded string representing the binary data of the item.",
"format": "byte",
"type": "string"
},
"mimeType": {
"description": "The MIME type of this resource, if known.",
"type": "string"
},
"uri": {
"description": "The URI of this resource.",
"format": "uri",
"type": "string"
}
},

nor on a ReadResourceResult:
export interface ReadResourceResult extends Result {
contents: (TextResourceContents | BlobResourceContents)[];
}

export interface Result {
/**
* See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
*/
_meta?: { [key: string]: unknown };
[key: string]: unknown;
}

"ReadResourceResult": {
"description": "The server's response to a resources/read request from the client.",
"properties": {
"_meta": {
"additionalProperties": {},
"description": "See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.",
"type": "object"
},
"contents": {
"items": {
"anyOf": [
{
"$ref": "#/definitions/TextResourceContents"
},
{
"$ref": "#/definitions/BlobResourceContents"
}
]
},
"type": "array"
}
},

To Reproduce
Look at the docs.

Expected behavior
The docs are consistent with the schema.

Logs
n/a

Additional context
n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions