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);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves text content but doesn't mention whether it's read-only, safe, requires permissions, handles errors, or returns structured data. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. Every word contributes to understanding what the tool does without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations, no output schema, and 0% schema description coverage, the description is incomplete. It doesn't explain what 'all text content' means in practice, how it's structured, or any limitations, which is inadequate for a tool with potential complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description doesn't add any parameter-specific information beyond what the input schema provides (a single 'pagePath' parameter). With 0% schema description coverage, the baseline is low, but since there's only one parameter and its purpose is implied by the tool name, the description doesn't compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get all text content') and resource ('from a page'), specifying what content types are included (titles, text components, descriptions). However, it doesn't differentiate from sibling tools like 'getPageTextContent' or 'getPageContent', which appear to serve similar purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'getPageTextContent' or 'getPageContent' from the sibling list. It lacks context about prerequisites, exclusions, or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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