batch_move_documents
Move multiple documents simultaneously within Outline wiki to reorganize content efficiently. Specify document IDs and target collection or parent document to manage document structure.
Instructions
Move multiple documents at once.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentIds | Yes | ||
| collectionId | No | ||
| parentDocumentId | No |
Implementation Reference
- src/lib/handlers/batch.ts:83-100 (handler)The handler function batch_move_documents that executes the batch move operation by calling the Outline API's /documents.move endpoint for each document ID.async batch_move_documents(args: BatchMoveDocumentsInput) { checkAccess(config, 'batch_move_documents'); return runBatch(args.documentIds, async (documentId) => { try { const payload: Record<string, unknown> = { id: documentId }; if (args.collectionId) payload.collectionId = args.collectionId; if (args.parentDocumentId !== undefined) payload.parentDocumentId = args.parentDocumentId; const { data } = await apiCall(() => apiClient.post<OutlineDocument>('/documents.move', payload) ); return { success: true, id: data.id, title: data.title }; } catch (error) { return { success: false, documentId, error: getErrorMessage(error) }; } }); },
- src/lib/schemas.ts:131-135 (schema)Zod schema defining the input for batch_move_documents: array of documentIds, optional collectionId and parentDocumentId.export const batchMoveDocumentsSchema = z.object({ documentIds, collectionId: collectionId.optional(), parentDocumentId: z.string().uuid().nullable().optional(), });
- src/lib/tools.ts:183-187 (registration)Tool registration in allTools array, creating the MCP tool definition from the schema.createTool( 'batch_move_documents', 'Move multiple documents at once.', 'batch_move_documents' ),
- src/lib/handlers/batch.ts:21-31 (helper)Generic helper function runBatch used by the batch_move_documents handler to process multiple items and return a summary.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 }; }
- src/lib/access-control.ts:26-26 (helper)Access control configuration listing batch_move_documents as a write operation tool.'batch_move_documents',