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 4     4   23 use Mojo::Base 'Exporter';
  4         8  
  4         23  
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   50     642 PROTOCOL_VERSION => $ENV{MOJO_MCP_VERSION} || '2025-11-25',
11             RESOURCE_NOT_FOUND => -32002
12 4     4   1032 };
  4         6  
13              
14             our @EXPORT_OK
15             = qw(INSUFFICIENT_SCOPE INVALID_PARAMS INVALID_REQUEST METHOD_NOT_FOUND PARSE_ERROR PROTOCOL_VERSION RESOURCE_NOT_FOUND);
16              
17             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 provides constants used in MCP (Model Context Protocol).
32              
33             =head1 CONSTANTS
34              
35             L 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, L, L.
68              
69             =cut