MCP PHP SDK

Response implements MessageInterface

Tags
author

Kyrian Obikwelu koshnawaza@gmail.com

Table of Contents

Interfaces

MessageInterface
Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.

Properties

$id  : string|int
$result  : TResult

Methods

__construct()  : mixed
fromArray()  : self>
getId()  : string|int
jsonSerialize()  : array{jsonrpc: string, id: string|int, result: mixed}

Properties

$result read-only

public TResult $result

Methods

__construct()

public __construct(string|int $id, TResult $result) : mixed
Parameters
$id : string|int

this MUST be the same as the value of the id member in the Request Object

$result : TResult

the value of this member is determined by the method invoked on the Server

fromArray()

public static fromArray(ResponseData $data) : self>
Parameters
$data : ResponseData
Return values
self>

getId()

public getId() : string|int
Return values
string|int

jsonSerialize()

public jsonSerialize() : array{jsonrpc: string, id: string|int, result: mixed}
Return values
array{jsonrpc: string, id: string|int, result: mixed}

        
On this page

Search results