PromptArgument implements JsonSerializable
Describes an argument that a prompt can accept.
Tags
Table of Contents
Interfaces
- JsonSerializable
Properties
- $description : string|null
- $name : string
- $required : bool|null
Methods
- __construct() : mixed
- fromArray() : self
- jsonSerialize() : PromptArgumentData
Properties
$description read-only
public
string|null
$description
= null
$name read-only
public
string
$name
$required read-only
public
bool|null
$required
= null
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
selfjsonSerialize()
public
jsonSerialize() : PromptArgumentData