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

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action 'Get text content' but doesn't describe what 'text content' includes (e.g., plain text, formatted text, metadata), how it's retrieved (e.g., from a database, via API), error conditions, or performance aspects like rate limits. This leaves significant gaps for a tool with no annotation coverage.

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, clear sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to scan and understand quickly. Every word earns its place by conveying essential information without redundancy.

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 tool has no annotations, no output schema, and low parameter schema coverage, the description is incomplete. It doesn't cover behavioral traits, parameter details, or return values, which are critical for a tool that retrieves content. This leaves the agent with insufficient information to use the tool effectively beyond basic purpose.

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

Parameters2/5

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

The input schema has 1 parameter with 0% description coverage, and the description doesn't add any semantic details about 'pagePath'. It doesn't explain what 'pagePath' represents (e.g., a URL, file path, identifier), its format, or examples. With low schema coverage, the description fails to compensate, leaving the parameter poorly documented.

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 verb 'Get' and the resource 'text content from a specific page', making the purpose understandable. It distinguishes from siblings like 'getPageContent' (which might return structured content) and 'getAllTextContent' (which might return all text content without page specificity). However, it doesn't explicitly differentiate from 'getNodeContent' or 'searchContent', which could have overlapping functionality.

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. It doesn't mention when to choose this over 'getAllTextContent', 'getPageContent', 'getNodeContent', or 'searchContent', nor does it specify prerequisites like requiring an active page or authentication. The context is implied but not explicit.

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