File Coverage

blib/lib/MCP/Constants.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition 1 2 50.0
subroutine 2 2 100.0
pod n/a
total 9 10 90.0


line stmt bran cond sub pod time code
1             package MCP::Constants;
2 2     2   15 use Mojo::Base 'Exporter';
  2         4  
  2         16  
3              
4             use constant {
5             INVALID_PARAMS => -32602,
6             INVALID_REQUEST => -32600,
7             METHOD_NOT_FOUND => -32601,
8             PARSE_ERROR => -32700,
9 2   50     488 PROTOCOL_VERSION => $ENV{MOJO_MCP_VERSION} || '2025-11-25',
10             RESOURCE_NOT_FOUND => -32002
11 2     2   713 };
  2         16  
12              
13             our @EXPORT_OK = qw(INVALID_PARAMS INVALID_REQUEST METHOD_NOT_FOUND PARSE_ERROR PROTOCOL_VERSION RESOURCE_NOT_FOUND);
14              
15             1;
16              
17             =encoding utf8
18              
19             =head1 NAME
20              
21             MCP::Constants - Constants for MCP (Model Context Protocol)
22              
23             =head1 SYNOPSIS
24              
25             use MCP::Constants qw(PROTOCOL_VERSION);
26              
27             =head1 DESCRIPTION
28              
29             L provides constants used in MCP (Model Context Protocol).
30              
31             =head1 CONSTANTS
32              
33             L exports the following constants.
34              
35             =head2 INVALID_PARAMS
36              
37             The error code for invalid parameters.
38              
39             =head2 INVALID_REQUEST
40              
41             The error code for an invalid request.
42              
43             =head2 METHOD_NOT_FOUND
44              
45             The error code for a method that was not found.
46              
47             =head2 PARSE_ERROR
48              
49             The error code for a parse error.
50              
51             =head2 PROTOCOL_VERSION
52              
53             The version of the Model Context Protocol being used.
54              
55             =head2 RESOURCE_NOT_FOUND
56              
57             The error code for a resource that was not found.
58              
59             =head1 SEE ALSO
60              
61             L, L, L.
62              
63             =cut