Skip to main content
Glama
KS-GEN-AI

Confluence Communication Server

update_page_content

Modify Confluence page content and optionally change the title by providing HTML content and page ID.

Instructions

Update the content of a Confluence page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageIdYesConfluence Page ID
contentYesHTML content to update the page with
titleNoPage title (optional, if you want to change it)

Implementation Reference

  • The core handler function that updates the Confluence page content. It fetches the current page to get the version, constructs the update payload, and performs a PUT request to the Confluence API.
    async function updatePageContent(
      pageId: string,
      content: string,
      title?: string,
    ): Promise<any> {
      try {
        // First, get the current page to retrieve its version and other details
        const currentPage = await getPageContent(pageId);
    
        if (currentPage.error) {
          return {
            error: `Failed to get current page: ${currentPage.error}`,
          };
        }
    
        // Create update payload
        const updatePayload = {
          id: pageId,
          type: currentPage.type,
          title: title || currentPage.title,
          space: currentPage.space,
          body: {
            storage: {
              value: content,
              representation: 'storage',
            },
          },
          version: {
            number: currentPage.version.number + 1,
          },
        };
    
        // Update the page
        const response = await axios.put(
          `${CONFLUENCE_URL}/wiki/rest/api/content/${pageId}`,
          updatePayload,
          {
            headers: {
              ...getAuthHeaders().headers,
              'Content-Type': 'application/json',
            },
          },
        );
    
        return response.data;
      } catch (error: any) {
        return {
          error: error.response ? error.response.data : error.message,
        };
      }
    }
  • src/index.ts:73-94 (registration)
    Registers the 'update_page_content' tool in the ListTools response, including name, description, and input schema.
    {
      name: 'update_page_content',
      description: 'Update the content of a Confluence page',
      inputSchema: {
        type: 'object',
        properties: {
          pageId: {
            type: 'string',
            description: 'Confluence Page ID',
          },
          content: {
            type: 'string',
            description: 'HTML content to update the page with',
          },
          title: {
            type: 'string',
            description: 'Page title (optional, if you want to change it)',
          },
        },
        required: ['pageId', 'content'],
      },
    },
  • Defines the input schema for the 'update_page_content' tool, specifying required pageId and content, optional title.
    inputSchema: {
      type: 'object',
      properties: {
        pageId: {
          type: 'string',
          description: 'Confluence Page ID',
        },
        content: {
          type: 'string',
          description: 'HTML content to update the page with',
        },
        title: {
          type: 'string',
          description: 'Page title (optional, if you want to change it)',
        },
      },
      required: ['pageId', 'content'],
    },
  • Dispatches the tool call within the CallToolRequestHandler, validates arguments, calls the updatePageContent function, and formats the response.
    case 'update_page_content': {
      const pageId = String(request.params.arguments?.pageId);
      const content = String(request.params.arguments?.content);
      const title = request.params.arguments?.title
        ? String(request.params.arguments?.title)
        : undefined;
    
      if (!pageId) {
        throw new Error('Page ID is required');
      }
      if (!content) {
        throw new Error('Content is required');
      }
    
      const response = await updatePageContent(pageId, content, title);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(response, null, 2),
          },
        ],
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'update' which implies a mutation, but doesn't disclose critical traits like required permissions, whether changes are reversible, rate limits, or what happens on success/failure. This leaves significant gaps for a tool that modifies content.

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 with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place without redundancy.

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 the complexity of a mutation tool with no annotations and no output schema, the description is incomplete. It lacks behavioral context (e.g., permissions, side effects), usage guidelines, and details on return values or errors. For updating page content, this leaves too many unknowns for effective tool selection.

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%, with clear descriptions for all parameters (pageId, content, title). The description adds no additional meaning beyond what the schema provides, such as format details for content or title constraints. Baseline 3 is appropriate since the schema does the heavy lifting.

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 verb 'update' and resource 'content of a Confluence page', making the purpose immediately understandable. It distinguishes from sibling tools like 'get_page_content' (read vs. write) and 'execute_cql_search' (search vs. update), though it doesn't explicitly mention these distinctions in the description itself.

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 page ID), exclusions, or compare it to sibling tools like 'get_page_content' for reading or 'execute_cql_search' for finding pages. Usage is implied by the action but not explicitly defined.

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/KS-GEN-AI/confluence-mcp-server'

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