Skip to main content
Glama
robertoamoreno

CouchDB MCP Server

listDatabases

Retrieve all database names from a CouchDB instance to manage data storage and access.

Instructions

List all CouchDB databases

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler for the 'listDatabases' tool. It invokes the listDatabases helper function from connection.ts, formats the result as JSON text content, and handles errors appropriately.
    private async handleListDatabases() {
      try {
        const databases = await listDatabases();
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(databases, null, 2),
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: `Error listing databases: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema definition for the 'listDatabases' tool, specifying an empty object (no parameters required).
      name: 'listDatabases',
      description: 'List all CouchDB databases',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • src/index.ts:232-233 (registration)
    Tool dispatch registration in the CallToolRequest handler's switch statement, routing calls to the handleListDatabases method.
    case 'listDatabases':
      return this.handleListDatabases();
  • Core utility function that performs the actual database listing using the CouchDB nano client.
    export async function listDatabases(): Promise<string[]> {
      return couch.db.list();
    }

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/robertoamoreno/couchdb-mcp-server'

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