Skip to main content
Glama
aaronsb

Confluence MCP Server

update_confluence_page

Update an existing Confluence page by supplying its ID, new title, content in storage format, and current version number to ensure safe and conflict-free modifications.

Instructions

Update an existing page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageIdYesID of the page to update
titleYesNew title of the page
contentYesNew content in Confluence storage format
versionYesCurrent version number of the page

Implementation Reference

  • The handler function that executes the update_confluence_page tool logic. It validates inputs (pageId, title, content, version), calls the Confluence client, and returns a simplified response with page id, version, and URL.
    export async function handleUpdateConfluencePage(
      client: ConfluenceClient,
      args: { pageId: string; title: string; content: string; version: number }
    ): Promise<{
      content: Array<{ type: "text"; text: string }>;
    }> {
      try {
        if (!args.pageId || !args.title || !args.content || args.version === undefined) {
          throw new McpError(
            ErrorCode.InvalidParams,
            "pageId, title, content, and version are required"
          );
        }
    
        const page = await client.updateConfluencePage(
          args.pageId,
          args.title,
          args.content,
          args.version
        );
    
        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 updating page:", error instanceof Error ? error.message : String(error));
        if (error instanceof McpError) {
          throw error;
        }
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to update page: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
  • The input schema definition for update_confluence_page. Defines the required parameters: pageId (string), title (string), content (string in storage format), and version (number representing current version).
    update_confluence_page: {
      description: "Update an existing page",
      inputSchema: {
        type: "object",
        properties: {
          pageId: {
            type: "string",
            description: "ID of the page to update",
          },
          title: {
            type: "string",
            description: "New title of the page",
          },
          content: {
            type: "string",
            description: "New content in Confluence storage format",
          },
          version: {
            type: "number",
            description: "Current version number of the page",
          },
        },
        required: ["pageId", "title", "content", "version"],
      },
    },
  • src/index.ts:236-247 (registration)
    The tool registration in the MCP server's CallToolRequestSchema handler. Routes the 'update_confluence_page' name to the handler function, extracting the pageId, title, content, and version arguments.
    case "update_confluence_page": {
      const { pageId, title, content, version } = (args || {}) as {
        pageId: string;
        title: string;
        content: string;
        version: number;
      };
      if (!pageId || !title || !content || version === undefined) {
        throw new McpError(ErrorCode.InvalidParams, "pageId, title, content, and version are required");
      }
      return await handleUpdateConfluencePage(this.confluenceClient, { pageId, title, content, version });
    }
  • The HTTP client helper that performs the actual Confluence API call. Sends a PUT request to /pages/{pageId} with the page title, storage-format body content, and incremented version number.
    async updateConfluencePage(pageId: string, title: string, content: string, version: number): Promise<Page> {
      const body = {
        id: pageId,
        status: 'current',
        title,
        body: {
          representation: 'storage',
          value: content
        },
        version: {
          number: version + 1,
          message: `Updated via MCP at ${new Date().toISOString()}`
        }
      };
    
      const response = await this.v2Client.put(`/pages/${pageId}`, body);
      return response.data;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It fails to disclose behaviors like optimistic locking (version parameter), idempotency, error conditions, or permission requirements beyond the basic update operation.

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 extremely concise at 4 words, with no redundancy. It is front-loaded and immediately communicates the core purpose. Every word earns its place.

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?

Given no output schema and 4 required parameters, the description is incomplete. It omits details on return value, version handling, error behaviors, and how updates interact with Confluence's page structure. A more complete description would clarify these aspects.

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?

Input schema covers all 4 parameters with descriptions (100% coverage). The description adds no additional meaning beyond what the schema already provides. For example, it does not explain Confluence storage format for content or the role of version in conflict detection.

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

Purpose5/5

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

The description 'Update an existing page' clearly states the action (update) and the resource (existing page). It contrasts with sibling tools like create_confluence_page (create) and get/find/list (read), making the purpose unambiguous.

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?

No guidance on when to use this tool versus alternatives (e.g., create_confluence_page for new pages, or find_confluence_page for searching). The description does not specify prerequisites, such as needing the page ID or version.

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