Skip to main content
Glama
ohankay

mongo-mcp-simple

by ohankay

replace_document

Replace the first document matching a filter with an entirely new document, without update operators. Use it for full-document replacement rather than field-level updates.

Instructions

Replace the first document matching the filter with a whole new document (no update operators).

Input Schema

NameRequiredDescriptionDefault
filterYes
upsertNo
databaseNo
collectionYes
connectionNo
replacementYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already disclose readOnly=false, idempotent=false, destructive=false, openWorld=false. The description adds genuinely useful mutation semantics beyond that: only the FIRST matching document is affected and the replacement is a whole document. It still omits consequence details an agent needs for a write tool, e.g. what upsert=true does and whether non-matching filters fail silently.

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

Conciseness5/5

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

A single sentence, front-loaded with the verb and resource, with the one qualifier that matters (first match) and the differentiating constraint in parentheses. No waste.

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

Completeness2/5

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

For a mutation tool with no annotations covering safety, no output schema, and 0% parameter coverage, this is thin. The upsert flag is especially dangerous to leave unexplained on a replace operation, and there is no statement of return value or failure behavior.

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

Parameters2/5

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

Schema description coverage is 0% across 6 parameters, so the description must compensate. It only indirectly illuminates filter and replacement, and says nothing about upsert, database, collection, or connection, leaving four parameters completely undocumented anywhere.

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

Purpose4/5

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

States a specific verb (Replace), resource (document), and scope (first match on filter), plus a parenthetical that implicitly separates it from update_documents by ruling out update operators. An agent can distinguish it from insert_documents and update_documents without opening the schemas, though the sibling is never named.

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

Usage Guidelines3/5

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

The "no update operators" aside implies the choice against update_documents, but there is no explicit when-to-use/when-not guidance, no mention of what happens if multiple documents match, and no mention of the upsert flag's effect on tool selection.

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