MongoDB
Community
Tools to query and explore a MongoDB database
Author:Arcade
Version:
1.1.2Auth:No authentication required
6tools
6require secrets
Arcade's MongoDB toolkit connects agents to a MongoDB instance, enabling database exploration and data querying without writing application code.
Capabilities
- Discovery: Enumerate all databases in a MongoDB instance and all collections within a database before any query is issued.
- Schema inference: Sample documents from any collection to infer field names and data types, a required step before querying since MongoDB is schema-less.
- Document retrieval and counting: Find documents with full MongoDB query operator support (
$gte,$lte,$in,$regex, etc.), apply projection and sort, and count matching documents independently. - Aggregation pipelines: Execute multi-stage pipelines (
$match,$group,$project,$sort,$limit,$lookup, and more) for complex data processing and cross-collection joins.
Secrets
MONGODB_CONNECTION_STRING — The full MongoDB connection URI used to authenticate and connect to the database instance. It encodes the protocol, credentials, host, port, and any connection options in a single string (e.g., mongodb+srv://username:password). To obtain it:
- MongoDB Atlas: Open your Atlas project, click your cluster → Connect → Drivers, select a driver/version, and copy the displayed connection string. Replace
<password>with the database user's password. See the Atlas connection string docs for full instructions. - Self-hosted MongoDB: Construct the URI manually using your host, port, and the credentials of a database user with the necessary read permissions. See the MongoDB connection string URI format reference.
For guidance on storing and referencing secrets in Arcade, see Create Tool Secrets. You can manage secret values at https://api.arcade.dev/dashboard/auth/secrets.
Available tools(6)
6 of 6 tools
Operations
Behavior
| Tool name | Description | Secrets | |
|---|---|---|---|
Execute a MongoDB aggregation pipeline on a collection.
ONLY use this tool if you have already loaded the schema of the collection you need to query.
Load the collection's schema first if it is not already known.
Returns a list of JSON strings, where each string represents a
result document from the aggregation
(tools cannot return complex types).
Aggregation pipelines allow for complex data processing including:
* $match - filter documents
* $group - group documents and perform calculations
* $project - reshape documents
* $sort - sort documents
* $limit - limit results
* $lookup - join with other collections
* And many more stages | 1 | ||
Count documents in a MongoDB collection matching the given filter. | 1 | ||
Discover all the collections in the MongoDB database.
Use when the list of collections is not known.
ALWAYS use this tool before any other tool that requires a collection name. | 1 | ||
Discover all the databases in the MongoDB instance. | 1 | ||
Find documents in a MongoDB collection.
ONLY use this tool if you have already loaded the schema of the collection you need to query.
Load the collection's schema first if it is not already known.
Returns a list of JSON strings, where each string represents a
document from the collection (tools cannot return complex types).
When running queries, follow these rules which will help avoid errors:
* Always specify projection to limit fields returned if you don't need all data.
* Always sort your results by the most relevant fields first. Use '_id' if you're unsure.
* Use appropriate MongoDB query operators for complex filtering ($gte, $lte, $in, $regex, etc.).
* Be mindful of case sensitivity when querying string fields.
* Use indexes when possible (typically on _id and commonly queried fields). | 1 | ||
Get the schema/structure of a MongoDB collection by sampling documents.
Since MongoDB is schema-less, this tool samples a configurable number of documents
to infer the schema structure and data types.
This tool should ALWAYS be used before executing any query.
All collections in the query must be discovered first by listing the database's collections. | 1 |
Last updated on