batch_archive_documents
Archive multiple Outline wiki documents simultaneously to manage document lifecycle and reduce clutter.
Instructions
Archive multiple documents at once.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentIds | Yes |
Implementation Reference
- src/lib/handlers/batch.ts:102-115 (handler)The main handler function for batch_archive_documents, which archives multiple documents by calling the Outline API's /documents.archive endpoint for each document ID, using the shared runBatch helper.async batch_archive_documents(args: BatchArchiveDocumentsInput) { checkAccess(config, 'batch_archive_documents'); return runBatch(args.documentIds, async (documentId) => { try { const { data } = await apiCall(() => apiClient.post<OutlineDocument>('/documents.archive', { id: documentId }) ); return { success: true, id: data.id, title: data.title }; } catch (error) { return { success: false, documentId, error: getErrorMessage(error) }; } }); },
- src/lib/schemas.ts:137-137 (schema)Zod schema definition for the input: requires an array of documentIds.export const batchArchiveDocumentsSchema = z.object({ documentIds });
- src/lib/schemas.ts:198-198 (schema)TypeScript type derived from the Zod schema for type safety in handlers.export type BatchArchiveDocumentsInput = z.infer<typeof batchArchiveDocumentsSchema>;
- src/lib/tools.ts:188-192 (registration)Registration of the tool in the allTools array, converting Zod schema to JSON schema for MCP.createTool( 'batch_archive_documents', 'Archive multiple documents at once.', 'batch_archive_documents' ),
- src/lib/schemas.ts:241-241 (registration)The schema is mapped to the tool name in toolSchemas object, used by tools.ts.batch_archive_documents: batchArchiveDocumentsSchema,
- src/lib/access-control.ts:27-27 (helper)Listed in WRITE_TOOLS set for access control checks.'batch_archive_documents',