MCP tool approval dialog: array/object params render as one compact JSON line, not pretty-printed
Summary
When Claude Code shows the approval dialog for a gated MCP tool call, array/object parameters (e.g. a changes: [{description, sql}, ...] list) are rendered as one compact, minified JSON blob instead of being pretty-printed. For tools whose whole design intent is per-step readability in that exact dialog, this defeats the purpose.
Example
A custom MCP tool for running database changes takes a changes parameter shaped as changes: [{description, sql}] — one entry per logical step — specifically so the approval dialog stays readable. Quote from the tool's own description: "one entry per logical step ... This keeps the approval dialog readable — a description sits next to each chunk of SQL instead of one giant undifferentiated script."
What actually rendered in the approval prompt was the entire changes array as a single unbroken line of escaped JSON, e.g.:
changes: [{"description":"Create role","sql":"CREATE ROLE REPORTING_ROLE;"},{"description":"Grant read access on database A","sql":"GRANT USAGE ON DATABASE DB_A TO ROLE REPORTING_ROLE;\nGRANT USAGE ON ALL SCHEMAS IN DATABASE DB_A TO ROLE REPORTING_ROLE;\n..."}, ...]
Each sql value does contain embedded \n for per-statement line breaks, but the surrounding array/object structure isn't indented or broken across lines at all, so the whole thing reads as one dense wall of text — exactly the outcome the tool author was trying to design around.
Secondary, related gap
The same approval prompt appends the tool's registered MCP description field verbatim, in full, after the call signature — every single time the tool is invoked. That description is authored for the calling model (parameter shapes, routing rules, usage guidance) rather than for a human reviewer deciding whether to approve a production change. There's no separate, shorter reviewer-facing summary — the model-facing docstring is reused wholesale as approval-dialog copy, which for verbose tool descriptions adds a lot of noise around the one thing a reviewer actually needs to read closely (the args).
Suggested fix
- Pretty-print (indent) array/object parameter values in the approval dialog instead of rendering them as compact/minified JSON.
- Consider truncating or collapsing (expandable) the tool's
descriptionfield in the approval prompt, or supporting a separate short "reviewer summary" distinct from the model-facing tool description.
Environment
- Claude Code CLI, MCP server tool (Python,
mcp.tooldecorator withdescription=string)