AI Agent’s Tool Schema is what’s causing the “required” behavior

Describe the problem/error/question

I have been trying to set my agent to create or update rows in a PostgreSQL table. I have tried both postgres tool and the Supabase tool, and I am repeatedly hitting the same error “Received tool input did not match expected schema :multiply: Required → at scheduled_date_of_project :multiply: Required → at campaign_id_of_project :multiply: Required → at notes_of_project :multiply: Value must be a non-empty object or a non-empty array → at chosen_media_ids_of_project :multiply: Value must be a non-empty object or a non-empty array → at media_references_of_project“ they change depeding on the toll but its the same issue, my tables are configura to handle not receiving information, so they go null or have default, the issue seem to be that my ai tool is forcing the shekema tool so all field are requeired, which is not true, and i cant find a way to configure o let it know by instruction which are requeired and which not. i have spet too many hours on this. I would love a solution or a workaround.

What is the error message (if any)?

Received tool input did not match expected schema :multiply: Required → at scheduled_date_of_project :multiply: Value must be a non-empty object or a non-empty array → at chosen_media_ids_of_project :multiply: Value must be a non-empty object or a non-empty array → at media_references_of_projec

Please share your workflow

Information on your n8n setup

  • n8n version: 1.123.5
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker,):
  • Operating system:

Well i have found a solution, i created a subworkflow with all the requeired keys in String, instructed the agent to provide all the information and those field necesary, those keys meent to be json as coma separated values, those witout information empty ““ and those to be deleted in “null”, in the subworkflow, i made a node code that normalises the json, i told exactly which keys to modify and to take out empty ““ key and null those with “null”, them i used this payload to be send to the postgress node configured as automatically matching keys and problem solved, is case someone else have this issue.

1 Like

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