Skip to main content
Glama
andyfe76

CouchDB MCP Server

by andyfe76

couchdb_delete_document

Delete a document from a CouchDB database by specifying the database name, document ID, and revision number to remove data.

Instructions

Delete a document from a database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseYesName of the database
doc_idYesDocument ID
revYesDocument revision (_rev)

Implementation Reference

  • The actual handler implementation for deleting a document from CouchDB. Takes database name, document ID, and revision, then uses the CouchDB Python library's delete() method to remove the document. Handles various exceptions including database not found, document not found, and revision conflicts.
    async def _delete_document(self, database: str, doc_id: str, rev: str) -> list[TextContent]:
        """Delete a document."""
        try:
            db = self._get_server()[database]
            db.delete({"_id": doc_id, "_rev": rev})
            return [TextContent(type="text", text=f"Document '{doc_id}' deleted successfully")]
        except KeyError:
            return [TextContent(type="text", text=f"Database '{database}' not found")]
        except couchdb.http.ResourceNotFound:
            return [TextContent(type="text", text=f"Document '{doc_id}' not found")]
        except couchdb.http.ResourceConflict:
            return [TextContent(type="text", text="Document delete conflict - revision mismatch")]
  • Tool schema definition for couchdb_delete_document. Defines the tool's name, description, and input schema with required parameters: database (string), doc_id (string), and rev (string for document revision).
    Tool(
        name="couchdb_delete_document",
        description="Delete a document from a database",
        inputSchema={
            "type": "object",
            "properties": {
                "database": {
                    "type": "string",
                    "description": "Name of the database",
                },
                "doc_id": {
                    "type": "string",
                    "description": "Document ID",
                },
                "rev": {
                    "type": "string",
                    "description": "Document revision (_rev)",
                },
            },
            "required": ["database", "doc_id", "rev"],
        },
    ),
  • Registration point where the couchdb_delete_document tool name is routed to its handler method. Extracts the three required arguments (database, doc_id, rev) and calls the _delete_document async method.
    elif name == "couchdb_delete_document":
        return await self._delete_document(
            arguments["database"],
            arguments["doc_id"],
            arguments["rev"]
        )
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states this is a deletion operation but doesn't clarify if it's permanent, reversible, requires specific permissions, has side effects, or what happens on failure. For a destructive operation, this is inadequate disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single clear sentence with no wasted words. It's front-loaded with the core action and resource, making it efficient for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive operation with no annotations and no output schema, the description is insufficient. It doesn't explain what 'delete' means in this context (permanent removal?), what permissions are required, what the response looks like, or error conditions. Given the complexity and risk of document deletion, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all three parameters. The description adds no additional parameter context beyond what's in the schema, maintaining the baseline score of 3 for adequate but not enhanced parameter semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and resource ('a document from a database'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'couchdb_delete_database' or specify what type of document deletion this performs (permanent vs soft).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites (like needing a valid revision), when not to use it, or how it differs from related tools like 'couchdb_update_document' for document modifications.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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