MCP PHP SDK

TextResourceContents extends ResourceContents

Represents text resource contents in MCP.

Tags
author

Kyrian Obikwelu koshnawaza@gmail.com

Table of Contents

Properties

$meta  : array<string|int, mixed>|null
$mimeType  : string|null
$text  : string
$uri  : string

Methods

__construct()  : mixed
fromArray()  : self
jsonSerialize()  : TextResourceContentsData

Properties

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
self

jsonSerialize()

public jsonSerialize() : TextResourceContentsData
Return values
TextResourceContentsData

        
On this page

Search results