Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/src/TestAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ function convertToToolSet(tools: Tool[]): ToolSet {
const converted = dynamicTool({
description: tool.description,
inputSchema: jsonSchema(ensureJsonSchemaObject(tool.inputSchema)),
...(tool.outputSchema ? { outputSchema: jsonSchema(tool.outputSchema as any) } : {}),
execute: async (args, options) => {
options?.abortSignal?.throwIfAborted?.();
const result = await tool.execute(args as Record<string, unknown>);
Expand Down
3 changes: 2 additions & 1 deletion sdk/src/mcp-client-manager/tool-converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export async function convertMCPToolsToVercelTools(
const tools: ToolSet = {};

for (const toolDescription of listToolsResult.tools) {
const { name, description, inputSchema } = toolDescription;
const { name, description, inputSchema, outputSchema } = toolDescription;
const toolMeta = toolDescription._meta as
| Record<string, unknown>
| undefined;
Expand Down Expand Up @@ -257,6 +257,7 @@ export async function convertMCPToolsToVercelTools(
description,
inputSchema: jsonSchema(normalizedInputSchema),
execute,
...(outputSchema ? { outputSchema: jsonSchema(outputSchema as any) } : {}),
...(toModelOutput ? { toModelOutput } : {}),
...(needsApproval != null ? { needsApproval } : {}),
});
Expand Down