feat: improve output for mcp query and result#12
Open
titouanmathis wants to merge 3 commits intonicobailon:mainfrom
Open
feat: improve output for mcp query and result#12titouanmathis wants to merge 3 commits intonicobailon:mainfrom
titouanmathis wants to merge 3 commits intonicobailon:mainfrom
Conversation
Both direct tools and the mcp proxy tool now display their name and arguments inline on invocation, matching the style of native pi tools like read and edit (toolTitle bold + accent args). - Import Text from @mariozechner/pi-tui - Add renderCall to direct tool registrations - Add renderCall to the mcp proxy tool - Add formatArgsCompact() helper (key=value pairs, truncated to 80 chars)
MCP tool results are now shown collapsed to 10 lines by default, with a native expand hint consistent with built-in pi tools (bash, read, etc). - Import keyHint from @mariozechner/pi-coding-agent - Add renderResult to direct tool registrations - Add renderResult to the mcp proxy tool - Add renderMcpResult() shared helper with isPartial/expanded handling
Author
|
I've been running a similar implementation locally and it makes a huge difference -- MCP tools that return large responses (indexing tools, repo outlines, etc.) no longer flood the terminal. Here's what it looks like in practice with a 157K+ char response collapsed to 3 lines: Would love to see this merged and part of the core repo. The current behavior of dumping full MCP responses makes it hard to follow the conversation flow. I also think this version of the implementation is quite clean over the #8 version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

MCP tool calls have no visual feedback for the query being run and output result is displaid in full.
This PR adds support both
renderCallandrenderResultto both direct tools and the mcp proxy tool to match behavior from other pi tools (read, write, etc.). The tool name and args are displayed inline on invocation, and results are collapsed to 10 lines with a native expand hint withctrl+o.