Skip to main content
Glama

remove_document

Delete a specific document from the DocNav-MCP server using its unique identifier to manage document storage and organization.

Instructions

Remove a document from the navigator.

Args:
    doc_id: Document identifier (UUID)

Returns:
    Success or error message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'remove_document', decorated with @mcp.tool(). It calls the navigator's remove_document method and returns a formatted success or error message based on the boolean result.
    @mcp.tool()
    def remove_document(doc_id: str) -> str:
        """Remove a document from the navigator.
    
        Args:
            doc_id: Document identifier (UUID)
    
        Returns:
            Success or error message
        """
        success = navigator.remove_document(doc_id)
        if success:
            return f"Document '{doc_id}' removed successfully"
        else:
            return f"Document '{doc_id}' not found or could not be removed"
  • Core logic in Navigator class's remove_document method: validates doc_id as UUID, then deletes the document from loaded_documents and document_metadata dictionaries if present, returning True on success or False otherwise.
    def remove_document(self, doc_id: str) -> bool:
        """Remove a document from the navigator.
    
        Args:
            doc_id: UUID-based document identifier
    
        Returns:
            True if document was removed, False if not found
        """
        try:
            uuid.UUID(doc_id)
        except ValueError:
            return False
    
        if doc_id in self.loaded_documents:
            del self.loaded_documents[doc_id]
            if doc_id in self.document_metadata:
                del self.document_metadata[doc_id]
            return True
        return False
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Remove' implies a destructive operation, the description doesn't clarify if this is permanent deletion, reversible removal, or what happens to related data. No information about permissions, side effects, or error conditions beyond the generic 'error message' mention.

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

Conciseness4/5

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

The description is appropriately concise with clear sections (purpose, args, returns). The purpose statement is front-loaded, though the Args/Returns formatting could be more integrated. No wasted sentences, but the structure is somewhat mechanical rather than flowing naturally.

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

Completeness3/5

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

Given this is a destructive operation with no annotations, 0% schema coverage, but has an output schema, the description is minimally adequate. It explains what the tool does and the parameter format, but lacks crucial context about the removal's nature, permissions needed, or relationship to other document operations. The output schema existence reduces need to detail return values.

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?

The description adds minimal parameter semantics beyond the schema. It specifies 'doc_id' is a 'Document identifier (UUID)', which provides format information not in the schema (0% coverage). However, it doesn't explain where to obtain this ID, validate it, or provide examples. Baseline 3 is appropriate given schema coverage is 0% but description adds some value.

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 ('Remove') and resource ('document from the navigator'), providing specific verb+resource pairing. However, it doesn't differentiate from potential siblings like 'delete_document' or explain what distinguishes 'remove' from other operations in this context.

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, consequences, or relationships to sibling tools like 'list_documents' or 'load_document' that might be used before or after removal.

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/shenyimings/DocNav-MCP'

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