move_document
Relocate documents between collections or reposition them under parent documents to organize content structure in Outline wiki.
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)The core handler function that implements the move_document tool logic. It performs access check, constructs payload from input args, calls the Outline API endpoint '/documents.move', and returns formatted result with updated collectionId and parentDocumentId.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 the input validation for move_document tool: requires documentId, optional collectionId (UUID), optional nullable parentDocumentId (UUID).export const moveDocumentSchema = z.object({ documentId, collectionId: collectionId.optional(), parentDocumentId: z.string().uuid().nullable().optional(), });
- src/lib/tools.ts:85-89 (registration)Tool registration in the allTools array, defining the name, description, and linking to the Zod schema for JSON Schema conversion used in MCP tool definitions.createTool( 'move_document', 'Move document to another collection or under a parent document.', 'move_document' ),
- src/lib/schemas.ts:222-222 (schema)Maps the move_document tool name to its Zod schema in the central toolSchemas object used by tool definitions.move_document: moveDocumentSchema,
- src/lib/access-control.ts:15-15 (helper)Includes 'move_document' in the WRITE_TOOLS Set for access control checks in read-only mode.'move_document',