MongoDB
MongoDB database integration for querying, inserting, updating, and aggregating documents
The MongoDB integration lets your agents query, insert, update, delete, and aggregate documents in MongoDB databases.
Prerequisites
You need:
- MongoDB connection string — The URI for your MongoDB instance (e.g.,
mongodb+srv://user:pass@cluster.mongodb.net/). This includes authentication credentials. - Database name — The default database your agent will work with.
Setup
- Open your agent in Agent Studio
- In the Integrations panel, click Add Integration Config
- Select MongoDB from the integration list
- Give the config a display name (e.g., "MongoDB - Production")
- Enter the configuration parameters:
- Connection String — Your MongoDB URI (stored encrypted)
- Database — The default database name
- Save the agent revision
No separate authentication setup is needed — credentials are embedded in the connection string.
Using in Your Agent
- In an Agent Step, attach MongoDB tools from the tools panel
- The agent uses your integration config for all MongoDB operations
- Tools are referenced as
mongodb.find,mongodb.insert_one, etc.
Available Tools
| Tool | Description | Action Type |
|---|---|---|
list_collections | List all collections in the database | ReadOnly |
find | Query documents from a collection | ReadOnly |
count | Count documents matching a filter | ReadOnly |
aggregate | Run an aggregation pipeline | ReadOnly |
insert_one | Insert a single document | Reversible |
insert_many | Insert multiple documents | Reversible |
update_one | Update a single document | Reversible |
update_many | Update multiple documents | Reversible |
delete_one | Delete a single document | Irreversible |
delete_many | Delete multiple documents | Irreversible |