batch_move_documents
Move multiple documents simultaneously within Outline wiki to reorganize content efficiently. Specify document IDs and target collection or parent document to transfer content in bulk.
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 batch_move_documents that processes a list of document IDs, optionally moving them to a new collection or parent, using the Outline API's /documents.move endpoint with batch processing and error handling.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 definition for batch_move_documents input validation: requires documentIds array, 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)Registers the batch_move_documents tool in the MCP tool definitions array by name, description, and referencing its schema.createTool( 'batch_move_documents', 'Move multiple documents at once.', 'batch_move_documents' ),
- src/lib/handlers/index.ts:25-25 (registration)Spreads the batch handlers (including batch_move_documents) into the complete set of tool handlers via createAllHandlers....createBatchHandlers(ctx),
- src/lib/schemas.ts:240-240 (schema)Maps the batch_move_documents tool name to its schema in the central toolSchemas record used by tool definitions.batch_move_documents: batchMoveDocumentsSchema,