Skip to main content
Glama
aguaitech

Elementor MCP Server

by aguaitech

update_page

Update WordPress pages with Elementor data by specifying page ID, title, status, content, and JSON-based Elementor data. Verifies success with a boolean response.

Instructions

Updates an existing page in WordPress with Elementor data, it will return a boolean value to indicate if the update was successful.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentNoThe standard WordPress content for the page (optional).
elementor_dataNoThe Elementor page data as a JSON string. Optional for update.
pageIdYesThe ID of the page to update.
statusNoThe status for the page (e.g., 'publish', 'draft').
titleNoThe title for the page.

Implementation Reference

  • MCP tool handler for 'update_page' that extracts input, validates, calls the updatePage helper, and returns success indicator.
    async (input) => {
      // Handler
      const { pageId, ...updateData } = input;
      // Basic validation, although schema handles optionality
      if (Object.keys(updateData).length === 0) {
        throw new Error(
          "No update data provided (title, status, content, or elementor_data)."
        );
      }
      await updatePage(pageId, updateData);
      return {
        content: [
          {
            type: "text",
            text: "true",
          },
        ],
      };
    }
  • Zod input schema defining parameters for the update_page tool: pageId (required), title/status/content/elementor_data (optional).
    {
      // Input Schema: Use plain object with Zod types
      pageId: z
        .number()
        .int()
        .positive()
        .describe("The ID of the page to update."),
      title: z.string().optional().describe("The title for the page."),
      status: z
        .enum(["publish", "future", "draft", "pending", "private"])
        .optional()
        .describe("The status for the page (e.g., 'publish', 'draft')."),
      content: z
        .string()
        .optional()
        .describe("The standard WordPress content for the page (optional)."),
      elementor_data: z
        .string()
        .optional()
        .describe(
          "The Elementor page data as a JSON string. Optional for update."
        ),
    },
  • src/index.js:135-180 (registration)
    Registration of the 'update_page' tool on the MCP server using server.tool() with name, description, schema, and handler.
    server.tool(
      "update_page",
      "Updates an existing page in WordPress with Elementor data, it will return a boolean value to indicate if the update was successful.",
      {
        // Input Schema: Use plain object with Zod types
        pageId: z
          .number()
          .int()
          .positive()
          .describe("The ID of the page to update."),
        title: z.string().optional().describe("The title for the page."),
        status: z
          .enum(["publish", "future", "draft", "pending", "private"])
          .optional()
          .describe("The status for the page (e.g., 'publish', 'draft')."),
        content: z
          .string()
          .optional()
          .describe("The standard WordPress content for the page (optional)."),
        elementor_data: z
          .string()
          .optional()
          .describe(
            "The Elementor page data as a JSON string. Optional for update."
          ),
      },
      async (input) => {
        // Handler
        const { pageId, ...updateData } = input;
        // Basic validation, although schema handles optionality
        if (Object.keys(updateData).length === 0) {
          throw new Error(
            "No update data provided (title, status, content, or elementor_data)."
          );
        }
        await updatePage(pageId, updateData);
        return {
          content: [
            {
              type: "text",
              text: "true",
            },
          ],
        };
      }
    );
  • Core helper function updatePage that constructs the payload from input data, validates elementor_data, and performs the PUT-like update via WordPress REST API POST to /pages/{id}.
    async function updatePage(pageId, pageData) {
        const client = getApiClient();
    
        const payload = {};
        if (pageData.title) payload.title = pageData.title;
        if (pageData.status) payload.status = pageData.status;
        if (pageData.content) payload.content = pageData.content; // Use !== undefined to allow setting empty content
    
        if (pageData.elementor_data) {
            if (typeof pageData.elementor_data !== 'string') {
                 throw new Error('elementor_data must be provided as a JSON string.');
            }
             try {
                JSON.parse(pageData.elementor_data); // Basic validation
            } catch (e) {
                throw new Error('elementor_data is not valid JSON string.');
            }
            payload.meta = { _elementor_data: pageData.elementor_data };
        }
    
        if (Object.keys(payload).length === 0) {
            throw new Error("No update data provided.");
        }
    
        // WP uses POST for updates via ID route
        const response = await client.post(`/wp-json/wp/v2/pages/${pageId}`, payload);
        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 the full burden of behavioral disclosure. It mentions the tool returns a boolean success indicator, which is helpful, but fails to disclose critical behavioral traits: whether this is a destructive mutation (likely yes, but not stated), authentication requirements, error handling, rate limits, or what happens to unspecified fields (e.g., are they preserved or reset?). The description is minimal and leaves significant gaps.

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

Conciseness4/5

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

The description is concise and front-loaded, stating the core purpose in the first clause. The second clause adds useful output information. There's no wasted text, though it could be slightly more structured (e.g., separating purpose from behavior).

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 (a mutation tool with 5 parameters, no annotations, and no output schema), the description is incomplete. It lacks behavioral context (e.g., destructiveness, error cases), doesn't explain the relationship with sibling tools, and omits details about the boolean return value (e.g., what constitutes success/failure). For a tool that modifies data, this is inadequate.

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 already documents all parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain interactions between 'content' and 'elementor_data', or default behaviors). With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but doesn't need to.

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 tool's purpose: 'Updates an existing page in WordPress with Elementor data.' It specifies the verb ('Updates'), resource ('an existing page'), and platform context ('WordPress with Elementor data'). However, it doesn't explicitly differentiate from sibling tools like 'update_page_from_file' or 'create_page', which would be needed for a perfect score.

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 siblings like 'update_page_from_file' (for file-based updates) or 'create_page' (for new pages), nor does it specify prerequisites (e.g., requiring an existing page ID). Usage is implied but not explicitly stated.

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

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/aguaitech/Elementor-MCP'

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