BlobResourceContents extends ResourceContents
Represents blob resource contents in MCP.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- fromArray() : self
- fromSplFileInfo() : self
- fromStream() : self
- jsonSerialize() : BlobResourceContentsData
Properties
$blob read-only
public
string
$blob
$meta read-only
public
array<string|int, mixed>|null
$meta
= null
$mimeType read-only
public
string|null
$mimeType
= null
$uri read-only
public
string
$uri
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
selffromSplFileInfo()
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
selffromStream()
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
selfjsonSerialize()
public
jsonSerialize() : BlobResourceContentsData