MCP PHP SDK

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
author

Johannes Wachter johannes@sulu.io

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

$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
self

isAccepted()

public isAccepted() : bool
Return values
bool

isCancelled()

public isCancelled() : bool
Return values
bool

isDeclined()

public isDeclined() : bool
Return values
bool

jsonSerialize()

public jsonSerialize() : array{action: string, content?: array}
Return values
array{action: string, content?: array}

        
On this page

Search results