Tool output as input to another tool

Hey i have an Agent with multiple tools.
I am controlling the tool execution using the Agent prompt.
I need to set the input of one tool as input to the other tool. How do i do that?
Is it even possible?
Thanks
Prince

Yes, you can instruct the AI agent to do that. It will get the output and use as input.

Configuring your tools with appropriate description and using $fromAI function should be enough.


Another option would be to use a sub-workflow and use the tool “Call subworkflow” to run everything in a single call.

In this case you would use normal nodes to run everything and just return the final output to the AI.

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

Hey @Prince_Mathew , I think I found the solution you need:

I think there’s no way to do that directly, unfortunately.

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:

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)) }}

.

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

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