run_transaction
Execute multiple MongoDB writes atomically so all operations commit or none apply; requires a replica set or sharded cluster. On failure, the error identifies the failing step.
Instructions
Execute several writes atomically (all or nothing). Requires a replica set or sharded cluster.
operations: [{"op": "insert", "collection": "orders", "document": {...}}, {"op": "update", "collection": "stock", "filter": {...}, "update": {"$inc": {"qty": -1}}}, {"op": "insert_many" | "update_many" | "replace" | "delete" | "delete_many", ...}] If any operation fails, nothing is written and the error names the failing step.
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": {
"operations": "<operations>"
},
"name": "run_transaction"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | No | ||
| connection | No | ||
| operations | Yes |