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 Integrations from the sidebar
- Select MongoDB from the catalog
- Click Add Integration Config
- 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 config
No separate authentication setup is needed — credentials are embedded in the connection string.
Using in Your Agent
- Open your agent in Agent Studio and select an Agent Step
- Under Attached Integration Configurations, click Attach configuration and choose your config
- Attach MongoDB tools from the tools panel
- 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 |