| 1 | package Catalyst::Plugin::MCP::Role::ResourceProvider; | ||
| 2 | 5 | ▶ | use v5.36; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 5 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 5 | our $VERSION = '0.003'; | |
| 6 | |||
| 7 | 5 | requires qw/list templates read/; | |
| 8 | |||
| 9 | =head1 NAME | ||
| 10 | |||
| 11 | Catalyst::Plugin::MCP::Role::ResourceProvider - MCP resource provider contract | ||
| 12 | |||
| 13 | =head1 REQUIRED METHODS | ||
| 14 | |||
| 15 | =head2 list( $cursor ) | ||
| 16 | |||
| 17 | Return C<< { resources => \@items, nextCursor => $opt } >>. C<$cursor> is the | ||
| 18 | opaque pagination cursor from the request (or undef). Echo a C<nextCursor> only | ||
| 19 | when more pages remain. | ||
| 20 | |||
| 21 | =head2 templates | ||
| 22 | |||
| 23 | Return C<< { resourceTemplates => \@items } >>. | ||
| 24 | |||
| 25 | =head2 read( $uri ) | ||
| 26 | |||
| 27 | Return the read result hashref (C<< { contents => [...] } >>), or C<undef> if | ||
| 28 | the URI is unknown (the engine turns C<undef> into a -32002 error). | ||
| 29 | |||
| 30 | =cut | ||
| 31 | |||
| 32 | 5 | 1; | |