Skip to content

[Schema] Add title field to Prompt for MCP spec compliance#278

Open
chr-hertel wants to merge 1 commit intomainfrom
fix/prompt-title-field
Open

[Schema] Add title field to Prompt for MCP spec compliance#278
chr-hertel wants to merge 1 commit intomainfrom
fix/prompt-title-field

Conversation

@chr-hertel
Copy link
Copy Markdown
Member

Summary

  • Adds the optional title property to the Prompt schema class, McpPrompt attribute, Discoverer, ArrayLoader, and Server\Builder
  • The MCP 2025-11-25 spec defines title as a human-readable display name for prompts (distinct from the programmatic name identifier), but it was missing from the SDK
  • Fully backwards-compatible: title defaults to null everywhere

Closes #276

Test plan

  • All 600 unit tests pass
  • PHPStan static analysis passes
  • PHP CS Fixer reports no issues

🤖 Generated with Claude Code

@chr-hertel chr-hertel changed the title Add title field to Prompt for MCP spec compliance [Schema] Add title field to Prompt for MCP spec compliance Apr 11, 2026
@chr-hertel chr-hertel added Schema Issues & PRs related to the Schema component improves spec compliance Improves consistency with other SDKs such as TyepScript breaking change Breaking the Backwards Compatibility Promise labels Apr 11, 2026
The MCP 2025-11-25 specification defines an optional `title` property on
Prompt for human-readable display in UI contexts, distinct from the
programmatic `name` identifier. This was missing from the SDK.

BC Break: Builder::addPrompt() signature changed — $title parameter added
between $name and $description. Callers using positional arguments for
$description must switch to named arguments.

Closes #276

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Breaking the Backwards Compatibility Promise improves spec compliance Improves consistency with other SDKs such as TyepScript Schema Issues & PRs related to the Schema component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing title and arguments fields in Prompt definition (spec compliance)

1 participant