Skip to main content
Glama
mongo-readonly-mcp

mongo-readonly-mcp

by tboon0

mongo_aggregate

Read-only

Run read-only MongoDB aggregation pipelines with enforced result limits and blocked $out/$merge stages to safely explore data without write operations.

Instructions

Run a read-only aggregation; $out and $merge are forbidden. Default result limit 100, maximum 1000.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "profile": "<profile>",
      "collection": "<collection>"
    },
    "name": "mongo_aggregate"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
profileYes
pipelineNo
collectionYes

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; the description usefully makes that concrete by naming the forbidden write stages ($out, $merge) and giving limit defaults and caps, which is real added context. It stops short of describing result shape, error behavior on invalid pipelines, or timeout/memory constraints for large aggregations.

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 sentences with no waste: the safety-critical read-only constraint and forbidden stages come first, followed by the limit behavior. Front-loaded and appropriately sized for a terse tool.

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?

With no output schema and 0% schema description coverage, the description should explain the required `profile` and `collection` arguments and the pipeline format. It covers only the limit, leaving an agent unable to confidently construct a call without guessing what `profile` means.

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 four parameters, so the description carries the full burden and largely fails: only `limit` is clarified (default 100, max 1000, information not present in the schema). `profile` is left completely opaque (connection profile? server profile?), `collection` is assumed obvious, and `pipeline` is never described as an array of stage documents.

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?

States a specific verb and resource ("Run a read-only aggregation") and scopes it with the read-only restriction. It does not name any sibling (mongo_find, mongo_count) to contrast with, so the agent must infer that aggregation pipelines are for multi-stage pipelines rather than simple queries.

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?

The prohibition on $out and $merge is real usage guidance about what this tool will refuse, which is valuable. However, there is no statement of when to pick this over mongo_find or mongo_count, and no preconditions for the required profile/collection arguments; usage is only implied.

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