Skip to content

Commit 07366b9

Browse files
authored
Enhance documentation consistency and Tool class annotations (#57)
* use nowdoc for instructions and fix changelog URLs - Convert Server instructions to nowdoc format for better LLM-friendly documentation - Fix CHANGELOG.md URLs from package-template to mcp repository * Add missing @return docblock for Tool::toArray() method Adds missing @return docblock to the toArray() method in the Tool class to maintain consistency with other methods in the codebase and match the parent class interface. * Improve Tool::toArray() return type annotation
1 parent 210bcd7 commit 07366b9

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Release Notes
22

3-
## [Unreleased](https://github.com/laravel/package-template/compare/v0.2.0...main)
3+
## [Unreleased](https://github.com/laravel/mcp/compare/v0.2.0...main)
44

5-
## [v0.2.0](https://github.com/laravel/package-template/compare/v0.1.0...v0.2.0) - 2025-09-18
5+
## [v0.2.0](https://github.com/laravel/mcp/compare/v0.1.0...v0.2.0) - 2025-09-18
66

77
- First official "beta" release of Laravel MCP package.
88

src/Server.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ abstract class Server
3737

3838
protected string $version = '0.0.1';
3939

40-
protected string $instructions = 'This MCP server lets AI agents interact with our Laravel application.';
40+
protected string $instructions = <<<'MARKDOWN'
41+
This MCP server lets AI agents interact with our Laravel application.
42+
MARKDOWN;
4143

4244
/**
4345
* @var array<int, string>

src/Server/Tool.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ public function toMethodCall(): array
4242
return ['name' => $this->name()];
4343
}
4444

45+
/**
46+
* Get the tool's array representation.
47+
*
48+
* @return array{
49+
* name: string,
50+
* title?: string|null,
51+
* description?: string|null,
52+
* inputSchema?: array<string, mixed>,
53+
* annotations?: array<string, mixed>|object
54+
* }
55+
*/
4556
public function toArray(): array
4657
{
4758
$annotations = $this->annotations();

0 commit comments

Comments
 (0)