MCP::Prompt(3)
π MCP::Prompt β the prompt container bestie π
okay so real talk: this is MCP::Prompt(3), a page from the User Contributed Perl Documentation, and it's genuinely just a container for prompts. iconic behavior, honestly. let's get into it β¨
πΈ SYNOPSIS πΈ
like, the bare minimum to get going:
use MCP::Prompt;
my $prompt = MCP::Prompt->new;
that's it. that's the whole vibe check. you made a prompt π«Ά
π DESCRIPTION π
MCP::Prompt is a container for prompts. that's the whole description. she said what she said. no cap. π
π ATTRIBUTES π
MCP::Prompt implements the following attributes. every single one, we're covering all of them, no skipping π
β arguments
my $args = $prompt->arguments;
$prompt = $prompt->arguments([{name => 'foo', description => 'Whatever', required => 1}]);
Arguments for the prompt. literally what it says on the tin β you pass it an arrayref of hashes and it's like "okay noted". the example even shows off name, description and required so you know the shape of things π
π code
my $code = $prompt->code;
$prompt = $prompt->code(sub { ... });
Prompt code. that's the code that does the prompt thing. you get it, you set it, you pass it a coderef. main character energy π₯
π¦ description
my $description = $prompt->description;
$prompt = $prompt->description('A brief description of the prompt');
Description of the prompt. yes bestie, a lil string that says what the prompt is about. a brief description of the prompt, if you will π
π§ name
my $name = $prompt->name;
$prompt = $prompt->name('my_prompt');
Name of the Prompt. capital P on Prompt, love that for her. name your prompt my_prompt or honestly whatever, it's your world πΈ
π METHODS π
MCP::Prompt inherits all methods from MCP::Primitive (so go read that one too, iykyk) and implements the following new ones π
π« call
my $result = $prompt->call($args, $context);
Calls the prompt with the given arguments and context, returning a result. and here's the fun part β the result can be a promise or a direct value. so it might hand you a thing right away, or it might hand you a promise of a thing. both are valid, don't panic π«Ά
π₯ text_prompt
my $result = $prompt->text_prompt('Some text');
my $result = $prompt->text_prompt('Some text', $role);
my $result = $prompt->text_prompt('Some text', $role, $description);
Returns a text prompt in the expected format. the expected format!! three whole ways to call it β just text, text plus a $role, or text plus a $role plus a $description. pick your fighter β¨
π validate_input
my $bool = $prompt->validate_input($args);
Validates the input arguments. Returns true if validation failed. yes babes, read that again β true means it FAILED. it's a "did this go wrong" flag, not a "did this go right" flag. do not get got by this one π
π¦ SEE ALSO π¦
go click around, there's lore π
and that's the whole page, bestie! this lil beauty is perl v5.42.0, dated 2026-07-31, from the MCP::Prompt(3) section of the User Contributed Perl Documentation. slay, read responsibly, mwah πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-MCP 0.150.0-bp160.1.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms