AI Agent + Supabase Tool Connector: Null values on SQL insert

Hi everyone,

I’m using ChatGPT 4.1 with the Tool Connector to insert data into a structured SQL table in Supabase (not a vector table). The agent parses user input to extract two required fields:

  • amount (integer)
  • next_date_to_pay (timestamp/date in ISO format)

Then it calls a tool to insert these values into the table. The schema enforces NOT NULL constraints for both fields.

However, even though the agent seems to extract both values correctly, the tool call often fails with:
Bad request - please check your parameters: null value in column "amount" of relation "test_table_for_savings" violates not-null constraint

This seems like a standard scenario: extract → validate → insert into SQL. Has anyone experienced similar issues, or successfully implemented a setup where AI calls Supabase to insert or update data (not just read)?

Hey @Dendan hope all is well. Welcome to the community.

Could you please share your workflow, so we could take a look at how you are doing the insertion and what the prompts are etc. Thanks.

In the meantime, here is my working attempt at what I think you are looking for:

Output in chat:

Output from the database:

hi @jabbson, And thanks a lot for your reply with the example.

I have found the difference between your implementation and mine, and it seems that I had explicitly in the Supabase tool add what parameters should be filled in general and leave it to the AI.
I think my brain thought that everything should work like magic, so I didn’t add these fields. But you did. I repeated, and that works. Thanks a lot again!

Awesome. Glad I could help, kindly :heart: the answer which helped to figure out the issue.

Cheers.