-
Notifications
You must be signed in to change notification settings - Fork 135
Resource and ResourceTemplate are missing the title field #296
Copy link
Copy link
Open
Labels
SchemaIssues & PRs related to the Schema componentIssues & PRs related to the Schema componentenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedhelp wantedContributions especially welcome if you have a good knowledge of the codebase and languageContributions especially welcome if you have a good knowledge of the codebase and languageimproves spec complianceImproves consistency with other SDKs such as TyepScriptImproves consistency with other SDKs such as TyepScriptready for workEnough information for someone to start working onEnough information for someone to start working on
Metadata
Metadata
Assignees
Labels
SchemaIssues & PRs related to the Schema componentIssues & PRs related to the Schema componentenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedhelp wantedContributions especially welcome if you have a good knowledge of the codebase and languageContributions especially welcome if you have a good knowledge of the codebase and languageimproves spec complianceImproves consistency with other SDKs such as TyepScriptImproves consistency with other SDKs such as TyepScriptready for workEnough information for someone to start working onEnough information for someone to start working on
Summary
The MCP specification (2025-11-25) defines an optional
titlefield forResourceand
ResourceTemplate, but the PHP SDK does not implement it.Spec definition
The Resources specification
lists the following fields for
Resource: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" }ResourceTemplatefollows 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
titleas the optionalhuman-readable display label:
titleToolnamePromptnameResourceuriResourceTemplateuriTemplateCurrent SDK behaviour
Mcp\Schema\ResourceandMcp\Schema\ResourceTemplatehave notitleconstructorparameter, no
titleproperty, and do not includetitleinjsonSerialize().Servers that want to expose a human-readable label for a resource currently have no
way to do so.
Additionally, the docblock for
Resource::$namecurrently reads:This description conflicts with the spec, where
nameis a short identifier (e.g."main.rs") andtitleis the human-readable display label.Proposed fix
Add
public readonly ?string $title = nullto bothResourceandResourceTemplate,include it in
fromArray()andjsonSerialize(), and update the$namedocblock tomatch the spec.