Skip to main content
Glama
aguaitech

Elementor MCP Server

by aguaitech

create_page

Create a new WordPress page with Elementor data, specifying title, status, content, and required JSON-formatted Elementor data, returning the page ID upon success.

Instructions

Creates a new page in WordPress with Elementor data, it will return the created page ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentNoThe standard WordPress content for the page (optional).
elementor_dataYesThe Elementor page data as a JSON string (required for create).
statusNoThe status for the page (e.g., 'publish', 'draft'). Defaults to 'draft' on create.
titleYesThe title for the new page (required).

Implementation Reference

  • src/index.js:34-70 (registration)
    MCP tool registration for 'create_page', including description, input schema, and handler function that delegates to wp-api createPage.
    server.tool(
      "create_page",
      "Creates a new page in WordPress with Elementor data, it will return the created page ID.",
      {
        // Input Schema: Use plain object with Zod types
        title: z.string().describe("The title for the new page (required)."),
        status: z
          .enum(["publish", "future", "draft", "pending", "private"])
          .optional()
          .describe(
            "The status for the page (e.g., 'publish', 'draft'). Defaults to 'draft' on create."
          ),
        content: z
          .string()
          .optional()
          .describe("The standard WordPress content for the page (optional)."),
        elementor_data: z
          .string()
          .describe(
            "The Elementor page data as a JSON string (required for create)."
          ),
      },
      async (input) => {
        // Handler function
        const newPage = await createPage(input);
        // Return the result object directly
        return {
          content: [
            {
              type: "text",
              text: `${newPage.id}`,
            },
          ],
        };
        // Errors thrown here will be handled by McpServer
      }
    );
  • MCP tool handler for create_page: calls createPage from wp-api and returns the new page ID as text content.
    async (input) => {
      // Handler function
      const newPage = await createPage(input);
      // Return the result object directly
      return {
        content: [
          {
            type: "text",
            text: `${newPage.id}`,
          },
        ],
      };
      // Errors thrown here will be handled by McpServer
    }
  • Zod input schema for create_page tool defining parameters: title (required), status, content, elementor_data (JSON string).
      // Input Schema: Use plain object with Zod types
      title: z.string().describe("The title for the new page (required)."),
      status: z
        .enum(["publish", "future", "draft", "pending", "private"])
        .optional()
        .describe(
          "The status for the page (e.g., 'publish', 'draft'). Defaults to 'draft' on create."
        ),
      content: z
        .string()
        .optional()
        .describe("The standard WordPress content for the page (optional)."),
      elementor_data: z
        .string()
        .describe(
          "The Elementor page data as a JSON string (required for create)."
        ),
    },
  • Core helper function createPage that performs the WordPress REST API POST to /wp/v2/pages with Elementor meta data, including validation.
    async function createPage(pageData) {
        const client = getApiClient();
        // Ensure Elementor data is properly nested under meta
        const payload = {
            title: pageData.title,
            status: pageData.status || 'draft', // Default to draft
            content: pageData.content || '', // Optional standard content
            meta: {
                _elementor_data: pageData.elementor_data // MUST be a JSON string
            }
            // Add other WP fields as needed (e.g., template, author, etc.)
        };
    
        // Validate elementor_data is a string
        if (typeof payload.meta._elementor_data !== 'string') {
            throw new Error('elementor_data must be provided as a JSON string.');
        }
        try {
            JSON.parse(payload.meta._elementor_data); // Basic validation it's parsable JSON
        } catch (e) {
            throw new Error('elementor_data is not valid JSON string.');
        }
    
    
        const response = await client.post('/wp-json/wp/v2/pages', payload);
        return response.data; // Return the created page object
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool creates a page and returns an ID, but lacks details on permissions needed, error handling, rate limits, or what happens if 'content' is omitted. For a mutation tool with zero annotation coverage, this is insufficient.

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 a single, efficient sentence that front-loads the core purpose. However, it could be more structured by separating the action from the return value, but it avoids unnecessary verbosity.

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 this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't cover error cases, authentication needs, or the format of the returned ID. For a tool that modifies data, more context is needed to ensure safe and correct usage.

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 parameters. The description adds no additional semantic context beyond what's in the schema (e.g., it doesn't explain the relationship between 'content' and 'elementor_data'). Baseline 3 is appropriate when 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 action ('Creates a new page') and specifies the platform ('WordPress with Elementor data'), which distinguishes it from generic page creation tools. However, it doesn't explicitly differentiate from sibling tools like 'update_page' or 'create' operations in other contexts, missing specific sibling differentiation.

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 like 'update_page' or 'create' methods in other systems. It mentions that 'elementor_data' is required for create, but this is redundant with the schema and doesn't help choose between sibling tools.

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