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
| Name | Required | Description | Default |
|---|---|---|---|
| pagePath | Yes |
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');
- src/mcp-server.ts:116-124 (registration)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'], }, },
- src/mcp-server.ts:634-638 (handler)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) }] }; }
- dist/interfaces/index.d.ts:560-569 (schema)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; }>; };
- src/mcp-handler.ts:29-30 (handler)Alternative handler dispatch in MCPRequestHandler that calls AEM connector.case 'getAllTextContent': return await this.aemConnector.getAllTextContent(params.pagePath);