-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmcp_tools.api.php
More file actions
40 lines (37 loc) · 1.06 KB
/
mcp_tools.api.php
File metadata and controls
40 lines (37 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* @file
* Hooks provided by the MCP Tools module.
*/
declare(strict_types=1);
/**
* Declare MCP components without Tool API plugins.
*
* Modules can return tools, resources, resource templates, and prompts in a
* simple array structure. Each entry should match the corresponding Server
* builder signature (handler callable plus metadata).
*
* @return array<string, array<int, array<string, mixed>>>
* Component definitions keyed by component type.
*/
function hook_mcp_tools_components(): array {
return [
'tools' => [
[
'name' => 'my_module/ping',
'description' => 'Return a simple ping response.',
'handler' => function (): \Mcp\Schema\Result\CallToolResult {
return new \Mcp\Schema\Result\CallToolResult([
new \Mcp\Schema\Content\TextContent('pong'),
]);
},
'inputSchema' => [
'type' => 'object',
'properties' => new \stdClass(),
],
// Optional public marker for auto-discovery filters.
'public' => TRUE,
],
],
];
}