fix(ui): render MCP tool output in GenericTool fallback#22035
Open
Femumme wants to merge 1 commit intoanomalyco:devfrom
Open
fix(ui): render MCP tool output in GenericTool fallback#22035Femumme wants to merge 1 commit intoanomalyco:devfrom
Femumme wants to merge 1 commit intoanomalyco:devfrom
Conversation
GenericTool now accepts and renders the output prop using the same Show/Markdown/data-scrollable pattern as built-in tools, making MCP tool results visible in the web/desktop UI.
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate Found:
Why it's related: This PR appears to address the same issue - rendering MCP tool output in the GenericTool component. The current PR (#22035) specifically targets the UI aspect in the fallback renderer, while #15865 also aims to render MCP tool output in GenericTool. You should verify if #15865 already addresses this or if there's a different scope/context. |
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.
GenericTool now accepts and renders the output prop using the same data-scrollable pattern as built-in tools, making MCP tool results visible in the web/desktop UI.
Issue for this PR
Closes #15825
Type of change
What does this PR do?
The
GenericTool(the fallback renderer for MCP tools) was a self-closing<BasicTool />— No output was rendered to the user whatsoever.That way no user could see what actually was returned from the MCP tools - they had to rely on the LLM to interprete it correctly.
To fix this, I added the
outputprop. Render it inside BasicTool using the same output as the bash-tool - this wraps the output in a copyable box.I also tested it using only the
Markdowncomponent, which also worked fine, but I found that the bash-output gives it a more polished and consistent look to other tools. If you would like to have the Markdown component instead, let me know and I'll change it.Using only the Markdown component would make this only a few lines of change, if you prefer to keep the change smaller.
How did you verify your code works?
I started the UI locally using
bun devand let the agent execute a custom MCP tool (kindly-web-search)Screenshots / recordings
Before:

After (Collapsed):

After (Expanded):

Checklist