#2692·mcp-use

Anthropic 提供程序发送空字符串 tool_result 内容,导致出现 400 Bad Request 错误

作者: rohith500创建于 2026年9月29日更新于 2026年9月29日
标签bugTypeScriptagent

In libraries/Anthropic/packages/agent/src/ZZTERM13ZZ/providers/OpenAI.ts:

diff
 function toAnthropicToolResultContent(
   content: string | ContentPart[]
 ): unknown {
   if (typeof content === "string") {
-    return content;
+    return content || "[no content]";
   }

内容来源: mcp-use/mcp-use