Repository navigation
Resource and ResourceTemplate are missing the title field #296
Description
Summary
The MCP specification (2025-11-25) defines an optional title field for Resource
and ResourceTemplate, but the PHP SDK does not implement it.
Spec definition
The Resources specification
lists the following fields for Resource:
uri: Unique identifier for the resourcename: The name of the resource.title: Optional human-readable name of the resource for display purposes.
Example from the spec:
{
"uri": "file:///project/src/main.rs",
"name": "main.rs",
"title": "Rust Software Application Main File",
"description": "Primary application entry point",
"mimeType": "text/x-rust"
}ResourceTemplate follows the same pattern:
{
"uriTemplate": "file:///{path}",
"name": "Project Files",
"title": "📁 Project Files",
"description": "Access files in the project directory"
}All four server capability types in the spec define title as the optional
human-readable display label:
| Type | Machine identifier | title |
|---|---|---|
Tool |
name |
optional, implemented |
Prompt |
name |
optional, implemented |
Resource |
uri |
optional, missing |
ResourceTemplate |
uriTemplate |
optional, missing |
Current SDK behaviour
Mcp\Schema\Resource and Mcp\Schema\ResourceTemplate have no title constructor
parameter, no title property, and do not include title in jsonSerialize().
Servers that want to expose a human-readable label for a resource currently have no
way to do so.
Additionally, the docblock for Resource::$name currently reads:
A human-readable name for this resource. This can be used by clients to populate
UI elements.
This description conflicts with the spec, where name is a short identifier (e.g.
"main.rs") and title is the human-readable display label.
Proposed fix
Add public readonly ?string $title = null to both Resource and ResourceTemplate,
include it in fromArray() and jsonSerialize(), and update the $name docblock to
match the spec.
Activity
chr-hertel commentedon May 8, 2026
Thanks, that is correct, would need a patch similar to #278 and #288 - PR welcome of course :)
blackwell-systems commentedon May 10, 2026
PR: #301
Add title field to Resource and ResourceTemplate (modelcontextprotoco…