Skip to content

Commit 703985b

Browse files
committed
update stubs
1 parent 6d6284a commit 703985b

File tree

2 files changed

+36
-14
lines changed

2 files changed

+36
-14
lines changed

stubs/server.stub

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,44 @@ use Laravel\Mcp\Server;
66

77
class {{ class }} extends Server
88
{
9+
/**
10+
* The name of the MCP server.
11+
*/
912
public string $serverName = '{{ serverDisplayName }}';
1013

14+
/**
15+
* The MCP server version.
16+
*/
1117
public string $serverVersion = '0.0.1';
1218

19+
/**
20+
* Instructions for LLMs connecting to this MCP server.
21+
*/
1322
public string $instructions = 'Example instructions for LLMs connecting to this MCP server.';
1423

24+
/**
25+
* The tools registered with this MCP server.
26+
*
27+
* See: https://modelcontextprotocol.io/specification/2025-06-18/server/tools
28+
*/
1529
public array $tools = [
1630
// ExampleTool::class,
1731
];
1832

33+
/**
34+
* The resources registered with this MCP server.
35+
*
36+
* See: https://modelcontextprotocol.io/specification/2025-06-18/server/resources
37+
*/
1938
public array $resources = [
2039
// ExampleResource::class,
2140
];
2241

42+
/**
43+
* The prompts registered with this MCP server.
44+
*
45+
* See: https://modelcontextprotocol.io/specification/2025-06-18/server/prompts
46+
*/
2347
public array $prompts = [
2448
// ExamplePrompt::class,
2549
];

stubs/tool.stub

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,32 @@ use Laravel\Mcp\Server\Tools\ToolResult;
1212
class {{ class }} extends Tool
1313
{
1414
/**
15-
* A description of the tool.
15+
* Get the tool's description.
1616
*/
1717
public function description(): string
1818
{
1919
return 'A description of what this tool does.';
2020
}
2121

2222
/**
23-
* The input schema of the tool.
23+
* Handle the tool call.
24+
*
25+
* @return ToolResult|Generator
2426
*/
25-
public function schema(ToolInputSchema $schema): ToolInputSchema
27+
public function handle(array $arguments): ToolResult|Generator
2628
{
27-
$schema->string('example')
28-
->description('An example input description.')
29-
->required();
30-
31-
return $schema;
29+
return ToolResult::text('Tool executed successfully.');
3230
}
3331

3432
/**
35-
* Execute the tool call.
36-
*
37-
* @return ToolResult|Generator
33+
* Get the tool's input schema.
3834
*/
39-
public function handle(array $arguments): ToolResult|Generator
35+
public function schema(ToolInputSchema $schema): ToolInputSchema
4036
{
41-
// Implement tool logic here
37+
$schema->string('example')
38+
->description('An example input description.')
39+
->required();
4240

43-
return ToolResult::text('Tool executed successfully.');
41+
return $schema;
4442
}
4543
}

0 commit comments

Comments
 (0)