claude-code-action icon indicating copy to clipboard operation
claude-code-action copied to clipboard

Failing MCP tool calls render [object Object] in the step summary

Open ManoharPaturi opened this issue 2 months ago • 1 comments

what happens

when an MCP tool call fails, the step summary renders the error as [object Object] instead of the actual error text.

why

mcp servers return tool errors as a content array of text blocks ([{type: "text", text: "..."}]), including the action's own mcp server. the error branch in formatResultContent interpolates toolResult.content straight into a template string, so an array stringifies to [object Object]. the non-error branch handles arrays via formatResultContent, the error branch does not.

repro

a tool result with is_error: true and content: [{type: "text", text: "boom"}] produces ❌ **Error:** \[object Object]`` in the summary.

expected

the error shows boom.

env: main a4f54ef

ManoharPaturi avatar Sep 18 '26 09:09 ManoharPaturi

Hi maintainers,

I'd like to investigate and contribute a fix for this issue.

My proposed approach is to trace the MCP error-formatting path, reuse the existing content formatter where appropriate, and add a regression test to ensure text-block errors are rendered as readable messages rather than [object Object].

Could a maintainer or experienced contributor review this approach or point me toward the relevant test conventions before I open a PR?

I'll first verify that the issue is still available and check the current implementation.

Thank you!

Udit-Agarwal20 avatar Oct 16 '26 10:10 Udit-Agarwal20