mongodb-js/mongodb-mcp-server

[Question]: Tool discovery - find / count arguments shape

Closed this issue · 3 comments

I am doing some tests with GPT 4.1 in VSCode and have noticed an issue.
I asked it to give me the list of available tools for the MCP Client and then to provide me the shape of the arguments for the find and count tools and this is what it returns.

Image

For some reason, it doesn't seem to see the filter/query argument.

This gives me an issue when I ask is to retrieve documents because it never passes the right filter/query.

I was able to get over this problem by telling it specifically:

When using `find`, always pass the `filter` argument.
When using `count`, always pass the `query` argument.

I was wondering if this is normal behavior?

Sorry if I am unclear.

Hi @simplecommerce 👋 Thank you for reporting this issue :)

We have also come across this problem during our accuracy testing. Much thanks for confirming that this is indeed an issue in the open field. We suspect that it might be related to dynamic schema definition for filters in case of find tool and for query in case of count tool.

We will soon be done with our accuracy tests and will certainly improve on this situation for the above mentioned and other tools as well. Meanwhile if you come across issues with other tools feel free to post them here.

Hi @himanshusinghs I also noticed that if I ask the Agent to find a document with a certain _id, it will try to query using find with the value as a string (I am assuming).

I have to specifically ask it to run the query { "$oid": "value" } on the _id field for it to find the record.

Do you guys have this issue also during your tests?

Hey @simplecommerce ,

we've done a few changes on how we expose the shape of the arguments and this has increased the accuracy on GPT 4o in our tests drastically. Would you mind upgrading the mcp server to the latest version and see how it works for you?