Skip to content

Commit 0d2cf85

Browse files
committed
[McpTool] attribute also needs to be extended
1 parent 95907c5 commit 0d2cf85

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Capability/Discovery/DocBlockParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function getReturnDescription(?DocBlock $docBlock): ?string
177177
}
178178

179179
$returnTag = $returnTags[0];
180-
$description = method_exists($returnTag, 'getDescription')
180+
$description = method_exists($returnTag, 'getDescription')
181181
? trim((string) $returnTag->getDescription())
182182
: '';
183183

src/Server/Builder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ public function setDiscovery(
269269
*
270270
* @param Handler $handler
271271
* @param array<string, mixed>|null $inputSchema
272+
* @param array<string, mixed>|null $outputSchema
272273
*/
273274
public function addTool(
274275
callable|array|string $handler,
@@ -434,7 +435,7 @@ private function registerCapabilities(
434435
}
435436

436437
$inputSchema = $data['inputSchema'] ?? $schemaGenerator->generate($reflection);
437-
$outputSchema = isset($data['outputSchema']) && \is_array($data['outputSchema']) ? $data['outputSchema'] : null;
438+
$outputSchema = $data['outputSchema'] ?? $schemaGenerator->generateOutputSchema($reflection);
438439

439440
$tool = new Tool($name, $inputSchema, $description, $data['annotations'], $outputSchema);
440441
$registry->registerTool($tool, $data['handler'], true);

0 commit comments

Comments
 (0)