Skip to main content
Glama
Olson3R
by Olson3R

move_page

Relocate a Confluence page to a different space or parent page by specifying the page ID, target space key, and optional parent ID. Simplify content organization on the Confluence MCP Server.

Instructions

Move a Confluence page to a different space or parent

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageIdYesPage ID to move
parentIdNoOptional: New parent page ID in the target space
targetSpaceKeyYesTarget space key to move the page to

Implementation Reference

  • Core handler function that executes the page move logic: validates access to source and target spaces, fetches current page, constructs MovePageRequest, and performs PUT /pages/{pageId} to move the page.
    async movePage(
      pageId: string,
      targetSpaceKey: string,
      parentId?: string
    ): Promise<ConfluencePage> {
      const currentPage = await this.getPage(pageId);
      
      if (!currentPage.space || !currentPage.space.key) {
        throw new Error('Unable to determine page space for access validation');
      }
      
      if (!validateSpaceAccess(currentPage.space.key, this.config.allowedSpaces)) {
        throw new Error(`Access denied to source space: ${currentPage.space.key}`);
      }
      
      if (!validateSpaceAccess(targetSpaceKey, this.config.allowedSpaces)) {
        throw new Error(`Access denied to target space: ${targetSpaceKey}`);
      }
    
      const moveData: MovePageRequest = {
        version: { number: currentPage.version.number },
        title: currentPage.title,
        type: 'page',
        space: { key: targetSpaceKey }
      };
    
      if (parentId) {
        moveData.ancestors = [{ id: parentId }];
      }
    
      const response: AxiosResponse<ConfluencePage> = await this.client.put(`/pages/${pageId}`, moveData);
      return response.data;
    }
  • MCP tool schema registration including name, description, and input schema for move_page.
    {
      name: 'move_page',
      description: 'Move a Confluence page to a different space or parent',
      inputSchema: {
        type: 'object',
        properties: {
          pageId: {
            type: 'string',
            description: 'Page ID to move'
          },
          targetSpaceKey: {
            type: 'string',
            description: 'Target space key to move the page to'
          },
          parentId: {
            type: 'string',
            description: 'Optional: New parent page ID in the target space'
          }
        },
        required: ['pageId', 'targetSpaceKey']
      }
    },
  • MCP CallToolRequestSchema dispatch handler for move_page: extracts arguments and delegates to ConfluenceClient.movePage, returns JSON response.
    case 'move_page': {
      const { pageId, targetSpaceKey, parentId } = args as {
        pageId: string;
        targetSpaceKey: string;
        parentId?: string;
      };
      
      const page = await confluenceClient.movePage(pageId, targetSpaceKey, parentId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(page, null, 2)
          }
        ]
      };
    }
  • TypeScript interface defining the MovePageRequest structure used in the movePage implementation.
    export interface MovePageRequest {
      version: {
        number: number;
      };
      title: string;
      type: string;
      space: {
        key: string;
      };
      ancestors?: Array<{
        id: string;
      }>;
    }
Install Server

Other Tools

Related Tools

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/Olson3R/confluence-mcp'

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