restore_document
Recover deleted documents from the Outline wiki trash to restore access and content.
Instructions
Restore a document from trash.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentId | Yes |
Implementation Reference
- src/lib/handlers/documents.ts:137-143 (handler)The main execution handler for the 'restore_document' tool. It performs an access check, calls the Outline API endpoint '/documents.restore' with the document ID, and returns a formatted document result.async restore_document(args: RestoreDocumentInput) { checkAccess(config, 'restore_document'); const { data } = await apiCall(() => apiClient.post<OutlineDocument>('/documents.restore', { id: args.documentId }) ); return docResult(data, MESSAGES.DOCUMENT_RESTORED); },
- src/lib/schemas.ts:67-67 (schema)Zod input schema for 'restore_document' tool, requiring a 'documentId' string.export const restoreDocumentSchema = z.object({ documentId });
- src/lib/tools.ts:108-110 (registration)Registration of the 'restore_document' tool in the MCP tools list, providing name, description, and schema reference.'restore_document', 'Restore a document from trash.', 'restore_document'
- src/lib/schemas.ts:183-183 (schema)TypeScript type definition for RestoreDocumentInput inferred from the restoreDocumentSchema.export type RestoreDocumentInput = z.infer<typeof restoreDocumentSchema>;
- src/lib/access-control.ts:12-29 (helper)Access control helper listing 'restore_document' as a write operation, used in checkAccess to enforce permissions.const WRITE_TOOLS = new Set([ 'create_document', 'update_document', 'move_document', 'archive_document', 'unarchive_document', 'delete_document', 'restore_document', 'add_comment', 'create_collection', 'update_collection', 'delete_collection', 'batch_create_documents', 'batch_update_documents', 'batch_move_documents', 'batch_archive_documents', 'batch_delete_documents', ]);