MCP PHP SDK

ListResourcesResult
in package
implements ResultInterface

The server's response to a resources/list request from the client.

Tags
phpstan-import-type

ResourceData from Resource

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

$nextCursor  : string|null
$resources  : array<string|int, mixed>

Methods

__construct()  : mixed
fromArray()  : self
jsonSerialize()  : array{resources: resource[], nextCursor?: string}

Properties

Methods

__construct()

public __construct(array<string|int, resource> $resources[, string|null $nextCursor = null ]) : mixed
Parameters
$resources : array<string|int, resource>

the list of resource definitions

$nextCursor : string|null = null

An opaque token representing the pagination position after the last returned result.

If present, there may be more results available.

fromArray()

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

jsonSerialize()

public jsonSerialize() : array{resources: resource[], nextCursor?: string}
Return values
array{resources: resource[], nextCursor?: string}

        
On this page

Search results