Skip to main content
Glama

getPageTextContent

Extracts text content from a specific page in Adobe Experience Manager (AEM) using the AEM MCP Server. Ideal for content analysis, automation, and integration workflows.

Instructions

Get text content from a specific page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagePathYes

Implementation Reference

  • Tool registration including name, description, and input schema for getPageTextContent
    name: 'getPageTextContent', description: 'Get text content from a specific page', inputSchema: { type: 'object', properties: { pagePath: { type: 'string' } }, required: ['pagePath'], }, },
  • MCP server tool handler that extracts pagePath argument and delegates to AEMConnector.getPageTextContent
    case 'getPageTextContent': { const pagePath = args.pagePath; const result = await aemConnector.getPageTextContent(pagePath); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • AEMConnector wrapper method delegating getPageTextContent to PageOperations
    async getPageTextContent(pagePath) { return this.pageOps.getPageTextContent(pagePath); }
  • PageOperations.getPageTextContent alias delegating to getAllTextContent
    async getPageTextContent(pagePath) { return this.getAllTextContent(pagePath); }
  • Core implementation in PageOperations.getAllTextContent: fetches page .infinity.json and recursively extracts all text content from nodes (titles, text, descriptions)
    async getAllTextContent(pagePath) { return safeExecute(async () => { const response = await this.httpClient.get(`${pagePath}.infinity.json`); const textContent = []; const processNode = (node, nodePath) => { if (!node || typeof node !== 'object') return; if (node['text'] || node['jcr:title'] || node['jcr:description']) { textContent.push({ path: nodePath, title: node['jcr:title'], text: node['text'], description: node['jcr:description'], }); } Object.entries(node).forEach(([key, value]) => { if (typeof value === 'object' && value !== null && !key.startsWith('rep:') && !key.startsWith('oak:')) { const childPath = nodePath ? `${nodePath}/${key}` : key; processNode(value, childPath); } }); }; if (response.data['jcr:content']) { processNode(response.data['jcr:content'], 'jcr:content'); } else { processNode(response.data, pagePath); } return createSuccessResponse({ pagePath, textContent, }, 'getAllTextContent'); }, 'getAllTextContent'); }

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/indrasishbanerjee/aem-mcp-server'

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