TextResourceContents extends ResourceContents
Represents text resource contents in MCP.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- fromArray() : self
- jsonSerialize() : TextResourceContentsData
Properties
$meta read-only
public
array<string|int, mixed>|null
$meta
= null
$mimeType read-only
public
string|null
$mimeType
= null
$text read-only
public
string
$text
$uri read-only
public
string
$uri
Methods
__construct()
public
__construct(string $uri, string|null $mimeType, string $text[, array<string, mixed>|null $meta = null ]) : mixed
Parameters
- $uri : string
-
the URI of the resource or sub-resource
- $mimeType : string|null
-
the MIME type of the resource or sub-resource
- $text : string
-
The text of the item. This must only be set if the item can actually be represented as text (not binary data).
- $meta : array<string, mixed>|null = null
-
Optional metadata
fromArray()
public
static fromArray(TextResourceContentsData $data) : self
Parameters
- $data : TextResourceContentsData
Return values
selfjsonSerialize()
public
jsonSerialize() : TextResourceContentsData