MCP/Constants.pm

filter: Statementstmt 100% 8 / 8 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 84.6% 11 / 13 CC 2 SCAR 5.1
CC
2
Cov
90%
BEGIN
2.0
BEGIN
1.0
CRAP 1.7
« MCP/Resource.pm ↑ Summary MCP/Server/Transport.pm »
1 package MCP::Constants;
2 4 ▶use Mojo::Base 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 use constant {
5 INSUFFICIENT_SCOPE => -32003,
6 INVALID_PARAMS => -32602,
7 INVALID_REQUEST => -32600,
8 METHOD_NOT_FOUND => -32601,
9 PARSE_ERROR => -32700,
10 4 ▶ PROTOCOL_VERSION => $ENV{MOJO_MCP_VERSION} || '2025-11-25',
Condition50%1/2
$ENV{'MOJO_MCP_VERSION'} || '2025-11-25'
l!l
04
MC/DC0%0/1
$ENV{'MOJO_MCP_VERSION'} || '2025-11-25'
$ENV{'MOJO_MCP_VERSION'}
Truth table50%1/2
A
A= $ENV{'MOJO_MCP_VERSION'}
Aresult
11
00
11 RESOURCE_NOT_FOUND => -32002
12 4 ▶};
Subroutine BEGIN: called CC=2 SCAR=6.9
13  
14 our @EXPORT_OK
15 4 = qw(INSUFFICIENT_SCOPE INVALID_PARAMS INVALID_REQUEST METHOD_NOT_FOUND PARSE_ERROR PROTOCOL_VERSION RESOURCE_NOT_FOUND);
16  
17 4 1;
18  
19 =encoding utf8
20  
21 =head1 NAME
22  
23 MCP::Constants - Constants for MCP (Model Context Protocol)
24  
25 =head1 SYNOPSIS
26  
27 use MCP::Constants qw(PROTOCOL_VERSION);
28  
29 =head1 DESCRIPTION
30  
31 L<MCP::Constants> provides constants used in MCP (Model Context Protocol).
32  
33 =head1 CONSTANTS
34  
35 L<MCP::Constants> exports the following constants.
36  
37 =head2 INSUFFICIENT_SCOPE
38  
39 The error code for a request whose access token lacks a required OAuth scope.
40  
41 =head2 INVALID_PARAMS
42  
43 The error code for invalid parameters.
44  
45 =head2 INVALID_REQUEST
46  
47 The error code for an invalid request.
48  
49 =head2 METHOD_NOT_FOUND
50  
51 The error code for a method that was not found.
52  
53 =head2 PARSE_ERROR
54  
55 The error code for a parse error.
56  
57 =head2 PROTOCOL_VERSION
58  
59 The version of the Model Context Protocol being used.
60  
61 =head2 RESOURCE_NOT_FOUND
62  
63 The error code for a resource that was not found.
64  
65 =head1 SEE ALSO
66  
67 L<MCP>, L<https://mojolicious.org>, L<https://modelcontextprotocol.io>.
68  
69 =cut
« MCP/Resource.pm ↑ Summary MCP/Server/Transport.pm »