Skip to main content
Glama
aaronsb

Confluence MCP Server

create_confluence_page

Create new pages in Confluence spaces to document information, organize content, and share knowledge within teams.

Instructions

Create a new page in a space

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceIdYesID of the space to create the page in
titleYesTitle of the page
contentYesContent of the page in Confluence storage format
parentIdNoID of the parent page (optional)

Implementation Reference

  • The main handler function for the create_confluence_page tool. Validates input parameters, calls the ConfluenceClient to create the page, and returns a simplified response with page ID, version, and URL.
    export async function handleCreateConfluencePage(
      client: ConfluenceClient,
      args: { spaceId: string; title: string; content: string; parentId?: string }
    ): Promise<{
      content: Array<{ type: "text"; text: string }>;
    }> {
      try {
        if (!args.spaceId || !args.title || !args.content) {
          throw new McpError(
            ErrorCode.InvalidParams,
            "spaceId, title, and content are required"
          );
        }
    
        const page = await client.createConfluencePage(
          args.spaceId,
          args.title,
          args.content,
          args.parentId
        );
    
        const simplified = {
          id: page.id,
          version: page.version.number,
          url: page._links.webui
        };
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(simplified),
            },
          ],
        };
      } catch (error) {
        console.error("Error creating page:", error instanceof Error ? error.message : String(error));
        if (error instanceof McpError) {
          throw error;
        }
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to create page: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
  • src/index.ts:224-235 (registration)
    Tool registration in the MCP server's CallToolRequestSchema handler switch statement. Extracts arguments, performs basic validation, and delegates to the handleCreateConfluencePage function.
    case "create_confluence_page": {
      const { spaceId, title, content, parentId } = (args || {}) as { 
        spaceId: string; 
        title: string; 
        content: string; 
        parentId?: string 
      };
      if (!spaceId || !title || !content) {
        throw new McpError(ErrorCode.InvalidParams, "spaceId, title, and content are required");
      }
      return await handleCreateConfluencePage(this.confluenceClient, { spaceId, title, content, parentId });
    }
  • Zod-like input schema definition and description for the create_confluence_page tool, defining parameters, types, descriptions, and required fields.
    create_confluence_page: {
      description: "Create a new page in a space",
      inputSchema: {
        type: "object",
        properties: {
          spaceId: {
            type: "string",
            description: "ID of the space to create the page in",
          },
          title: {
            type: "string",
            description: "Title of the page",
          },
          content: {
            type: "string",
            description: "Content of the page in Confluence storage format",
          },
          parentId: {
            type: "string",
            description: "ID of the parent page (optional)",
          },
        },
        required: ["spaceId", "title", "content"],
      },
    },
  • ConfluenceClient helper method that performs the actual HTTP POST request to the Confluence API endpoint /api/v2/pages to create the new page.
    async createConfluencePage(spaceId: string, title: string, content: string, parentId?: string): Promise<Page> {
      const body = {
        spaceId,
        status: 'current',
        title,
        body: {
          representation: 'storage',
          value: content
        },
        ...(parentId && { parentId })
      };
    
      const response = await this.v2Client.post('/pages', body);
      return response.data;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states 'Create' which implies a write/mutation operation, but doesn't disclose permissions needed, rate limits, whether the operation is idempotent, or what happens on failure. For a creation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for a simple creation tool and front-loads the core action and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a creation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after creation (e.g., returns page ID), error conditions, or dependencies. Given the complexity of creating a page with content formatting, more context about the 'Confluence storage format' or success criteria would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 4 parameters. The description adds no parameter-specific information beyond implying 'space' and 'page' context. This meets the baseline of 3 where the schema does the heavy lifting, but the description doesn't enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create') and resource ('new page in a space'), making the purpose immediately understandable. It distinguishes from siblings like 'update_confluence_page' by specifying creation rather than modification. However, it doesn't explicitly differentiate from other creation-related tools (none exist in siblings), so it's not a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a space ID), exclusions, or comparisons to siblings like 'update_confluence_page' for modifications. The agent must infer usage from context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/aaronsb/confluence-cloud-mcp'

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