Skip to main content
Glama

batch_update_documents

Update multiple Outline wiki documents simultaneously to modify titles, content, or append text in bulk operations.

Instructions

Update multiple documents at once.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
updatesYes

Implementation Reference

  • The core handler function that implements the batch_update_documents tool logic. It processes a list of updates, handling title changes, text updates (with optional append mode), and reports success/failure for each using the shared runBatch utility.
    async batch_update_documents(args: BatchUpdateDocumentsInput) { checkAccess(config, 'batch_update_documents'); return runBatch(args.updates, async (update) => { try { let text = update.text; if (update.append && update.text) { const { data: existing } = await apiCall(() => apiClient.post<OutlineDocument>('/documents.info', { id: update.documentId }) ); text = (existing.text || '') + '\n\n' + update.text; } const payload: Record<string, unknown> = { id: update.documentId }; if (update.title) payload.title = update.title; if (text !== undefined) payload.text = text; const { data } = await apiCall(() => apiClient.post<OutlineDocument>('/documents.update', payload) ); return { success: true, id: data.id, title: data.title }; } catch (error) { return { success: false, documentId: update.documentId, error: getErrorMessage(error) }; } }); },
  • Zod schema defining the input structure for batch_update_documents, including an array of updates each with documentId, optional title/text, and append flag.
    export const batchUpdateDocumentsSchema = z.object({ updates: z.array(z.object({ documentId, title: z.string().min(1).optional(), text: z.string().optional(), append: z.boolean().default(false), })).min(1, 'At least one update is required'), });
  • Tool registration in the allTools array using createTool, which converts the Zod schema to JSON Schema for MCP tool definition.
    createTool( 'batch_update_documents', 'Update multiple documents at once.', 'batch_update_documents' ),
  • TypeScript type derived from the batchUpdateDocumentsSchema for use in handler signatures.
    export type BatchUpdateDocumentsInput = z.infer<typeof batchUpdateDocumentsSchema>;
  • Inclusion of the schema in the central toolSchemas map, referenced by tools.ts for JSON Schema conversion.
    batch_update_documents: batchUpdateDocumentsSchema,

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