My openai agent is not using the correct supabase or mcp client tool when it should.
I have an mcp server that describes the api endpoint params correctly, and I have provided resources or tools with schemas so it knows how to query it, but it always screws up the parameters and never returns a good result.
For example: if I want to get information on one user ‘john doe’, instead of using the api schema definition and saying “I need a user with firstname=john, lastname=doe” it will try to get the user with username=john, or the firstName=john, or name=john. It has no context into my mcp server parameters, even though they are defined.
I have a similar problem when I tried to access tools for sql querying. I have supabase tools attached to the agent, and it will call the wrong tool, or pull the entire table, regardless of the prompt I give.
I am able to use this a bit better, although it is still not perfect.
A couple questions:
Is there a way to skip a parameter when the value isn’t there?
For example, asking for a whole name will work correctly: ‘give me info on John Doe’ will query supabase with firstname=eq.John&lastname=eq.Doe, but if I ask ‘give me info on John’ it tries to query supabase with firstname=eq.John&lastname=eq. and ends up not returning anything.
Along the same lines, is there a way to make these case insensitive?
Ok because I’m not getting any replies to this thread. I will post my solution that I found to work just by troubleshooting and banging rocks together. I hope this helps someone trying to do something similar.
Instead of using the supabase tool, I switch over to using an http request tool and filled out a lot of my prompt with the table names, and the schema of a table that needed to be joined.
Here is my flow now:
This works very well so far, and I have been able to answer most of my questions through chat that I need.