Skip to main content
Glama

MongoDB MCP Server

by jonfreeland

list_databases

Retrieve a list of all databases available on the MongoDB MCP Server to facilitate direct querying and data analysis for AI assistants.

Instructions

List all databases in the MongoDB server.

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • Handler for the 'list_databases' tool. Connects to the MongoDB admin database and calls listDatabases() to retrieve all databases, returning the result as JSON-formatted text.
    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)
    Registration of the 'list_databases' tool in the ListToolsRequestSchema handler, including name, description, and input schema (no required parameters).
    { name: 'list_databases', description: 'List all databases in the MongoDB server.', inputSchema: { type: 'object', properties: {}, }, },
  • Input schema for 'list_databases' tool: empty object (no parameters required).
    inputSchema: { type: 'object', properties: {}, },

Other Tools

Related 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