I’m building an agent that schedules appointments. To get the available time slots, I first call Get_Many_Events
, then pass the response to a Code Tool
. Based on the duration of the selected service, the Code Tool
should return the available slots where the client can be attended.
I’ve been testing this since yesterday and I’m stuck because I keep getting this error:
"The 'query' field is not valid JSON or cannot be parsed."
This is the input that is always being passed to the Code Tool:
json
{
"query": "{\"duracionMinutos\":10,\"fechaInicio\":\"2025-07-17T14:30:00+02:00\",\"fechaFin\":\"2025-07-17T20:00:00+02:00\",\"eventos\":[{\"start\":{\"dateTime\":\"2025-07-17T16:45:00+02:00\"},\"end\":{\"dateTime\":\"2025-07-17T21:15:00+02:00\"}}]}"
}
I’ve specified in the agent’s prompt that the tool input must be valid JSON, but no matter what I do, I always hit this error.
Does anyone have any idea how I can solve this?