McpPrompt
FinalYes
Marks a PHP method as an MCP Prompt generator.
The method should return the prompt messages, potentially using arguments for templating.
Tags
Attributes
- #[Attribute]
- \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS
Table of Contents
Properties
- $description : string|null
- $icons : array<string|int, mixed>|null
- $meta : array<string|int, mixed>|null
- $name : string|null
Methods
- __construct() : mixed
Properties
$description
public
string|null
$description
= null
$icons
public
array<string|int, mixed>|null
$icons
= null
$meta
public
array<string|int, mixed>|null
$meta
= null
$name
public
string|null
$name
= null
Methods
__construct()
public
__construct([string|null $name = null ][, string|null $description = null ][, array<string|int, Icon>|null $icons = null ][, array<string, mixed>|null $meta = null ]) : mixed
Parameters
- $name : string|null = null
-
overrides the prompt name (defaults to method name)
- $description : string|null = null
-
Optional description of the prompt. Defaults to method DocBlock summary.
- $icons : array<string|int, Icon>|null = null
-
Optional list of icon URLs representing the prompt
- $meta : array<string, mixed>|null = null
-
Optional metadata