Skip to main content
Glama
jonfreeland

MongoDB MCP Server

by jonfreeland

list_databases

Retrieve a list of all databases available in the MongoDB server to identify data sources for querying and analysis.

Instructions

List all databases in the MongoDB server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for list_databases tool: connects to admin database and calls listDatabases() to retrieve all databases.
    case 'list_databases': {
      const adminDb = client.db('admin');
      const result = await adminDb.admin().listDatabases();
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result.databases, null, 2),
          },
        ],
      };
    }
  • src/index.ts:312-319 (registration)
    Tool registration in ListToolsRequestSchema handler, defining name, description, and input schema.
    {
      name: 'list_databases',
      description: 'List all databases in the MongoDB server.',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Input schema definition for list_databases: empty object (no input parameters required).
    inputSchema: {
      type: 'object',
      properties: {},
    },
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose permissions needed, pagination, rate limits, or what 'all databases' entails (e.g., system databases included). This leaves significant gaps for a tool with zero annotation coverage.

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, efficient sentence with zero waste. It's front-loaded and directly states the tool's function without unnecessary elaboration, making it highly concise and well-structured.

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?

Given the tool's simplicity (0 params, no output schema), the description is minimally adequate but lacks context about behavioral aspects like permissions or output format. Without annotations or output schema, it should provide more guidance on what to expect, leaving room for improvement.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add param info, but this is appropriate given the schema completeness, warranting a baseline above 3 for clarity in a no-param context.

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 clearly states the verb ('List') and resource ('all databases in the MongoDB server'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'list_collections' or 'get_schema', which prevents a score of 5.

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?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't mention if this is for high-level inventory vs. detailed metadata, or how it relates to siblings like 'list_collections' or 'get_schema'.

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

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