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
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes |
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", {})
- src/mcp_outline/features/documents/__init__.py:44-53 (registration)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)
- src/mcp_outline/features/__init__.py:15-17 (registration)Higher-level registration call to documents.register(mcp) from features/__init__.py register_all.# Register document management features documents.register(mcp)
- src/mcp_outline/server.py:32-32 (registration)Top-level registration of all features (including documents) in the main server.py file.register_all(mcp)