[Server] Add meta parameter to addTool and addResource methods (#144)
This commit is contained in:
parent
a9cd8d550f
commit
8daca8129e
1 changed files with 7 additions and 3 deletions
|
|
@ -315,6 +315,7 @@ final class Builder
|
||||||
*
|
*
|
||||||
* @param Handler $handler
|
* @param Handler $handler
|
||||||
* @param array<string, mixed>|null $inputSchema
|
* @param array<string, mixed>|null $inputSchema
|
||||||
|
* @param array<string, mixed>|null $meta
|
||||||
*/
|
*/
|
||||||
public function addTool(
|
public function addTool(
|
||||||
callable|array|string $handler,
|
callable|array|string $handler,
|
||||||
|
|
@ -322,8 +323,9 @@ final class Builder
|
||||||
?string $description = null,
|
?string $description = null,
|
||||||
?ToolAnnotations $annotations = null,
|
?ToolAnnotations $annotations = null,
|
||||||
?array $inputSchema = null,
|
?array $inputSchema = null,
|
||||||
|
?array $meta = null,
|
||||||
): self {
|
): self {
|
||||||
$this->tools[] = compact('handler', 'name', 'description', 'annotations', 'inputSchema');
|
$this->tools[] = compact('handler', 'name', 'description', 'annotations', 'inputSchema', 'meta');
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
@ -332,6 +334,7 @@ final class Builder
|
||||||
* Manually registers a resource handler.
|
* Manually registers a resource handler.
|
||||||
*
|
*
|
||||||
* @param Handler $handler
|
* @param Handler $handler
|
||||||
|
* @param array<string, mixed>|null $meta
|
||||||
*/
|
*/
|
||||||
public function addResource(
|
public function addResource(
|
||||||
\Closure|array|string $handler,
|
\Closure|array|string $handler,
|
||||||
|
|
@ -341,8 +344,9 @@ final class Builder
|
||||||
?string $mimeType = null,
|
?string $mimeType = null,
|
||||||
?int $size = null,
|
?int $size = null,
|
||||||
?Annotations $annotations = null,
|
?Annotations $annotations = null,
|
||||||
|
?array $meta = null,
|
||||||
): self {
|
): self {
|
||||||
$this->resources[] = compact('handler', 'uri', 'name', 'description', 'mimeType', 'size', 'annotations');
|
$this->resources[] = compact('handler', 'uri', 'name', 'description', 'mimeType', 'size', 'annotations', 'meta');
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue