ElicitResult implements ResultInterface
FinalYes
The client's response to an elicitation/create request from the server.
Contains the user's action (accept, decline, or cancel) and the content they provided when accepting.
Tags
Table of Contents
Interfaces
- ResultInterface
- Base class for all specific MCP result objects (the value of the 'result' field).
Properties
- $action : ElicitAction
- $content : array<string|int, mixed>|null
Methods
- __construct() : mixed
- fromArray() : self
- isAccepted() : bool
- isCancelled() : bool
- isDeclined() : bool
-
jsonSerialize()
: array{action: string, content?: array
}
Properties
$action read-only
public
ElicitAction
$action
$content read-only
public
array<string|int, mixed>|null
$content
= null
Methods
__construct()
public
__construct(ElicitAction $action[, array<string, mixed>|null $content = null ]) : mixed
Parameters
- $action : ElicitAction
-
The user's action in response to the elicitation
- $content : array<string, mixed>|null = null
-
The content provided by the user (only present when action is "accept")
fromArray()
public
static fromArray(array{action: string, content?: array} $data) : self
Parameters
-
$data
: array{action: string, content?: array
}
Return values
selfisAccepted()
public
isAccepted() : bool
Return values
boolisCancelled()
public
isCancelled() : bool
Return values
boolisDeclined()
public
isDeclined() : bool
Return values
booljsonSerialize()
public
jsonSerialize() : array{action: string, content?: array}