Skip to main content
Glama
chzkyy

mcp-mongodb

by chzkyy

replace_one

Replaces the entire content of a single MongoDB document matching a filter with a new document. Supports upsert to create a document when no match exists.

Instructions

Ganti seluruh isi satu dokumen yang cocok dengan filter dengan dokumen baru.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoQuery filter MongoDB. Contoh: {"status": "aktif", "umur": {"$gt": 25}}. Kirim sebagai objek atau string JSON. Gunakan {} untuk semua dokumen.
upsertNoJika true, dokumen baru dibuat bila tidak ada yang cocok dengan filter (default false).
databaseNoNama database tujuan. Opsional jika MONGODB_DB sudah diatur.
collectionYesNama koleksi.
replacementNoDokumen pengganti LENGKAP (tanpa operator $). Seluruh isi dokumen lama diganti.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior3/5

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

With no annotations, the description carries the burden and does state the core destructive behavior: it replaces the entire contents of an existing document. However, it does not disclose what happens when no document matches, which document is chosen if multiple match, or the default no-upsert behavior, so transparency is only partial.

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?

The description is a single efficient sentence with no filler, front-loading the verb and object. It is appropriately concise, though it provides no structured guidance or examples beyond the bare definition.

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 mutating tool with no annotations and no output schema, the description is too thin. It omits key context such as no-match behavior, upsert implications, multi-match selection, and how it differs from update_one, leaving an agent under-informed for reliable invocation.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all five parameters, including the critical '$' operator restriction on replacement. The tool description itself adds no parameter-level meaning beyond the schema, matching the baseline for high schema coverage.

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?

The description clearly states a specific verb ('Ganti' / replace), a specific resource ('satu dokumen yang cocok dengan filter'), and the full-replacement scope ('seluruh isi'). It is distinguishable from sibling update_one because it emphasizes replacing the entire document, though it does not explicitly name the sibling.

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

Usage Guidelines2/5

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

The description gives no guidance on when to use replace_one versus update_one, insert_one, or delete_one. It does not state exclusions, prerequisites, or conditions like 'use update_one for partial updates.' The usage context must be inferred from the tool's semantics.

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