unarchive_document
Restore archived documents in Outline wiki to make them accessible again for editing and viewing.
Instructions
Restore an archived document.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentId | Yes |
Implementation Reference
- src/lib/handlers/documents.ts:116-122 (handler)The core handler function for the unarchive_document tool. It checks access, calls the Outline API to unarchive the document, and returns the document ID, title, and success message.async unarchive_document(args: UnarchiveDocumentInput) { checkAccess(config, 'unarchive_document'); const { data } = await apiCall(() => apiClient.post<OutlineDocument>('/documents.unarchive', { id: args.documentId }) ); return { id: data.id, title: data.title, message: MESSAGES.DOCUMENT_UNARCHIVED }; },
- src/lib/handlers/documents.ts:116-122 (handler)The core handler function for the unarchive_document tool. It performs access check, calls the Outline API /documents.unarchive endpoint with the document ID, and returns the document ID, title, and success message.async unarchive_document(args: UnarchiveDocumentInput) { checkAccess(config, 'unarchive_document'); const { data } = await apiCall(() => apiClient.post<OutlineDocument>('/documents.unarchive', { id: args.documentId }) ); return { id: data.id, title: data.title, message: MESSAGES.DOCUMENT_UNARCHIVED }; },
- src/lib/schemas.ts:66-66 (schema)Zod input schema definition for unarchive_document tool: requires a valid documentId string.export const unarchiveDocumentSchema = z.object({ documentId });
- src/lib/schemas.ts:66-66 (schema)Zod schema definition for UnarchiveDocumentInput, requiring a documentId string.export const unarchiveDocumentSchema = z.object({ documentId });
- src/lib/schemas.ts:181-181 (schema)TypeScript type definition for UnarchiveDocumentInput inferred from the Zod schema.export type UnarchiveDocumentInput = z.infer<typeof unarchiveDocumentSchema>;
- src/lib/tools.ts:98-100 (registration)Registers the unarchive_document tool in the allTools array, providing name, description, and schema reference.'unarchive_document', 'Restore an archived document.', 'unarchive_document'
- src/lib/schemas.ts:224-224 (schema)Maps the unarchive_document tool name to its Zod schema in the central toolSchemas object used across the application.unarchive_document: unarchiveDocumentSchema,
- src/lib/tools.ts:97-101 (registration)Registration of the unarchive_document tool in the allTools array. Converts the Zod schema to JSON Schema and defines the tool name and description for MCP.createTool( 'unarchive_document', 'Restore an archived document.', 'unarchive_document' ),
- src/lib/access-control.ts:17-17 (helper)Includes unarchive_document in the WRITE_TOOLS set for access control checks.'unarchive_document',
- src/lib/access-control.ts:12-29 (helper)Access control configuration listing unarchive_document as a write operation tool that requires permission checks via checkAccess.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', ]);