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)

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