Skip to main content
Glama
vishnuweb-a

MongoDB MCP

by vishnuweb-a

count_documents

Count documents in a MongoDB collection that match a query filter. Provide the collection name and optional query to get the exact number of matching documents.

Instructions

Count matching documents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNo
collection_nameYes
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, but it only states that it counts matching documents. It does not explain whether this is a read-only operation, what the return format is (e.g., a number, an object), or whether there are limits or side effects. This leaves significant ambiguity for an AI agent, especially for a sibling tool that may have similar behavior.

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 concise sentence with no redundant words, which is structurally clean and front-loaded with the main verb. However, it is almost too terse; while it scores high on conciseness, the lack of additional structure (e.g., parameter hints) prevents a perfect score.

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?

Given the tool's context (two parameters, no output schema, no annotations, and multiple sibling tools), the description is severely incomplete. It does not specify return values, parameter requirements, or how it differs from 'find_document' and 'fetch_collection_data'. An agent would have to guess at the tool's interface and behavior, making it inadequate for reliable invocation.

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?

The schema has 0% description coverage, so the description must compensate for parameter understanding, but it fails to do so. 'Matching documents' hints at the 'query' parameter but does not mention the required 'collection_name' or how the query object is structured. The description adds minimal meaning beyond the raw schema, leaving the agent without clarification on how to supply parameters.

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 'Count matching documents' clearly states the tool's purpose with a specific verb ('count') and resource ('documents'), and implies a query filter ('matching'). It distinguishes from sibling tools like 'find_document' and 'fetch_collection_data' by focusing on counting rather than retrieving data, though it does not explicitly name 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?

The description provides no guidance on when to use this tool versus alternatives such as 'find_document' or 'fetch_collection_data'. There is no mention of use cases (e.g., obtaining counts for pagination or aggregation) or exclusions (e.g., not for retrieving documents). The absence of this differentiation leaves the agent without clear selection criteria.

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/vishnuweb-a/mongo_agent_mcp'

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