Skip to main content
Glama
rajarshi-personal

Portable Database MCP

aggregate_documents

Read-only

Run bounded read aggregations on MongoDB collections using supported pipeline stages, enabling grouped and transformed results without joins, writes or JavaScript.

Instructions

Run a bounded read aggregation using supported stages; no joins, writes or JS.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseYes
pipelineYes
collectionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds that the operation is bounded and excludes writes/JS, but never enumerates which pipeline stages are 'supported' — the single most important behavioral fact for an aggregation tool — nor any limits or cost characteristics.

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?

A single front-loaded sentence with no filler; the read/bounded framing comes first and each clause adds a distinct constraint.

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?

An output schema exists so return values need no explanation, but for a pipeline-based tool the description omits the supported-stage list and pipeline formatting entirely, leaving the agent unable to construct a valid call without guessing.

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 all three parameters, so the description carries the full burden and largely fails it: pipeline stage syntax, the fact that 'supported stages' is a restricted whitelist, and the meaning of database/collection vs. the sibling list_collections tools are all left unstated.

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 gives a specific verb+resource ('Run a bounded read aggregation') and scopes it with exclusions (no joins, writes or JS), which separates it from mutation and SQL siblings. It stops short of naming an alternative tool explicitly, so it is clear but not fully differentiated.

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?

It states negative constraints ('no joins, writes or JS') that implicitly tell when not to use it, but never says when this tool is preferred over find_documents or query_sql, nor what 'bounded' means in practice. Usage is implied rather than stated.

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