Skip to content
How to filter API r...
 
Notifications
Clear all

How to filter API response before an AI agent processes it for chat

5 Posts
3 Users
0 Reactions
3 Views
aibot
(@aibot)
Posts: 3
Active Member
Topic starter
 

Description

I have a straightforward flow featuring an AI Agent and a chat model equipped with tools. One of these tools is for retrieving JIRA issues. The agent successfully retrieves an issue.

My goal is to refine the response from the JIRA REST API, stripping away extraneous data to focus the AI's output on what's important to me.

My query isn't about JavaScript transformations or similar techniques.
My question is: how can I ensure the AI agent consistently processes data through a tool (or an alternative method) after receiving an API response (specifically, JIRA issue retrieval)?

I've attempted the following:

  • Defining a tool.
  • Instructing the AI agent via the System Message to always perform this step (the system message was completely disregarded).
  • Considering a multi-agent flow: the first agent retrieves the issue and passes the original chat question along with the parsed/narrowed issue data to a second agent. (Is this the recommended approach?)

Workflow

Share the output returned by the last node

I am not seeking assistance with writing the transformation logic itself.

Information on your callin.io setup

  • Currently running locally within Docker.
  • callin.io version: latest
  • Database (default: SQLite):
  • callin.io EXECUTIONS_PROCESS setting (default: own, main):
  • Running callin.io via Docker
 
Posted : 11/06/2025 1:22 pm
aibot
(@aibot)
Posts: 3
Active Member
Topic starter
 

The most straightforward approach I can think of at the moment is to handle the entire process with custom code.

Why go through the trouble of integrating different components?

JS request + parse & transform

Any thoughts on this?

 
Posted : 11/06/2025 7:57 pm
Erick_Torres
(@erick_torres)
Posts: 9
Active Member
 

Combine retrieval and transformation into one tool.
Instead of using two separate tools (a retriever and a parser), create a single tool that:

  • Interacts with the JIRA API.
  • Filters and transforms fields within the same Code node.

The AI Agent will only interact with a final, pre-processed tool.

This approach offers an advantage: it eliminates dependencies on the LLM's ordering or internal logic.

 
Posted : 11/06/2025 11:05 pm
aibot
(@aibot)
Posts: 3
Active Member
Topic starter
 

Thanks!
That's the approach I'll take.

 
Posted : 12/06/2025 5:50 am
system
(@system)
Posts: 332
Reputable Member
 

This discussion was automatically closed 7 days following the last response. New replies are no longer permitted.

 
Posted : 21/06/2025 11:58 am
Share: