Skip to main content
Glama

getAllTextContent

Extract all text content from an Adobe Experience Manager page, including titles, text components, and descriptions, by providing the page path.

Instructions

Get all text content from a page including titles, text components, and descriptions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagePathYes

Implementation Reference

  • Core handler function that fetches page content via .infinity.json and recursively extracts all text, titles, and descriptions from the page structure.
    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');
  • MCP tool registration defining the tool name, description, and input schema (pagePath: string).
    { name: 'getAllTextContent', description: 'Get all text content from a page including titles, text components, and descriptions', inputSchema: { type: 'object', properties: { pagePath: { type: 'string' } }, required: ['pagePath'], }, },
  • MCP server dispatch handler that extracts pagePath from tool arguments and calls the AEM connector method.
    case 'getAllTextContent': { const pagePath = (args as { pagePath: string }).pagePath; const result = await aemConnector.getAllTextContent(pagePath); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • TypeScript interface defining the output schema for getAllTextContent response.
    export interface TextContentResponse extends BaseResponse { data: { pagePath: string; textContent: Array<{ path: string; title?: string; text?: string; description?: string; }>; };
  • Alternative handler dispatch in MCPRequestHandler that calls AEM connector.
    case 'getAllTextContent': return await this.aemConnector.getAllTextContent(params.pagePath);

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