batch_move_documents
Move multiple Outline wiki documents simultaneously to reorganize content efficiently. Specify document IDs and target collection or parent document.
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 core handler function for the batch_move_documents tool. It performs access check, then batches API calls to move each document to the specified collection or parent using the Outline /documents.move endpoint.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 input schema definition for batch_move_documents tool, validating documentIds array and optional collectionId/parentDocumentId.export const batchMoveDocumentsSchema = z.object({ documentIds, collectionId: collectionId.optional(), parentDocumentId: z.string().uuid().nullable().optional(), });
- src/lib/tools.ts:183-187 (registration)Registers the batch_move_documents tool in the allTools array by creating a ToolDefinition from its Zod schema.createTool( 'batch_move_documents', 'Move multiple documents at once.', 'batch_move_documents' ),
- src/lib/schemas.ts:240-240 (schema)Maps the batchMoveDocumentsSchema to the 'batch_move_documents' tool name in the central toolSchemas record.batch_move_documents: batchMoveDocumentsSchema,
- src/lib/handlers/batch.ts:31-33 (helper)The createBatchHandlers factory function that produces the handler object including batch_move_documents.} export function createBatchHandlers({ apiClient, apiCall, config }: AppContext) {