McpResource
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
- $title : string|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
$title
public
string|null
$title
= null
$uri
public
string
$uri
Methods
__construct()
public
__construct(string $uri[, string|null $name = null ][, string|null $title = 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
- $name : string|null = null
-
a short identifier for this resource; defaults to the method name
- $title : string|null = null
-
optional human-readable title for display in UI
- $description : string|null = null
-
optional description; 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 icons representing the resource
- $meta : array<string, mixed>|null = null
-
optional metadata