Skip to main content
Glama
sourabhshegane

MongoDB That Works - MCP Server

distinct

Read-onlyIdempotent

Retrieve unique values for a specified field in a MongoDB collection, optionally filtered by a query.

Instructions

Get distinct values for a field in a MongoDB collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldYesField to get distinct values for
filterNoMongoDB filter query
collectionYesCollection name

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv0.1.8

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, covering the safety profile. The description adds no additional behavioral context, such as the return format (an array of distinct values) or how the optional filter interacts with the query. With annotations present, the bar is lower, but the description still fails to enrich the agent's understanding of what happens at runtime.

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?

The description is a single, focused sentence with zero filler. It front-loads the core purpose and is appropriately sized for a simple tool.

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?

There is no output schema, so the description should specify what the tool returns. It only says 'Get distinct values', which does not clarify that the result is an array, nor does it mention that the optional filter parameter can be used to restrict the query. The filter object is described in the schema but the description never hints at its role. This leaves the agent uncertain about output structure and usage nuances, making the definition incomplete for a tool with a nested object parameter and no output schema.

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 all three parameters (field, filter, collection) are individually described in the schema. The description adds no extra meaning beyond what the schema already provides; it merely restates the purpose. The baseline of 3 applies because the schema does the heavy lifting.

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?

The description states a specific verb ('Get'), a clear resource ('distinct values for a field in a MongoDB collection'), and the operation is unambiguous. It distinguishes from siblings like find/findOne (which return documents) and aggregate (which handles complex pipelines) by focusing on unique values.

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 this tool versus alternatives such as aggregate or find. The description does not mention any exclusions, prerequisites, or conditions that would help an agent choose between distinct and other query tools. This is a single declarative sentence with no comparative context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sourabhshegane/mongodb-mcp-that-works'

If you have feedback or need assistance with the MCP directory API, please join our Discord server