Skip to main content
Glama
Nam088

mcp-server-db

by Nam088

mongo_count_documents

Count documents in a MongoDB collection that match a specified JSON filter query.

Instructions

Count documents matching a filter in a MongoDB collection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoJSON string filter query.
databaseNo
collectionYes
connectionIdNoId of the mongodb connection to use. Optional when only one mongodb connection is configured.
Behavior2/5

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

With no annotations, the description carries full burden. It only says 'Count documents' without disclosing performance implications, whether it uses indexes, whether the count is approximate or exact (it is exact), or any side effects. This is minimal and insufficient for a user to understand the tool's 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 sentence with no wasted words. It is efficient, though it could include a bit more detail about the filter parameter without losing conciseness.

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?

For a tool with 4 parameters and no output schema, the description is incomplete. It doesn't describe the return value (a count number), that filter is optional for counting all documents, or that collection is required. This leaves gaps for an AI agent.

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?

Schema coverage is 50% (filter and connectionId have descriptions). The description does not add any extra meaning to parameters, such as explaining the filter JSON format, that database is optional, or the role of connectionId. It fails to compensate for the incomplete schema.

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 clearly states the tool counts documents matching a filter in a MongoDB collection. The verb 'Count' and resource 'documents' are specific, distinguishing it from sibling tools like mongo_find (retrieve), mongo_aggregate (aggregation), or mongo_distinct (distinct values).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives like mongo_find or mongo_aggregate. The purpose is implied from the name and description, but there are no when-to-use or when-not-to-use instructions.

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/Nam088/mcp-database-server-v2'

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