bandaid for broken mcp calls (#732)

This commit is contained in:
Olcan 2025-06-03 14:40:36 -07:00 committed by GitHub
parent 12059eb4ca
commit 80a445c7ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -128,6 +128,10 @@ export function formatLlmContentForFunctionResponse(
additionalParts.push(contentToProcess);
} else if (contentToProcess.text !== undefined) {
functionResponseJson = { output: contentToProcess.text };
} else if (contentToProcess.functionResponse) {
functionResponseJson = JSON.parse(
JSON.stringify(contentToProcess.functionResponse),
);
} else {
functionResponseJson = { status: 'Tool execution succeeded.' };
additionalParts.push(contentToProcess);

View File

@ -96,10 +96,9 @@ This MCP tool named '${serverToolName}' was discovered from '${serverName}' MCP
const responseParts: Part[] = await this.mcpTool.callTool(functionCalls);
const output = getStringifiedResultForDisplay(responseParts);
return {
llmContent: responseParts,
returnDisplay: output,
returnDisplay: getStringifiedResultForDisplay(responseParts),
};
}
}