batch_delete_documents
Remove multiple Outline wiki documents simultaneously to manage content efficiently. Specify document IDs and choose permanent deletion when needed.
Instructions
Delete multiple documents at once.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentIds | Yes | ||
| permanent | No |
Implementation Reference
- src/lib/handlers/batch.ts:117-132 (handler)The core handler function that performs batch deletion by calling the Outline API '/documents.delete' for each document ID, supports permanent deletion flag, uses runBatch helper for processing and error handling.async batch_delete_documents(args: BatchDeleteDocumentsInput) { checkAccess(config, 'batch_delete_documents'); const results = await runBatch(args.documentIds, async (documentId) => { try { await apiCall(() => apiClient.post('/documents.delete', { id: documentId, permanent: args.permanent }) ); return { success: true, documentId }; } catch (error) { return { success: false, documentId, error: getErrorMessage(error) }; } }); return { ...results, permanent: args.permanent }; },
- src/lib/schemas.ts:138-138 (schema)Zod input schema definition: requires array of documentIds (non-empty strings) and optional permanent boolean.export const batchDeleteDocumentsSchema = z.object({ documentIds, permanent: z.boolean().default(false) });
- src/lib/schemas.ts:199-199 (schema)TypeScript type derived from the Zod schema for type safety in handlers.export type BatchDeleteDocumentsInput = z.infer<typeof batchDeleteDocumentsSchema>;
- src/lib/tools.ts:194-197 (registration)Registers the tool definition with name, description, and references the Zod schema for MCP tool advertisement.'batch_delete_documents', 'Delete multiple documents at once.', 'batch_delete_documents' ),
- src/lib/handlers/index.ts:25-25 (registration)Includes the batch handlers (including batch_delete_documents) into the complete set of tool handlers via createAllHandlers....createBatchHandlers(ctx),