Skip to main content
Glama
shibbirweb

mcp-db-read-only

by shibbirweb

List Distinct Values

distinct_values
Read-onlyIdempotent

Retrieve distinct values for a field in a MongoDB collection, optionally filtered by a query, to identify unique entries for analysis.

Instructions

List the distinct values of a field in a MongoDB collection, optionally within a filter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldYesField path, e.g. status or address.city
filterNoQuery filter as MongoDB Extended JSON, e.g. {"status": "active", "_id": {"$oid": "..."}}
databaseNoOptional database to read from for this call only, without changing the active connection
collectionYesCollection name

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/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, so the safety profile is covered. The description adds no additional behavioral context such as limits, ordering, missing-field behavior, or return shape, and it does not contradict the annotations.

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 front-loaded sentence with minimal waste. It is concise, though 'optionally within a filter' is slightly awkward and the description adds little beyond the title and schema details.

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

Completeness4/5

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

For a simple read-only operation, the required collection and field plus optional filter and database are documented, and annotations cover safety. The main gap is the lack of output format or edge-case behavior, especially since there is 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 parameters including field path format and Extended JSON filter syntax are already documented. The description mainly restates field and filter concepts and adds no new parameter-level meaning beyond what the schema provides.

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 uses a specific verb ('List') and a precise object: distinct values of a field in a MongoDB collection, optionally filtered. It is clear and easily distinguished from siblings like find_documents or count_documents, though it does not explicitly name those alternatives.

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 about when to use this tool versus find_documents, aggregate, count_documents, or search. The only hint is the semantic meaning of 'distinct values,' which implies a use case but provides no exclusions, prerequisites, or alternative routing.

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