Skip to main content
Glama

Aggregate MongoDB documents

mongo_aggregate
Read-onlyIdempotent

Run bounded read-only MongoDB aggregation pipelines for safe querying. It rejects write stages and applies a result limit to prevent unintended data changes or oversized outputs.

Instructions

Run a bounded read-only MongoDB aggregation. Data MCP recursively rejects $out and $merge stages and appends a result limit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
pipelineNo
collectionYes
timeout_msNo
connection_idYes
response_formatNomarkdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0-alpha.1

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true, so the safety profile is covered. The description adds real value beyond that by disclosing that $out and $merge stages are recursively rejected and that a result limit is appended, which tells an agent exactly how write-capable pipelines will be neutralized.

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?

Two tight sentences with zero waste. The core operation is front-loaded and the follow-up sentence supplies the most decision-relevant behavioral caveat.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and 0% schema description coverage, the description should compensate for the parameter gap but does not. It covers the safety/behavior story well, leaving callers to guess the meaning of most parameters.

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 description coverage is 0% across 6 parameters (2 required), so the description carries the full burden. The only hint is "appends a result limit," which loosely relates to the limit parameter; pipeline syntax, connection_id, timeout_ms, and response_format are entirely undocumented.

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 states a specific verb and resource: "Run a bounded read-only MongoDB aggregation." It is clear and accurate, but it never distinguishes this tool from the close sibling mongo_find, so an agent must infer when aggregation is warranted over a simple find.

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?

Usage is only implied by the word "aggregation" and the "bounded read-only" framing. There is no explicit when-to-use statement, no comparison to mongo_find, and no note about prerequisites such as a valid connection_id.

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