McpResource
FinalYes
Marks a PHP class as representing or handling a specific MCP Resource instance.
Used primarily for the 'resources/list' discovery.
Tags
Attributes
- #[Attribute]
- \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS
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|null
- $size : int|null
- $uri : string
Methods
- __construct() : mixed
Properties
$annotations
public
Annotations|null
$annotations
= null
$description
public
string|null
$description
= null
$icons
public
array<string|int, mixed>|null
$icons
= null
$meta
public
array<string|int, mixed>|null
$meta
= null
$mimeType
public
string|null
$mimeType
= null
$name
public
string|null
$name
= null
$size
public
int|null
$size
= null
$uri
public
string
$uri
Methods
__construct()
public
__construct(string $uri[, string|null $name = null ][, string|null $description = null ][, string|null $mimeType = null ][, int|null $size = null ][, Annotations|null $annotations = null ][, array<string|int, Icon>|null $icons = null ][, array<string, mixed>|null $meta = null ]) : mixed
Parameters
- $uri : string
-
The specific URI identifying this resource instance. Must be unique within the server.
- $name : string|null = null
-
A human-readable name for this resource. If null, a default might be generated from the method name.
- $description : string|null = null
-
An optional description of the resource. Defaults to class DocBlock summary.
- $mimeType : string|null = null
-
the MIME type, if known and constant for this resource
- $size : int|null = null
-
the size in bytes, if known and constant
- $annotations : Annotations|null = null
-
optional annotations describing the resource
- $icons : array<string|int, Icon>|null = null
-
Optional list of icon URLs representing the resource
- $meta : array<string, mixed>|null = null
-
Optional metadata