Referencing AI Agent

Is it possible to reference the response from the tools that AI agent interacted with? I need to log actions into a database and was wondering if I can reference data directly without additional steps. Tried to do {{ $(“create_event”).item.json.id }} but it says [ERROR: No path back to node] (*again, I`m trying to reference AI Agents tool interaction).

Any tips?

Hi @waider ,
Yes, you can reference the response from the tools that the AI agent used!

The trick is that when the AI Agent calls a tool (like creating a Google Calendar event), the response data is included in the AI Agent node’s output. You just need to reference it correctly.

Try using:

{{ $json.response.id }}

This should grab the event ID from the tool’s response. If that doesn’t work, it might be nested differently - check the OUTPUT panel on the right side of your screen to see the exact structure of what’s being returned.

The reason {{ $("create_event").item.json.id }} didn’t work is because “create_event” isn’t actually a separate node - it’s a tool that the AI Agent called, so the data lives within the AI Agent node’s output itself.