unarchive_document
Restores archived documents to active status for reuse, access, and visibility in collections. Use to update or reference previously archived content by providing the document ID.
Instructions
Restores a previously archived document to active status.
Use this tool when you need to:
- Restore archived documents to active use
- Access or reference previously archived content
- Make archived content visible in collections again
- Update and reuse archived documents
Args:
document_id: The document ID to unarchive
Returns:
Result message confirming restoration
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes |
Implementation Reference
- The main MCP tool handler function for unarchive_document. It uses get_outline_client to get the client and calls client.unarchive_document, then formats a success message or handles errors.@mcp.tool( annotations=ToolAnnotations( readOnlyHint=False, destructiveHint=False, idempotentHint=True ) ) async def unarchive_document(document_id: str) -> str: """ Restores a previously archived document to active status. Use this tool when you need to: - Restore archived documents to active use - Access or reference previously archived content - Make archived content visible in collections again - Update and reuse archived documents Args: document_id: The document ID to unarchive Returns: Result message confirming restoration """ try: client = await get_outline_client() document = await client.unarchive_document(document_id) if not document: return "Failed to unarchive document." doc_title = document.get("title", "Untitled") return f"Document unarchived successfully: {doc_title}" except OutlineClientError as e: return f"Error unarchiving document: {str(e)}" except Exception as e: return f"Unexpected error: {str(e)}"
- The OutlineClient helper method that makes the actual API POST request to unarchive the document.async def unarchive_document(self, document_id: str) -> Dict[str, Any]: """ Unarchive a document by ID. Args: document_id: The document ID to unarchive. Returns: The unarchived document data. """ response = await self.post("documents.unarchive", {"id": document_id}) return response.get("data", {})
- The registration function that defines and registers the unarchive_document tool (and others) when called with an MCP server instance.def register_tools(mcp) -> None: """ Register document lifecycle tools with the MCP server. Args: mcp: The FastMCP server instance """ disable_delete = os.getenv("OUTLINE_DISABLE_DELETE", "").lower() in ( "true", "1", "yes", )