Skip to main content
Glama
ohankay

mongo-mcp-simple

by ohankay

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.

Input Schema

NameRequiredDescriptionDefault
databaseNo
connectionNo
operationsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations by disclosing rollback semantics ('nothing is written') and error behavior ('the error names the failing step'), plus the deployment topology requirement — none of which is in the structured data. One tension worth noting: the example op list includes 'delete'/'delete_many' while annotations declare destructiveHint=false; the transactional rollback rationale partly explains it, but the mismatch is not addressed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the behavior in one sentence, then a short topology prerequisite, then an example. The example earns its space given the untyped parameter, though it is verbose relative to the prose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter mutation tool with no output schema and no field descriptions, the description covers the hard part (operation payload shape) and the operational preconditions. It does not say what a successful call returns (per-op results? counts?) or what database/connection default to when null.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% and the operations parameter has no type at all, so the description must carry the load — and it does, giving concrete op shapes and enumerating the accepted op values (insert, update, insert_many, update_many, replace, delete, delete_many). The database and connection parameters are left completely unexplained, which is the remaining gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (execute several writes atomically) and names the distinguishing property — all-or-nothing semantics — that separates it from single-operation siblings like insert_documents and update_documents. An agent can route on this without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The atomicity framing plus the prerequisite 'Requires a replica set or sharded cluster' tells the agent when this tool is the right choice over the single-op write tools. There is no explicit when-not-to-use (e.g. 'use insert_documents for a single write'), which keeps it below a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.