Skip to main content
Glama

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
NameRequiredDescriptionDefault
documentIdsYes
permanentNo

Implementation Reference

  • 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 }; },
  • 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) });
  • 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' ),
  • TypeScript type derived from the batchDeleteDocumentsSchema for use in handlers.
    export type BatchDeleteDocumentsInput = z.infer<typeof batchDeleteDocumentsSchema>;
  • Mapping of the tool name to its schema in the central toolSchemas object used by tool definitions.
    batch_delete_documents: batchDeleteDocumentsSchema,

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/huiseo/outline-smart-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server