Hi everyone!
We have a tool that generates a structured report (markdown with sections/lists/etc) for the user. The issue is: even though the tool returns the content in the correct format, the agent rewrites it and replies with a different version — despite clear instructions. This leads to unnecessary token usage and unexpected formatting.
I considered some alternatives:
• Instructing the agent not to reply at all and rendering the toolInvocation result directly on the frontend. But that doesn’t scale well, since we’d have to hardcode which tools the agent should stay silent for.
• Letting the tool return raw structured data, and asking the agent to format it. But this agent already handles multiple tools, and adding too many formatting instructions adds noise and complexity.
I imagine this would work better with AgentNetwork, right? But since we’re still using memory and AgentNetwork isn’t fully available, I’m looking for alternative solutions.
Any other ideas or best practices to deal with this?
Thanks!