How can i access output of a tool used by an AI Agent?

Hello everyone,

I have an AI agent that responds to user questions. To do this, it calls the “Knowledge” tool with the following input:

Tool Input:

{
    "query": "What is your name?"
}

Tool Output:

{
    "output": "Jeff"
}

The AI agent then uses this information to generate a response. However, I also need direct access to the raw output of the tool so that I can use it later in the workflow.

Questions:

  • Is there a way to access the tool’s output directly?
  • Can I store the raw output for later use in the flow?
1 Like

I think there’s no way to do that directly, unfortunately.
But you could write a feature request, for that.

There’s a workaround, though:

Add this option to your Agent

Enable it

When this tool runs…

You will see its result in the output:


.

:point_right: If my reply answers your question, please remember to mark it as the solution.

3 Likes

Additionally, if you want to filter by the tool name, you can do it like this:

{{ $json.intermediateSteps
    .filter(item => item.action.tool === "get_pokemon_info")
    .map(item => JSON.parse(item.observation)) }}
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.