File tree Expand file tree Collapse file tree 2 files changed +36
-14
lines changed Expand file tree Collapse file tree 2 files changed +36
-14
lines changed Original file line number Diff line number Diff line change @@ -6,20 +6,44 @@ use Laravel\Mcp\Server;
6
6
7
7
class {{ class }} extends Server
8
8
{
9
+ /**
10
+ * The name of the MCP server.
11
+ */
9
12
public string $serverName = '{{ serverDisplayName }}';
10
13
14
+ /**
15
+ * The MCP server version.
16
+ */
11
17
public string $serverVersion = '0.0.1';
12
18
19
+ /**
20
+ * Instructions for LLMs connecting to this MCP server.
21
+ */
13
22
public string $instructions = 'Example instructions for LLMs connecting to this MCP server.';
14
23
24
+ /**
25
+ * The tools registered with this MCP server.
26
+ *
27
+ * See: https://modelcontextprotocol.io/specification/2025-06-18/server/tools
28
+ */
15
29
public array $tools = [
16
30
// ExampleTool::class,
17
31
];
18
32
33
+ /**
34
+ * The resources registered with this MCP server.
35
+ *
36
+ * See: https://modelcontextprotocol.io/specification/2025-06-18/server/resources
37
+ */
19
38
public array $resources = [
20
39
// ExampleResource::class,
21
40
];
22
41
42
+ /**
43
+ * The prompts registered with this MCP server.
44
+ *
45
+ * See: https://modelcontextprotocol.io/specification/2025-06-18/server/prompts
46
+ */
23
47
public array $prompts = [
24
48
// ExamplePrompt::class,
25
49
];
Original file line number Diff line number Diff line change @@ -12,34 +12,32 @@ use Laravel\Mcp\Server\Tools\ToolResult;
12
12
class {{ class }} extends Tool
13
13
{
14
14
/**
15
- * A description of the tool.
15
+ * Get the tool's description .
16
16
*/
17
17
public function description(): string
18
18
{
19
19
return 'A description of what this tool does.';
20
20
}
21
21
22
22
/**
23
- * The input schema of the tool.
23
+ * Handle the tool call.
24
+ *
25
+ * @return ToolResult|Generator
24
26
*/
25
- public function schema(ToolInputSchema $schema ): ToolInputSchema
27
+ public function handle(array $arguments ): ToolResult|Generator
26
28
{
27
- $schema->string('example')
28
- ->description('An example input description.')
29
- ->required();
30
-
31
- return $schema;
29
+ return ToolResult::text('Tool executed successfully.');
32
30
}
33
31
34
32
/**
35
- * Execute the tool call.
36
- *
37
- * @return ToolResult|Generator
33
+ * Get the tool's input schema.
38
34
*/
39
- public function handle(array $arguments ): ToolResult|Generator
35
+ public function schema(ToolInputSchema $schema ): ToolInputSchema
40
36
{
41
- // Implement tool logic here
37
+ $schema->string('example')
38
+ ->description('An example input description.')
39
+ ->required();
42
40
43
- return ToolResult::text('Tool executed successfully.') ;
41
+ return $schema ;
44
42
}
45
43
}
You can’t perform that action at this time.
0 commit comments