Describe the problem/error/question
Using an AI Agent + MongoDB Tool with the Find And Update or Update function does not work. The failure happens regardless of the AI Agent being in charge of filing the updateKey, field or manual setup.
It looks like the AI Agent is not providing the input context required for the tool to work, i.e. there is no _id (id of the record to update in the database) passed to the MongoDB tool.
For example, asking in the chat “Can you update the contract “test” field and put “hello2” as a new value for the contract with “name”: “name1” ?” will find the correct record in the database and will attempt to update “test”: “hello2” but nothing happens in the database. The input of the MongoDB Update tool is :
{ "Update_Key": "669113cb318bc1105004a8e7", "Fields": "hello2" }
I believe the correct format should be:
{ "Update_Key": "_id", "Fields": "test" }
and that the _id and test are taken from the input context. But the input context is empty
What is the error message (if any)?
No error message shown.
Please share your workflow
Share the output returned by the last node
[ { "output": "The \"test\" field has been successfully updated to \"hello2\" for the contract named \"name1\"." } ]
Although the update has not been performed.
Information on your n8n setup
- n8n version: : 1.85.4
- Database (default: SQLite): MongoDB
- n8n EXECUTIONS_PROCESS setting (default: own, main): default
- Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
- Operating system: