query_mongodb
Query a MongoDB collection with optional filter and projection to retrieve matching documents as JSON, with a configurable limit for controlling result size.
Instructions
Query a MongoDB collection with optional filter and projection. Use list_mongodb_databases and list_mongodb_collections first to discover available data. Returns matching documents as JSON.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"collection": "<collection>"
},
"name": "query_mongodb"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum documents to return (default: 20). Pass -1 for unlimited — no cap, returns every matching document. | |
| filter | No | MongoDB query filter (default: {}) | |
| collection | Yes | MongoDB collection name | |
| projection | No | Fields to include/exclude (default: all fields) |