Skip to main content
Glama
MongoDB MCP somente leitura

MongoDB MCP somente leitura

distinct

Read-only

Retrieve unique field values from a MongoDB collection with a required filter and indicate whether the limited results were truncated.

Instructions

Retorna valores distintos limitados e informa se a resposta foi truncada.

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>",
      "field": "<field>"
    },
    "name": "distinct"
  }
}

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.7/5.0
Behavior3/5

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

Annotations already establish readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description does add genuine behavioral context beyond them by disclosing that results are limited and that a truncation indicator is returned — but it omits the limit value or how truncation is signalled, leaving the agent to discover it at call time.

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?

A single short sentence with the truncation caveat front-loaded alongside the core behavior; nothing is wasted. Its brevity costs information, but the sentence itself is well-formed and free of filler.

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 tool with four required parameters, a nested filter object, no output schema, and thin schema documentation, the description is far too sparse. It should at minimum explain that filter is mandatory and which operators are supported, and clarify what the truncation indicator means for the caller.

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 25% and all four parameters are required, including a nested filter object, so the description should compensate. It mentions no parameter at all — not the mandatory filter, not the field whose distinct values are returned, not database/collection scoping — so the agent must rely entirely on the partial schema.

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?

States a verb and resource ("retorna valores distintos") plus a scope qualifier (limited/truncated), which is enough to separate it from countDocuments or findOne at a high level. However, it never says the distinct values come from a specific field of a collection, so the operation's target is only implied by the schema rather than the prose.

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?

No when-to-use, when-not-to-use, or alternative guidance is given. With siblings like countDocuments, find, and findOne present, an agent gets no signal about which to pick when it needs unique field values versus a full document listing.

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