archive_document
Archive documents in Outline wiki to organize content and reduce clutter. This tool moves documents to archived status while preserving their data.
Instructions
Archive a document.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentId | Yes |
Implementation Reference
- src/lib/handlers/documents.ts:108-114 (handler)The core handler function for the 'archive_document' tool. It performs an access check, calls the Outline API to archive the document by ID, and returns the document's ID, title, archived timestamp, and a success message.async archive_document(args: ArchiveDocumentInput) { checkAccess(config, 'archive_document'); const { data } = await apiCall(() => apiClient.post<OutlineDocument>('/documents.archive', { id: args.documentId }) ); return { id: data.id, title: data.title, archivedAt: data.archivedAt, message: MESSAGES.DOCUMENT_ARCHIVED }; },
- src/lib/schemas.ts:65-65 (schema)Zod schema definition for the input of archive_document tool, requiring a 'documentId' string.export const archiveDocumentSchema = z.object({ documentId });
- src/lib/tools.ts:93-96 (registration)Registers the MCP tool definition for 'archive_document', including name, description, and reference to its schema.'archive_document', 'Archive a document.', 'archive_document' ),
- src/lib/schemas.ts:223-223 (schema)Maps the tool name 'archive_document' to its Zod schema in the central toolSchemas object used by tool definitions.archive_document: archiveDocumentSchema,
- src/lib/access-control.ts:12-29 (helper)Includes 'archive_document' in the set of write operations requiring access checks in read-only mode.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', ]);