create_page
Generate a new Confluence page with specified space, title, content, and optional parent page ID using secure access through the Confluence MCP Server.
Instructions
Create a new Confluence page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Page content (HTML or storage format) | |
| parentId | No | Optional: Parent page ID | |
| spaceKey | Yes | Target space key | |
| title | Yes | Page title |
Implementation Reference
- src/index.ts:318-335 (handler)MCP tool handler for 'create_page': destructures input arguments, calls ConfluenceClient.createPage, and returns the created page as formatted JSON text.case 'create_page': { const { spaceKey, title, content, parentId } = args as { spaceKey: string; title: string; content: string; parentId?: string; }; const page = await confluenceClient.createPage(spaceKey, title, content, parentId); return { content: [ { type: 'text', text: JSON.stringify(page, null, 2) } ] }; }
- src/index.ts:88-113 (registration)Registration of the 'create_page' tool in ListToolsRequestHandler, defining name, description, and JSON input schema.{ name: 'create_page', description: 'Create a new Confluence page', inputSchema: { type: 'object', properties: { spaceKey: { type: 'string', description: 'Target space key' }, title: { type: 'string', description: 'Page title' }, content: { type: 'string', description: 'Page content (HTML or storage format)' }, parentId: { type: 'string', description: 'Optional: Parent page ID' } }, required: ['spaceKey', 'title', 'content'] } },
- src/types.ts:65-74 (schema)TypeScript interface defining the Confluence API request body structure for creating a page.export interface CreatePageRequest { spaceId: string; status: string; title: string; body: { representation: string; value: string; }; parentId?: string; }
- src/confluence-client.ts:214-246 (helper)ConfluenceClient.createPage implementation: validates space access, resolves space ID, builds CreatePageRequest, POSTs to /pages API endpoint, returns created page.async createPage( spaceKey: string, title: string, content: string, parentId?: string ): Promise<ConfluencePage> { if (!validateSpaceAccess(spaceKey, this.config.allowedSpaces)) { throw new Error(`Access denied to space: ${spaceKey}`); } // Get space details to obtain the space ID const space = await this.getSpaceByKey(spaceKey); if (!space.id) { throw new Error(`Unable to get space ID for space: ${spaceKey}`); } const pageData: CreatePageRequest = { spaceId: space.id, status: 'current', title, body: { representation: 'storage', value: content } }; if (parentId) { pageData.parentId = parentId; } const response: AxiosResponse<ConfluencePage> = await this.client.post('/pages', pageData); return response.data; }