Skip to main content
Glama
huiseo
by huiseo

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
NameRequiredDescriptionDefault
documentIdYes
collectionIdNo
parentDocumentIdNo

Implementation Reference

  • 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,
      };
    },
  • 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'
    ),
  • 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;
    }
  • Maps the move_document tool name to its schema in the central toolSchemas object used by tool definitions.
    move_document: moveDocumentSchema,

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/huiseo/outline-wiki-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server