Skip to main content
Glama
Olson3R
by Olson3R

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
NameRequiredDescriptionDefault
contentYesPage content (HTML or storage format)
parentIdNoOptional: Parent page ID
spaceKeyYesTarget space key
titleYesPage title

Implementation Reference

  • 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']
      }
    },
  • 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;
    }
  • 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;
    }
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