Skip to content

Commit c79115a

Browse files
committed
[Server] Add meta parameter to addTool and addResource methods
1 parent 5804ba9 commit c79115a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Server/Builder.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,23 +315,26 @@ public function setProtocolVersion(ProtocolVersion $protocolVersion): self
315315
*
316316
* @param Handler $handler
317317
* @param array<string, mixed>|null $inputSchema
318+
* @param array<string, mixed>|null $meta
318319
*/
319320
public function addTool(
320321
callable|array|string $handler,
321322
?string $name = null,
322323
?string $description = null,
323324
?ToolAnnotations $annotations = null,
324325
?array $inputSchema = null,
326+
?array $meta = null,
325327
): self {
326-
$this->tools[] = compact('handler', 'name', 'description', 'annotations', 'inputSchema');
328+
$this->tools[] = compact('handler', 'name', 'description', 'annotations', 'inputSchema', 'meta');
327329

328330
return $this;
329331
}
330332

331333
/**
332334
* Manually registers a resource handler.
333335
*
334-
* @param Handler $handler
336+
* @param Handler $handler
337+
* @param array<string, mixed>|null $meta
335338
*/
336339
public function addResource(
337340
\Closure|array|string $handler,
@@ -341,8 +344,9 @@ public function addResource(
341344
?string $mimeType = null,
342345
?int $size = null,
343346
?Annotations $annotations = null,
347+
?array $meta = null,
344348
): self {
345-
$this->resources[] = compact('handler', 'uri', 'name', 'description', 'mimeType', 'size', 'annotations');
349+
$this->resources[] = compact('handler', 'uri', 'name', 'description', 'mimeType', 'size', 'annotations', 'meta');
346350

347351
return $this;
348352
}

0 commit comments

Comments
 (0)