Skip to main content
Glama

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

Implementation Reference

  • The core handler function for the 'batch_archive_documents' tool. It performs access check and batches API calls to archive each document using the Outline API's '/documents.archive' endpoint, collecting success/failure results.
    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) }; } }); },
  • Zod schema defining the input for batch_archive_documents: an array of document IDs.
    export const batchArchiveDocumentsSchema = z.object({ documentIds });
  • Registers the tool definition in the allTools array, specifying name, description, and referencing the schema.
    createTool( 'batch_archive_documents', 'Archive multiple documents at once.', 'batch_archive_documents' ),
  • Maps the tool name to its schema in the central toolSchemas object used by tool definitions.
    batch_archive_documents: batchArchiveDocumentsSchema,
  • Generic helper function used by all batch handlers, including batch_archive_documents, to execute operations on a list of items and summarize results.
    async function runBatch<TItem>( items: TItem[], operation: (item: TItem) => Promise<BatchResult> ): Promise<BatchSummary> { const results: BatchResult[] = []; for (const item of items) { results.push(await operation(item)); } const succeeded = results.filter((r) => r.success).length; return { total: results.length, succeeded, failed: results.length - succeeded, results }; }

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