MCP PHP SDK

PromptArgument implements JsonSerializable

Describes an argument that a prompt can accept.

Tags
author

Kyrian Obikwelu koshnawaza@gmail.com

Table of Contents

Interfaces

JsonSerializable

Properties

$description  : string|null
$name  : string
$required  : bool|null

Methods

__construct()  : mixed
fromArray()  : self
jsonSerialize()  : PromptArgumentData

Properties

Methods

__construct()

public __construct(string $name[, string|null $description = null ][, bool|null $required = null ]) : mixed
Parameters
$name : string

the name of the argument

$description : string|null = null

a human-readable description of the argument

$required : bool|null = null

Whether this argument must be provided. Defaults to false per MCP spec if omitted.

fromArray()

public static fromArray(PromptArgumentData $data) : self
Parameters
$data : PromptArgumentData
Return values
self

jsonSerialize()

public jsonSerialize() : PromptArgumentData
Return values
PromptArgumentData

        
On this page

Search results