MCP PHP SDK

CreateSamplingMessageResult implements ResultInterface

The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.

Tags
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

$content  : TextContent|ImageContent|AudioContent
$model  : string
$role  : Role
$stopReason  : string|null

Methods

__construct()  : mixed
fromArray()  : self
jsonSerialize()  : AudioContent, model: string, stopReason?: string}
hydrateContent()  : TextContent|ImageContent|AudioContent

Properties

Methods

fromArray()

public static fromArray(array<string, mixed> $data) : self
Parameters
$data : array<string, mixed>
Return values
self

jsonSerialize()

public jsonSerialize() : AudioContent, model: string, stopReason?: string}
Return values
AudioContent, model: string, stopReason?: string}

        
On this page

Search results