Handling inconsistent JSON Responses in Rovo Agent Prompts
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
When using Rovo agent prompts, the final prompt response may appear inconsistent or not match the expected JSON structure, even though the Debug response shows the correct JSON output. This typically happens when sub-agent output is altered before it is returned. Adding specific formatting instructions to the Rovo agent > Instructions section resolves the issue and ensures the final response preserves the expected JSON format.
Solution
To fix inconsistent JSON responses, update the main agent instructions so the agent returns the sub-agent response exactly as received, without reformatting or combining multiple sub-agent outputs.
Step 1: Open the Rovo agent instructions
Go to the affected Rovo agent and open the Instructions section used by the prompt.
Step 2: Add the required instruction block
Add the following lines to the Rovo agent > Instructions:
if a subagent is called, return only exactly the response of the sub-agent.
Don’t execute multi subagents
If a specific format is specified in the sub-agent follow that and do not change anything about the format.
Example : if output is requested in JSON in Below format, make sure the output is in same format else output will be incorrect:
{
"key1": "value 1",
"num": int
}Step 3: Save and test the prompt again
After saving the updated instructions, run the same prompt again and compare the final response with the Debug response.
Expected Result
The response should now be returned in the expected JSON format, matching the sub-agent output without extra modifications.
Additional Notes
This issue can occur regardless of scenario configuration.
If the Debug response is already correct JSON, the problem is often in how the main agent handles or rewrites the sub-agent response.
The key fix is to instruct the agent to return only the exact sub-agent output and to avoid changing the required format.
Was this helpful?