MCP PHP SDK

GetPromptResult implements ResultInterface

Tags
phpstan-import-type

PromptMessageData from PromptMessage

author

Kyrian Obikwelu koshnawaza@gmail.com

Table of Contents

Interfaces

ResultInterface
Base class for all specific MCP result objects (the value of the 'result' field).

Properties

$description  : string|null
$messages  : array<string|int, mixed>

Methods

__construct()  : mixed
Create a new GetPromptResult.
fromArray()  : self
jsonSerialize()  : PromptMessage[], description?: string}

Properties

Methods

__construct()

Create a new GetPromptResult.

public __construct(array<string|int, PromptMessage$messages[, string|null $description = null ]) : mixed
Parameters
$messages : array<string|int, PromptMessage>

The messages in the prompt

$description : string|null = null

Optional description of the prompt

fromArray()

public static fromArray(PromptMessageData[], description?: string} $data) : self
Parameters
$data : PromptMessageData[], description?: string}
Return values
self

jsonSerialize()

public jsonSerialize() : PromptMessage[], description?: string}
Return values
PromptMessage[], description?: string}

        
On this page

Search results