MCP PHP SDK

InitializeResult implements ResultInterface

After receiving an initialize request from the client, the server sends this response.

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

$capabilities  : ServerCapabilities
$instructions  : string|null
$meta  : array<string|int, mixed>|null
$protocolVersion  : ProtocolVersion|null
$serverInfo  : Implementation

Methods

__construct()  : mixed
Create a new InitializeResult.
fromArray()  : self
jsonSerialize()  : Implementation, instructions?: string, _meta?: array}

Properties

Methods

__construct()

Create a new InitializeResult.

public __construct(ServerCapabilities $capabilities, Implementation $serverInfo[, string|null $instructions = null ][, array<string, mixed>|null $meta = null ][, ProtocolVersion|null $protocolVersion = null ]) : mixed
Parameters
$capabilities : ServerCapabilities

the capabilities of the server

$serverInfo : Implementation

information about the server

$instructions : string|null = null

Instructions describing how to use the server and its features. This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.

$meta : array<string, mixed>|null = null

optional _meta field

$protocolVersion : ProtocolVersion|null = null

fromArray()

public static fromArray(array{protocolVersion: string, capabilities: array, serverInfo: array, instructions?: string, _meta?: array$data) : self
Parameters
$data : array{protocolVersion: string, capabilities: array, serverInfo: array, instructions?: string, _meta?: array}
Return values
self

jsonSerialize()

public jsonSerialize() : Implementation, instructions?: string, _meta?: array}
Return values
Implementation, instructions?: string, _meta?: array}

        
On this page

Search results