Skip to main content
Glama
robertoamoreno

CouchDB MCP Server

deleteDatabase

Remove a CouchDB database by specifying its name via the CouchDB MCP Server, ensuring efficient management and cleanup of unused or outdated data.

Instructions

Delete a CouchDB database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dbNameYesDatabase name to delete

Implementation Reference

  • The main handler function for the 'deleteDatabase' MCP tool. Validates the input arguments, calls the deleteDatabase helper function, and returns a formatted success or error response.
    private async handleDeleteDatabase(args: any) { if (!args.dbName || typeof args.dbName !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Invalid database name'); } try { await deleteDatabase(args.dbName); return { content: [ { type: 'text', text: `Database ${args.dbName} deleted successfully`, }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error deleting database: ${error.message}`, }, ], isError: true, }; } }
  • src/index.ts:76-89 (registration)
    Registration of the 'deleteDatabase' tool in the ListTools response, including name, description, and input schema definition.
    { name: 'deleteDatabase', description: 'Delete a CouchDB database', inputSchema: { type: 'object', properties: { dbName: { type: 'string', description: 'Database name to delete', }, }, required: ['dbName'], }, },
  • Helper function that performs the actual database deletion using Nano by destroying the database.
    export async function deleteDatabase(dbName: string): Promise<void> { await couch.db.destroy(dbName); }

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

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