MCP PHP SDK

ResourceLink extends Content

Represents a link to a resource, without embedding its contents.

A resource that the server is capable of reading, included in a prompt or tool call result. Unlike EmbeddedResource, this points to a resource without including its full content, allowing clients to fetch it separately.

Tags
phpstan-import-type

AnnotationsData from Annotations

IconData from Icon

author

Alex Rothberg cancan101@users.noreply.github.com

Table of Contents

Properties

$annotations  : Annotations|null
$description  : string|null
$icons  : array<string|int, mixed>|null
$meta  : array<string|int, mixed>|null
$mimeType  : string|null
$name  : string
$size  : int|null
$title  : string|null
$type  : string
$uri  : string

Methods

__construct()  : mixed
fromArray()  : self
jsonSerialize()  : }">Icon[], _meta?: array}

Properties

$description read-only

public string|null $description = null

$icons read-only

public array<string|int, mixed>|null $icons = null

$meta read-only

public array<string|int, mixed>|null $meta = null

Methods

__construct()

public __construct(string $uri, string $name[, string|null $title = null ][, string|null $description = null ][, string|null $mimeType = null ][, Annotations|null $annotations = null ][, int|null $size = null ][, array<string|int, Icon>|null $icons = null ][, array<string, mixed>|null $meta = null ]) : mixed
Parameters
$uri : string

the URI of this resource

$name : string

a short identifier for this resource

$title : string|null = null

optional human-readable title for display in UI

$description : string|null = null

a description of what this resource represents. This can be used by clients to improve the LLM's understanding of available resources

$mimeType : string|null = null

the MIME type of this resource, if known

$annotations : Annotations|null = null

optional annotations for the client

$size : int|null = null

the size of the raw resource content, in bytes (before base64 encoding or any tokenization), if known

$icons : array<string|int, Icon>|null = null

optional icons representing the resource

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

optional metadata

fromArray()

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

jsonSerialize()

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

Search results