move_document
Relocate documents between collections or reposition them under parent documents in Outline wiki to organize content effectively.
Instructions
Move document to another collection or under a parent document.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentId | Yes | ||
| collectionId | No | ||
| parentDocumentId | No |
Implementation Reference
- src/lib/handlers/documents.ts:91-106 (handler)Core handler function that executes the move_document tool by constructing payload and calling Outline API /documents.move endpoint.async move_document(args: MoveDocumentInput) { checkAccess(config, 'move_document'); const payload: Record<string, unknown> = { id: args.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 { ...docResult(data, MESSAGES.DOCUMENT_MOVED), collectionId: data.collectionId, parentDocumentId: data.parentDocumentId, }; },
- src/lib/schemas.ts:57-61 (schema)Zod schema defining input parameters for move_document tool (documentId required, collectionId and parentDocumentId optional).export const moveDocumentSchema = z.object({ documentId, collectionId: collectionId.optional(), parentDocumentId: z.string().uuid().nullable().optional(), });
- src/lib/tools.ts:85-89 (registration)Registers the move_document tool in the allTools array with its name, description, and schema reference for MCP tool discovery.createTool( 'move_document', 'Move document to another collection or under a parent document.', 'move_document' ),
- src/lib/handlers/index.ts:19-28 (registration)Composes all handlers including document handlers (which contain move_document) into the unified ToolHandlers object.export function createAllHandlers(ctx: AppContext): ToolHandlers { return { ...createSearchHandlers(ctx), ...createDocumentHandlers(ctx), ...createCollectionHandlers(ctx), ...createCommentHandlers(ctx), ...createBatchHandlers(ctx), ...createSmartHandlers(ctx), } as ToolHandlers; }
- src/lib/schemas.ts:222-222 (schema)Maps the move_document tool name to its schema in the central toolSchemas object used by tool definitions.move_document: moveDocumentSchema,