MCP PHP SDK

ListRootsResult implements ResultInterface

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

since protocol revision 2026-07-28 (SEP-2577), earliest removal 2027-07-28. Pass directories or files through tool arguments, resource URIs or server configuration instead.

This result contains an array of Root objects, each representing a root directory or file that the server can operate on.

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

$meta  : array<string|int, mixed>|null
$roots  : array<string|int, mixed>

Methods

__construct()  : mixed
fromArray()  : self
jsonSerialize()  : Root[], _meta?: ?array}

Properties

Methods

__construct()

public __construct(array<string|int, Root$roots[, array<string, mixed>|null $meta = null ]) : mixed
Parameters
$roots : array<string|int, Root>

an array of root URIs

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

optional metadata about the result

fromArray()

public static fromArray(array{roots: array{uri: string, name?: string}[], _meta?: ?array$data) : self
Parameters
$data : array{roots: array{uri: string, name?: string}[], _meta?: ?array}
Return values
self

jsonSerialize()

public jsonSerialize() : Root[], _meta?: ?array}
Return values
Root[], _meta?: ?array}
On this page

Search results