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
| Name | Required | Description | Default |
|---|---|---|---|
| pagePath | Yes |
Implementation Reference
- dist/mcp-server.js:116-123 (registration)Tool registration including name, description, and input schema for getPageTextContentname: 'getPageTextContent', description: 'Get text content from a specific page', inputSchema: { type: 'object', properties: { pagePath: { type: 'string' } }, required: ['pagePath'], }, },
- dist/mcp-server.js:627-631 (handler)MCP server tool handler that extracts pagePath argument and delegates to AEMConnector.getPageTextContentcase 'getPageTextContent': { const pagePath = args.pagePath; const result = await aemConnector.getPageTextContent(pagePath); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- dist/aem-connector-new.js:94-96 (handler)AEMConnector wrapper method delegating getPageTextContent to PageOperationsasync getPageTextContent(pagePath) { return this.pageOps.getPageTextContent(pagePath); }
- PageOperations.getPageTextContent alias delegating to getAllTextContentasync 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'); }