Skip to main content
Glama
Datris MCP Server

Datris MCP Server

query_mongodb

Query a MongoDB collection with optional filter and projection to retrieve matching documents as JSON, with a configurable limit for controlling result size.

Instructions

Query a MongoDB collection with optional filter and projection. Use list_mongodb_databases and list_mongodb_collections first to discover available data. Returns matching documents as JSON.

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": {
      "collection": "<collection>"
    },
    "name": "query_mongodb"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum documents to return (default: 20). Pass -1 for unlimited — no cap, returns every matching document.
filterNoMongoDB query filter (default: {})
collectionYesMongoDB collection name
projectionNoFields to include/exclude (default: all fields)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are supplied, so the description must carry the full behavioral load. It does disclose the return format ('matching documents as JSON'), which is genuinely useful, but says nothing about read-only safety, permissions, error behavior on invalid filters, or pagination beyond the limit parameter documented in the schema.

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?

Three short sentences, front-loaded with the purpose, then the discovery prerequisite, then the return shape. Nothing is padded, though the return-format sentence is the only one adding information not already implied.

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

Completeness4/5

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

For a four-parameter read tool with a fully documented schema and no output schema, the description covers purpose, prerequisite discovery, and return type. The remaining gap is behavioral detail (permissions, failure modes) that matters less for a read-only query.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so filter, projection, collection and limit are all already documented, including the -1 unlimited convention. The description merely restates that filter and projection are optional; it adds no syntax or format detail beyond the schema, so the baseline 3 applies.

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 ('Query a MongoDB collection') plus the two main narrowing options (filter, projection). The MongoDB qualifier distinguishes it from the many query_* siblings for other engines, though it never explicitly contrasts behavior with them.

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

Usage Guidelines4/5

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

Gives an explicit prerequisite sequence: use list_mongodb_databases and list_mongodb_collections first to discover available data, naming the concrete alternative tools. It does not state when-not to use this tool or when to prefer a different query engine, but the discovery guidance is actionable.

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

Deploy Server

Other Tools