From 824a31f933e9870602fd50a65b4a220f3c0000a8 Mon Sep 17 00:00:00 2001 From: Bujar Begisholli Date: Tue, 11 Nov 2025 15:56:47 +0100 Subject: [PATCH] [Server] Add meta parameter to addTool and addResource methods --- src/Server/Builder.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Server/Builder.php b/src/Server/Builder.php index 9cc92f6a..2e9991eb 100644 --- a/src/Server/Builder.php +++ b/src/Server/Builder.php @@ -315,6 +315,7 @@ public function setProtocolVersion(ProtocolVersion $protocolVersion): self * * @param Handler $handler * @param array|null $inputSchema + * @param array|null $meta */ public function addTool( callable|array|string $handler, @@ -322,8 +323,9 @@ public function addTool( ?string $description = null, ?ToolAnnotations $annotations = null, ?array $inputSchema = null, + ?array $meta = null, ): self { - $this->tools[] = compact('handler', 'name', 'description', 'annotations', 'inputSchema'); + $this->tools[] = compact('handler', 'name', 'description', 'annotations', 'inputSchema', 'meta'); return $this; } @@ -331,7 +333,8 @@ public function addTool( /** * Manually registers a resource handler. * - * @param Handler $handler + * @param Handler $handler + * @param array|null $meta */ public function addResource( \Closure|array|string $handler, @@ -341,8 +344,9 @@ public function addResource( ?string $mimeType = null, ?int $size = null, ?Annotations $annotations = null, + ?array $meta = null, ): self { - $this->resources[] = compact('handler', 'uri', 'name', 'description', 'mimeType', 'size', 'annotations'); + $this->resources[] = compact('handler', 'uri', 'name', 'description', 'mimeType', 'size', 'annotations', 'meta'); return $this; }