feat: Add output schema support to MCP tools (#153)
This commit is contained in:
parent
4c3e5e61c7
commit
c0938a19bd
1 changed files with 605 additions and 55 deletions
|
|
@ -222,6 +222,7 @@ class Discoverer
|
|||
$name = $instance->name ?? ('__invoke' === $methodName ? $classShortName : $methodName);
|
||||
$description = $instance->description ?? $this->docBlockParser->getSummary($docBlock) ?? null;
|
||||
$inputSchema = $this->schemaGenerator->generate($method);
|
||||
$outputSchema = $this->schemaGenerator->generateOutputSchema($method);
|
||||
$tool = new Tool(
|
||||
$name,
|
||||
$inputSchema,
|
||||
|
|
@ -229,6 +230,7 @@ class Discoverer
|
|||
$instance->annotations,
|
||||
$instance->icons,
|
||||
$instance->meta,
|
||||
$outputSchema,
|
||||
);
|
||||
$tools[$name] = new ToolReference($tool, [$className, $methodName], false);
|
||||
++$discoveredCount['tools'];
|
||||
|
|
|
|||
Loading…
Reference in a new issue