Skip to main content
Glama
Vijayakumar-DevOps

MongoDB MCP Server

aggregate

Read-only

Run aggregation pipelines on MongoDB data to filter, transform, and analyze documents, including vector search capabilities.

Instructions

Run an aggregation against a MongoDB collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseYesDatabase name
pipelineYes
collectionYesCollection name
responseBytesLimitNoThe maximum number of bytes to return in the response. This value is capped by the server's configured maxBytesPerQuery and cannot be exceeded. Note to LLM: If the entire aggregation result is required, use the "export" tool instead of increasing this limit.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
countYesThe total number of documents returned by the aggregation pipeline
documentsYesThe documents returned by the aggregation pipeline
appliedLimitsYesThe limits applied to the aggregation pipeline
Behavior2/5

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

The description adds no behavioral context beyond the annotations; it repeats the obvious aggregation action. It does not mention performance implications, result limits, or the fact that aggregation can be complex/long-running. Annotations already declare read-only and non-destructive, so the agent's safety understanding is covered.

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, efficient sentence with no redundant words. It front-loads the core action and resource.

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 complexity (4 params, intricate pipeline schema with $vectorSearch variants), the one-sentence description is insufficient. It omits any context about the pipeline structure, response size limits, or relation to similar tools, although the schema itself covers some of this.

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 description does not explain any parameter, including the critical 'pipeline' parameter which lacks a schema-level description. Schema coverage is 75% (database, collection, responseBytesLimit described), but the pipeline's meaning is left implicit. No additional semantic value is added by the description.

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 runs an aggregation on a MongoDB collection, using a specific verb and resource. It distinguishes from siblings by mentioning 'collection' (vs aggregate-db) and 'aggregation' (vs find/count).

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 choose this tool over alternatives like find, count, or aggregate-db. The only alternative mention ('export') appears in the schema's responseBytesLimit description, not the tool description.

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/Vijayakumar-DevOps/mongo-mcp-1.14.0'

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