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
| Name | Required | Description | Default |
|---|---|---|---|
| pageId | Yes | Page ID to move | |
| parentId | No | Optional: New parent page ID in the target space | |
| targetSpaceKey | Yes | Target space key to move the page to |
Input Schema (JSON Schema)
{
"properties": {
"pageId": {
"description": "Page ID to move",
"type": "string"
},
"parentId": {
"description": "Optional: New parent page ID in the target space",
"type": "string"
},
"targetSpaceKey": {
"description": "Target space key to move the page to",
"type": "string"
}
},
"required": [
"pageId",
"targetSpaceKey"
],
"type": "object"
}
Implementation Reference
- src/confluence-client.ts:446-478 (handler)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; }
- src/index.ts:140-161 (schema)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'] } },
- src/index.ts:356-372 (handler)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) } ] }; }
- src/types.ts:92-104 (schema)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; }>; }