Skip to main content
Glama
linzi007

mongodb36-mcp-server

by linzi007

count

Get the number of documents in a MongoDB collection. Use an optional filter to count only matching documents.

Instructions

Count documents in a collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoQuery filter (MongoDB query syntax)
collectionYesCollection name

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the core operation (counting documents) and implies a read-only action, but it does not mention how the optional filter affects the count, whether the count is exact or estimated, or what the response format is. This is a moderate but not severe gap for a simple read operation.

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, front-loaded sentence containing only the essential information. Every word earns its place and there is no filler, making it highly scannable.

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 two-parameter tool, the description plus schema is mostly sufficient to select and invoke it. The sibling context and the simple operation cover most needs. However, with no output schema or annotations, it would be slightly stronger to explicitly state that it returns a count and that omitting the filter counts all documents in the collection.

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 the baseline is 3. The description itself adds no parameter meaning beyond what the schema already provides: 'collection' and 'filter' are both documented, with the filter explicitly described as MongoDB query syntax. The description's 'in a collection' mirrors the existing collection parameter without adding insight.

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 uses a specific verb ('Count'), a resource ('documents in a collection'), and clearly identifies the operation. It is distinct from siblings like find (returns documents) and aggregate (pipeline processing), so an agent can tell it apart without opening the schema.

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 count versus aggregate or find, nor any mention of exclusions or alternative tools. Sibling tools overlap in capability (aggregate can also count), and the description does not help an agent choose between them.

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

Deploy Server

Other Tools