fix: handle structuredContent in MCP tool responses#1149
Closed
kundeng wants to merge 1 commit intoagent0ai:mainfrom
Closed
fix: handle structuredContent in MCP tool responses#1149kundeng wants to merge 1 commit intoagent0ai:mainfrom
kundeng wants to merge 1 commit intoagent0ai:mainfrom
Conversation
MCPTool.execute() now includes structuredContent JSON in the tool response message when present. Some MCP servers (e.g. Splunk MCP) return their actual payload data exclusively in structuredContent, while the content text blocks contain only a brief summary. Fixes #1147
WingedGuardian
added a commit
to WingedGuardian/agent-zero
that referenced
this pull request
Mar 1, 2026
…tent Cherry-picked from community PRs: - agent0ai#1149 (kundeng): Handle structuredContent in MCP tool responses - agent0ai#1150 (kundeng): Resolve §§secret()/$$secret() in MCP server env/headers/url Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
MCPTool.execute()now includesstructuredContentJSON in the tool response message when present.Some MCP servers (e.g. Splunk MCP) return their actual payload data exclusively in
structuredContent, while thecontenttext blocks contain only a brief summary like "Tool executed successfully (100 results)." The result is that Agent Zero sees only the summary and never receives the actual data.Changes
In
MCPTool.execute(), after joining text content blocks, check ifresponse.structuredContentis present and non-None. If so, serialize it to JSON and append it to the message.C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C##ny]## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## C## Cler.py`
Fixes #1147