listDatabases
Retrieve a list of all CouchDB databases to manage and interact with data storage effectively. Ideal for accessing database information within the CouchDB MCP Server.
Instructions
List all CouchDB databases
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/connection.ts:37-39 (handler)Core handler function that lists all CouchDB databases by calling couch.db.list() from the nano library.export async function listDatabases(): Promise<string[]> { return couch.db.list(); }
- src/index.ts:285-307 (handler)MCP tool handler for 'listDatabases' that calls the core function, formats the response 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, }; } }
- src/index.ts:68-75 (schema)Input schema definition for the 'listDatabases' tool, indicating no required input parameters.{ name: 'listDatabases', description: 'List all CouchDB databases', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:232-233 (registration)Registration in the tool dispatcher switch statement that maps the 'listDatabases' tool name to its handler.case 'listDatabases': return this.handleListDatabases();