count
Count documents in a MongoDB collection using an optional filter query.
Instructions
Count documents in a MongoDB collection
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | MongoDB filter query | |
| collection | Yes | Collection name |
Count documents in a MongoDB collection using an optional filter query.
Count documents in a MongoDB collection
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | MongoDB filter query | |
| collection | Yes | Collection name |
Changes observed during successful MCP inspections. Dates show when Glama detected each change.
v0.1.8Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is covered. The description adds little about behavior beyond the count semantics (e.g., it does not state that an omitted filter counts all documents), but 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.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single 8-word sentence with the key action and resource front-loaded. There is no filler or redundant restatement of the schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple count tool with a 100%-described schema and read-only annotations, the description is nearly sufficient. It does not explicitly state the return value, but 'Count' strongly implies a numeric result, making the omission minor.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both 'collection' and 'filter'. The description references collection but adds no parameter detail beyond what the schema provides, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific verb ('Count'), a resource ('documents in a MongoDB collection'), and the operation is immediately distinguishable from sibling read tools like find, findOne, distinct, and aggregate. The word 'Count' makes the tool's role unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description makes it clear this is for counting documents in a collection, which is the relevant context for selecting it over find/aggregate. It does not explicitly name alternatives or state when not to use it, but the operation itself provides enough contextual guidance for a simple count.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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