Skip to main content
Glama

getPageTextContent

Extract text content from Adobe Experience Manager pages to retrieve and analyze textual information for content management and automation workflows.

Instructions

Get text content from a specific page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagePathYes

Implementation Reference

  • Primary MCP tool handler for getPageTextContent. Extracts pagePath from tool arguments, calls AEMConnector.getPageTextContent, and returns the JSON-stringified result as MCP content response.
    case 'getPageTextContent': { const pagePath = (args as { pagePath: string }).pagePath; const result = await aemConnector.getPageTextContent(pagePath); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
  • MCP tool registration including name, description, and input schema requiring 'pagePath' string parameter.
    name: 'getPageTextContent', description: 'Get text content from a specific page', inputSchema: { type: 'object', properties: { pagePath: { type: 'string' } }, required: ['pagePath'], },
  • Core implementation logic for extracting text content. Fetches page .infinity.json, recursively processes nodes for text, jcr:title, jcr:description fields, and returns structured TextContentResponse.
    async getAllTextContent(pagePath: string): Promise<TextContentResponse> { return safeExecute<TextContentResponse>(async () => { const response = await this.httpClient.get(`${pagePath}.infinity.json`); const textContent: Array<{ path: string; title?: string; text?: string; description?: string; }> = []; const processNode = (node: any, nodePath: string) => { 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') as TextContentResponse; }, 'getAllTextContent'); }
  • Alias method in PageOperations that delegates getPageTextContent to getAllTextContent.
    async getPageTextContent(pagePath: string): Promise<TextContentResponse> { return this.getAllTextContent(pagePath); }
  • Delegation method in AEMConnector that forwards getPageTextContent call to the pageOps (PageOperations) module.
    async getPageTextContent(pagePath: string) { return this.pageOps.getPageTextContent(pagePath); }
  • TypeScript interface defining the expected response structure for getPageTextContent, including pagePath and array of text content items with path, title, text, description.
    export interface TextContentResponse extends BaseResponse { data: { pagePath: string; textContent: Array<{ path: string; title?: string; text?: string; description?: string; }>; }; }

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