Skip to main content
Glama

get_page

Retrieve a specific WordPress page and its Elementor metadata using the page ID for targeted content access and management.

Instructions

Retrieves a specific page from WordPress by its ID, including meta fields like _elementor_data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageIdYesThe ID of the page to retrieve.

Implementation Reference

  • The handler function for the 'get_page' tool, which retrieves page data using the getPage helper and returns it as a JSON string in the MCP content format.
    async (input) => { // Handler const pageData = await getPage(input.pageId); return { content: [ { type: "text", text: JSON.stringify(pageData), }, ], }; }
  • Input schema for the 'get_page' tool using Zod, validating pageId as a positive integer.
    { // Input Schema pageId: z .number() .int() .positive() .describe("The ID of the page to retrieve."), },
  • src/index.js:72-95 (registration)
    Full registration of the 'get_page' MCP tool using server.tool(), including name, description, input schema, and handler function.
    server.tool( "get_page", "Retrieves a specific page from WordPress by its ID, including meta fields like _elementor_data.", { // Input Schema pageId: z .number() .int() .positive() .describe("The ID of the page to retrieve."), }, async (input) => { // Handler const pageData = await getPage(input.pageId); return { content: [ { type: "text", text: JSON.stringify(pageData), }, ], }; } );
  • Helper function getPage that performs the actual WordPress REST API GET request for a page by ID in edit context to include meta fields like _elementor_data.
    async function getPage(pageId) { const client = getApiClient(); // Use context=edit to potentially get more fields like meta const response = await client.get(`/wp-json/wp/v2/pages/${pageId}?context=edit`); return response.data; }

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