Skip to main content
Glama
MongoDB MCP somente leitura

MongoDB MCP somente leitura

findOne

Read-only

Fetches one matching document from a MongoDB collection using a required filter, returning the document or null when no authorized result exists.

Instructions

Consulta um documento autorizado ou retorna null.

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": {
      "database": "<database>",
      "collection": "<collection>",
      "filter": "<filter>"
    },
    "name": "findOne"
  }
}

Input Schema

NameRequiredDescriptionDefault
sortNo
filterYesFiltro obrigatório. Use campos, $eq, $ne, $gt, $gte, $lt, $lte, $in, $and e $or.
databaseYes
collectionYes
projectionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description does add one genuinely useful behavioral fact beyond the annotations: it returns null when no document matches, which matters because no output schema exists. It omits, however, what happens when multiple documents match and how sort influences the returned document.

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

Conciseness3/5

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

It is a single short sentence with no wasted words, so it is concise, but the brevity comes from under-specification rather than economy. The one sentence it does contain spends space on the vague term 'autorizado' instead of on actionable detail.

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?

With five parameters (three required), nested filter/projection/sort objects, 20% schema coverage, and no output schema, this tool needs substantially more description than one sentence. The null-return note is the sole piece of compensating detail; sort semantics, projection behavior, and multi-match behavior are all absent.

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 only 20% — only 'filter' carries a schema description — so the description should compensate for 'database', 'collection', 'sort', and 'projection'. It mentions none of them, leaving the agent to infer sort's role in selecting among matches and projection's field-shaping behavior entirely from bare type definitions.

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

Purpose3/5

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

The description states a verb and resource ('Consulta um documento') which loosely conveys single-document retrieval, but the qualifier 'autorizado' is unexplained and may confuse the agent about whether an authorization check or a filtered scope is implied. It does not distinguish this tool from the sibling 'find', which is the primary ambiguity an agent faces here.

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?

There is no guidance on when to use findOne versus 'find', 'countDocuments', or 'distinct', and no statement of prerequisites such as needing an exact-match filter or a sort key to control which document is returned. The only implicit guidance is the required filter in the schema, which the description does not reinforce.

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