Tool-output tabs don't get JSON syntax highlighting/formatting

Open 💬 0 comments Opened Jul 9, 2026 by guillermojast

When an MCP tool (or other tool) returns JSON output that opens in a readonly editor tab (path like /temp/readonly/<tool-name> tool output (<id>)), the content renders as a single unformatted line instead of pretty-printed JSON. The tab has no file extension, so VS Code doesn't apply its JSON language mode/formatter.

Impact: Large JSON payloads (common with MCP tool results) are unreadable without manually copying the content into a new .json file just to get formatting.

Suggested fix: When tool output is detected as JSON, either (a) give the readonly tab a .json extension/language mode so VS Code's built-in formatter applies, or (b) pretty-print the JSON server-side before writing it to the tab.

View original on GitHub ↗