execute_mongo_aggregate
Runs a MongoDB aggregation pipeline against a specified collection using a connection ID, validating the pipeline and enforcing find() limits.
Instructions
Execute one validated aggregation pipeline under the same limits as find().
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": {
"connection_id": "<connection_id>",
"collection": "<collection>",
"pipeline": "<pipeline>"
},
"name": "execute_mongo_aggregate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_rows | No | ||
| pipeline | Yes | ||
| collection | Yes | ||
| connection_id | Yes | ||
| timeout_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | ||
| executed | Yes | ||
| documents | No | ||
| operation | Yes | Operation family exposed through MCP and audit. | |
| row_limit | No | ||
| truncated | No | ||
| collection | Yes | ||
| error_code | No | ||
| validation | Yes | Complete result of applying the document read-only operator policy. | |
| duration_ms | No | ||
| connection_id | Yes | ||
| document_count | No | ||
| contract_version | No | 1.0.0 | |
| serialized_bytes | No |