Skip to main content
Glama
andyfe76

CouchDB MCP Server

by andyfe76

couchdb_create_database

Create a new database in CouchDB by specifying its name, enabling document storage and management through the MCP server.

Instructions

Create a new database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the database to create

Implementation Reference

  • The actual handler function that creates a CouchDB database. It calls self._get_server().create(name) to create the database and handles the PreconditionFailed exception when the database already exists.
    async def _create_database(self, name: str) -> list[TextContent]:
        """Create a new database."""
        try:
            self._get_server().create(name)
            return [TextContent(type="text", text=f"Database '{name}' created successfully")]
        except couchdb.http.PreconditionFailed:
            return [TextContent(type="text", text=f"Database '{name}' already exists")]
  • Tool schema definition for couchdb_create_database, including name, description, and inputSchema with required 'name' parameter for the database name.
    Tool(
        name="couchdb_create_database",
        description="Create a new database",
        inputSchema={
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Name of the database to create",
                },
            },
            "required": ["name"],
        },
    ),
  • Registration of the couchdb_create_database tool in the call_tool handler, mapping the tool name to the _create_database method with the name argument.
    elif name == "couchdb_create_database":
        return await self._create_database(arguments["name"])

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/andyfe76/couchdb_mcp'

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