Skip to main content
Glama
mongodb-js

MongoDB MCP Server

Official
by mongodb-js

list-collections

Read-only

List all collections in a specified database using a connection ID, returning names to support database exploration.

Instructions

List all collections for a given database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseYesDatabase name
connectionIdYesThe connection to run the operation against. Use the id returned by one of the connect tools, or "preconfigured" to use the connection string the server was configured with.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
totalCountYes
collectionsYes
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, covering the safety profile. The description adds no extra behavioral context beyond 'for a given database' (which is already in the schema). It is consistent with annotations but does not disclose potential large result sets, pagination, or system collection inclusion.

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 sentence of five words that conveys all essential information. It is front-loaded with the verb and resource, and every word earns its place with no filler or repetition.

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

Completeness5/5

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

Given the tool's simplicity (2 parameters, output schema present, strong annotations), the description fully covers what the tool does. The output schema explains return values, and annotations cover side effects, so no additional context is necessary. It is complete for its complexity.

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 the parameters 'database' and 'connectionId' are already well-documented. The description does not add any new meaning or format details beyond what the schema provides, meeting the baseline for high coverage.

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 'List all collections for a given database' uses a specific verb ('List'), resource ('collections'), and scope ('for a given database'), which clearly differentiates it from sibling tools like list-databases or list-connections. It fully states what the tool does without ambiguity.

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 use this tool versus alternatives, such as list-databases for available databases or collection-schema for details. There is no mention of prerequisites (e.g., an active connection) or explicit exclusions, leaving the agent without decision-making support.

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/mongodb-js/mongodb-mcp-server'

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