batch_delete_documents
Delete multiple Outline wiki documents simultaneously using their IDs, with options for permanent removal or soft deletion.
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 main handler function for the batch_delete_documents tool. It performs batch deletion of documents using the Outline API, with optional permanent deletion. Uses runBatch helper to process each document ID.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 schema definition for the batch_delete_documents tool input: array of documentIds and optional permanent boolean.export const batchDeleteDocumentsSchema = z.object({ documentIds, permanent: z.boolean().default(false) });
- src/lib/tools.ts:193-197 (registration)Registration of the batch_delete_documents tool in the allTools array, converting the Zod schema to JSON Schema for MCP.createTool( 'batch_delete_documents', 'Delete multiple documents at once.', 'batch_delete_documents' ),
- src/lib/schemas.ts:199-199 (schema)TypeScript type derived from the batchDeleteDocumentsSchema for use in handlers.export type BatchDeleteDocumentsInput = z.infer<typeof batchDeleteDocumentsSchema>;
- src/lib/schemas.ts:242-242 (registration)Mapping of the tool name to its schema in the central toolSchemas object used by tool definitions.batch_delete_documents: batchDeleteDocumentsSchema,