MCP PHP SDK

BlobResourceContents extends ResourceContents

Represents blob resource contents in MCP.

Tags
author

Kyrian Obikwelu koshnawaza@gmail.com

Table of Contents

Properties

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

Methods

__construct()  : mixed
fromArray()  : self
fromSplFileInfo()  : self
fromStream()  : self
jsonSerialize()  : BlobResourceContentsData

Properties

Methods

__construct()

public __construct(string $uri, string|null $mimeType, string $blob[, 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

$blob : string

a base64-encoded string representing the binary data of the item

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

Optional metadata

fromArray()

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

fromSplFileInfo()

public static fromSplFileInfo(string $uri, SplFileInfo $file[, string|null $explicitMimeType = null ][, array<string, mixed>|null $meta = null ]) : self
Parameters
$uri : string
$file : SplFileInfo
$explicitMimeType : string|null = null
$meta : array<string, mixed>|null = null

Optional metadata

Return values
self

fromStream()

public static fromStream(string $uri, resource $stream, string $mimeType[, array<string, mixed>|null $meta = null ]) : self
Parameters
$uri : string
$stream : resource
$mimeType : string
$meta : array<string, mixed>|null = null

Optional metadata

Return values
self

jsonSerialize()

public jsonSerialize() : BlobResourceContentsData
Return values
BlobResourceContentsData

        
On this page

Search results