Integration · Databases
AI agents for MongoDB
Read and query a MongoDB database directly: MongoDB Atlas (mongodb+srv) or your own server with a public address.
- Actions
- 7
- Read
- 4
- Write
- 3
Actions
What your agents can do in MongoDB
Read and query a MongoDB database directly: MongoDB Atlas (mongodb+srv) or your own server with a public address. Lists collections, describes their fields from a sample, finds and aggregates documents; inserts, updates and deletes only when the connection allows writes.
Read 4
Look things up. Nothing changes.
List collections
Lists the database's collections and views with an estimated document count, 200 at a time by name.
Describe a collection
The fields of a collection, read from a sample of up to 200 documents: each field's path (a.b for nested), its types and how often it appears, and the indexes.
Find documents
Documents matching a filter (a MongoDB query object, in Extended JSON: {"_id": {"$oid": "…"}}), with an optional projection and sort, up to 1,000 at a time.
Run an aggregation
Runs an aggregation pipeline (a list of stages such as $match, $group, $sort, $lookup) and returns up to max_rows documents (default 200, at most 1,000).
Write 3
Create, change or send.
Insert documents
Inserts 1 to 1,000 documents.
Update documentsDeletes data
Changes the first document (or, with many, every document) matching a filter, with update operators ($set, $inc, $unset, $push …).
Delete documentsDeletes data
Deletes the first document (or, with many, every document) matching a filter.
A person can approve first
Any write action can be set to wait for a person's approval before it runs, so an agent asks before it changes anything. Actions that delete data ask first by default.
Connection
How it connects
Connect it once in the console, then give it to the agents and workflows that need it.
Connect straight to your MongoDB database with its address and a database user, directly or through an SSH tunnel.
Settings
- Host
- Database
Kept safe
- Credentials are stored encrypted with your organization's own keys.
- They are opened only by the process that makes the call, at the moment it runs, and never go into a prompt or the browser.
- Calls go only to the tool's own servers.
Ideas
Ideas to start with
Starting points made only from the actions above. Mix them with any other tool your agents can use.
- 01
Ask about your MongoDB data
Ask a question in plain words. The agent can list collections, describe a collection or find documents in MongoDB, then answers with what it found.
- 02
Let an agent update MongoDB
Have the agent insert documents or update documents in MongoDB as part of a larger task. Turn on approval and a person signs off on each change first.
- 03
Share what it finds in Slack
Give one agent MongoDB and Slack: it can list collections in MongoDB and post a summary to a Slack channel in the same run.
FAQ
MongoDB and MyDeepAgents
Can MyDeepAgents connect to MongoDB?
Yes. The MongoDB connector has 7 actions: 4 read and 3 make changes. Your agents can call them as tools, and your workflows can run them as steps.
How do I connect MongoDB?
Connect straight to your MongoDB database with its address and a database user, directly or through an SSH tunnel. The connection also asks for: Host and Database. Credentials are stored encrypted with your organization's own keys and are opened only at the moment of a call.
Can an agent change data in MongoDB without asking?
Only if you let it. Each of the 3 actions that change data can be set to wait for a person's approval before it runs, and the 2 that delete data ask first by default.
Can I use MongoDB in workflows as well as agents?
Yes. Every MongoDB action also works as a step in a workflow, and the same connection serves your agents and your workflows.
Early access
Put MongoDB to work
Connect it in a few minutes, give an agent the actions it needs, and decide which changes wait for a person.