Skip to main content
Glama

archive_document

Archive documents to remove them from active collections while preserving searchability. Use this tool to clean up outdated or inactive documents without deletion, ensuring document history is maintained for future reference.

Instructions

    Archives a document to remove it from active use while preserving it.
    
    IMPORTANT: Archived documents are removed from collections but remain
    searchable in the system. They won't appear in normal collection views
    but can still be found through search or the archive list.
    
    Use this tool when you need to:
    - Remove outdated or inactive documents from view
    - Clean up collections while preserving document history
    - Preserve documents that are no longer relevant
    - Temporarily hide documents without deleting them
    
    Args:
        document_id: The document ID to archive
        
    Returns:
        Result message confirming archival
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYes

Implementation Reference

  • Primary MCP tool handler for the 'archive_document' tool. Uses OutlineClient to perform the archival and returns a success message with document title.
    @mcp.tool(
        annotations=ToolAnnotations(
            readOnlyHint=False, destructiveHint=True, idempotentHint=True
        )
    )
    async def archive_document(document_id: str) -> str:
        """
        Archives a document to remove it from active use while preserving it.
    
        IMPORTANT: Archived documents are removed from collections but remain
        searchable in the system. They won't appear in normal collection views
        but can still be found through search or the archive list.
    
        Use this tool when you need to:
        - Remove outdated or inactive documents from view
        - Clean up collections while preserving document history
        - Preserve documents that are no longer relevant
        - Temporarily hide documents without deleting them
    
        Args:
            document_id: The document ID to archive
    
        Returns:
            Result message confirming archival
        """
        try:
            client = await get_outline_client()
            document = await client.archive_document(document_id)
    
            if not document:
                return "Failed to archive document."
    
            doc_title = document.get("title", "Untitled")
    
            return f"Document archived successfully: {doc_title}"
        except OutlineClientError as e:
            return f"Error archiving document: {str(e)}"
        except Exception as e:
            return f"Unexpected error: {str(e)}"
  • OutlineClient helper method that executes the actual Outline API POST request to archive the document.
    async def archive_document(self, document_id: str) -> Dict[str, Any]:
        """
        Archive a document by ID.
    
        Args:
            document_id: The document ID to archive.
    
        Returns:
            The archived document data.
        """
        response = await self.post("documents.archive", {"id": document_id})
        return response.get("data", {})
  • Registration of document_lifecycle tools (including archive_document) in the documents feature module, conditional on read-only mode.
    if os.getenv("OUTLINE_READ_ONLY", "").lower() not in (
        "true",
        "1",
        "yes",
    ):
        document_content.register_tools(mcp)
        document_lifecycle.register_tools(mcp)
        document_organization.register_tools(mcp)
        batch_operations.register_tools(mcp)
  • Higher-level registration call to documents.register(mcp) from features/__init__.py register_all.
    # Register document management features
    documents.register(mcp)
  • Top-level registration of all features (including documents) in the main server.py file.
    register_all(mcp)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively explains key behaviors: archived documents are removed from collections but remain searchable, won't appear in normal views, and can be found through search or archive list. It doesn't mention permissions, rate limits, or error conditions, but covers the core operational impact well.

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 well-structured and front-loaded with the core purpose, followed by important details and usage guidelines. Every sentence adds value: the first defines the action, the second explains behavioral effects, and the bullet points clarify use cases. No wasted words or redundancy.

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

Completeness4/5

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

Given no annotations and no output schema, the description does a good job covering the tool's purpose, behavior, and usage. It explains the archival effect clearly and includes a return value note. However, it lacks details on error cases, permissions, or exact response format, which could be useful for a mutation tool.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It adds the Args section specifying 'document_id: The document ID to archive', which provides essential semantic context beyond the bare schema. However, it doesn't detail format constraints (e.g., length, pattern) or examples, leaving some gaps.

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

Purpose5/5

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

The description clearly states the specific action ('Archives a document') and resource ('document'), distinguishing it from siblings like delete_document (permanent removal) and unarchive_document (reverse operation). It explains the purpose is to 'remove it from active use while preserving it', which is precise and non-tautological.

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

Usage Guidelines5/5

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

The description explicitly lists four use cases (e.g., 'Remove outdated or inactive documents from view', 'Temporarily hide documents without deleting them'), providing clear guidance on when to use this tool. It implicitly contrasts with delete_document (for permanent removal) and unarchive_document (for restoration), though it doesn't name alternatives directly.

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

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/Vortiago/mcp-outline'

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