Missing `title` and `arguments` fields in Prompt definition (spec compliance) · Issue #276 · modelcontextprotocol/php-sdk · GitHub
Skip to content

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

Closed

Description

@vjik

While working with the Prompt API, I noticed a discrepancy between the official MCP specification and the current PHP SDK implementation.

According to the Model Context Protocol Specification:

The prompt object supports the following optional fields:

  • title: Optional human-readable name of the prompt for display purposes
  • arguments: Optional list of arguments for prompt customization

However, these fields do not appear to be supported or exposed in the current PHP SDK.

Expected behavior

The PHP SDK should support:

  • Defining a title for prompts
  • Defining and passing arguments for prompt parameterization

Current behavior

There is no way to:

  • Set a human-readable title for a prompt
  • Define structured arguments for prompt customization

Why this matters

  • title improves usability in UIs and tooling
  • arguments are essential for building reusable and parameterized prompts
  • Lack of support leads to incomplete spec compliance and limits interoperability

Suggested solution

  • Extend the Prompt definition in the SDK to include:

    • title?: string
    • arguments?: array
  • Ensure serialization/deserialization aligns with the MCP spec

  • Optionally provide helper classes or typing for arguments

Activity

  1. added
    bugSomething isn't working
    on Apr 5, 2026
  2. added 2 commits that reference this issue on Apr 11, 2026
    5aa8874
    d9affe9
  3. chr-hertel commented on Apr 11, 2026

    @chr-hertel
    Member

    Thanks for reporting @vjik - I patched the missing title with #278 - to be released with upcomgin v0.5.0.

    Regarding the arguments I'm afraid that's a mixup, they are already in:

    Even with a subtype PromptArgument:

    class PromptArgument implements \JsonSerializable
    {
    /**
    * @param string $name the name of the argument
    * @param string|null $description a human-readable description of the argument
    * @param bool|null $required Whether this argument must be provided. Defaults to false per MCP spec if omitted.
    */
    public function __construct(
    public readonly string $name,
    public readonly ?string $description = null,
    public readonly ?bool $required = null,
    ) {
    }

  4. added
    P2Moderate issues affecting some users, edge cases, potentially valuable feature
    on Apr 11, 2026
  5. added theissue type on Apr 11, 2026
  6. added this to the 0.5.0 milestone on Apr 11, 2026
  7. added
    SchemaIssues & PRs related to the Schema component
    on Apr 11, 2026
  8. vjik commented on Apr 12, 2026

    @vjik
    ContributorAuthor

    Regarding the arguments I'm afraid that's a mixup, they are already in:

    You're right, there is arguments in schema. title and arguments are missed in Builder::addPrompt() method:

    public function addPrompt(

  9. chr-hertel commented on Apr 13, 2026

    @chr-hertel
    Member

    That is true, and due to the fact that arguments are discovered from the parameter profile of the implementation of a prompt, see

    Can you maybe share a bit more how your prompt implementation looks like and what your expectations would be?

  10. added a commit that references this issue on Apr 14, 2026
    5a4b851
  11. vjik commented on Apr 14, 2026

    @vjik
    ContributorAuthor

    That is true, and due to the fact that arguments are discovered from the parameter profile of the implementation of a prompt

    I want to set prompt arguments clearly. Seems, in this case I should implement own loader.

  12. added a commit that references this issue on Apr 18, 2026
    7af5a34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featureSchemaIssues & PRs related to the Schema componentbugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions