From abae47de805d70ef2b30d007699d370211538ca7 Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Thu, 28 Aug 2025 21:08:26 -0400 Subject: [PATCH] read output in a code block --- src/tools.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/tools.ts b/src/tools.ts index 11ea7076..59a104f9 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -463,9 +463,20 @@ export function toolUpdateFromToolResult( case "WebFetch": case "WebSearch": case "Other": + case "mcp__acp__read": + if (Array.isArray(toolResult.content)) { + return { + content: toolResult.content.map((content: any) => ({ + type: "content", + content: { + type: "text", + text: `\`\`\`${toolUse.input?.abs_path ?? ""}\n${content.text ?? ""}\n\`\`\``, + }, + })), + }; + } + return {}; default: { - // This happens for the mcp__acp__read tool, - // but may also for others... if (Array.isArray(toolResult.content)) { return { content: toolResult.content.map((content: any) => ({