read output in a code block

This commit is contained in:
Cole Miller
2025-08-28 21:08:26 -04:00
parent fab3728386
commit abae47de80

View File

@@ -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) => ({