Skip to main content
Glama

getPageImages

Extract all images from an Adobe Experience Manager page, including those within Experience Fragments, by providing the page path.

Instructions

Get all images from a page, including those within Experience Fragments

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagePathYes

Implementation Reference

  • Core handler function that fetches the full page JSON structure using .infinity.json endpoint and recursively traverses all nodes to extract image references (fileReference or src properties), collecting path, fileReference, src, alt, and title for each image.
    async getPageImages(pagePath) {
        return safeExecute(async () => {
            const response = await this.httpClient.get(`${pagePath}.infinity.json`);
            const images = [];
            const processNode = (node, nodePath) => {
                if (!node || typeof node !== 'object')
                    return;
                if (node['fileReference'] || node['src']) {
                    images.push({
                        path: nodePath,
                        fileReference: node['fileReference'],
                        src: node['src'],
                        alt: node['alt'] || node['altText'],
                        title: node['jcr:title'] || node['title'],
                    });
                }
                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,
                images,
            }, 'getPageImages');
        }, 'getPageImages');
    }
  • Tool registration in the MCP server tools array, including name, description, and input schema requiring pagePath.
        name: 'getPageImages',
        description: 'Get all images from a page, including those within Experience Fragments',
        inputSchema: {
            type: 'object',
            properties: { pagePath: { type: 'string' } },
            required: ['pagePath'],
        },
    },
  • Dispatch handler in MCPRequestHandler that forwards getPageImages calls to the AEMConnector.
    case 'getPageImages':
        return await this.aemConnector.getPageImages(params.pagePath);
  • MCP server request handler case that extracts pagePath from args and calls aemConnector.getPageImages, returning JSON stringified result.
    case 'getPageImages': {
        const pagePath = args.pagePath;
        const result = await aemConnector.getPageImages(pagePath);
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
  • TypeScript interface definition for the getPageImages method signature and return type ImagesResponse.
    getPageImages(pagePath: string): Promise<ImagesResponse>;
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 what the tool does but doesn't describe how it behaves: for example, it doesn't specify the return format (e.g., list of image URLs or metadata), error handling for invalid paths, permissions required, or whether it's a read-only operation. This leaves significant gaps for an agent to understand the tool's behavior.

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 without unnecessary words. Every part of the sentence contributes directly to understanding the tool's function, making it highly concise and well-structured.

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's complexity (retrieving images from a page, potentially including fragments), lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't address return values, error conditions, or behavioral nuances, leaving the agent with insufficient information to use the tool effectively beyond its basic purpose.

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 input schema has one parameter with 0% description coverage, so the description must compensate. It implies the parameter is a page path but doesn't add details like format (e.g., absolute path), examples, or constraints. This provides minimal semantic value beyond the schema, aligning with the baseline for incomplete coverage.

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 resource ('all images from a page'), including the scope of 'those within Experience Fragments'. It distinguishes from siblings like 'getPageContent' or 'getPageTextContent' by focusing specifically on images. However, it doesn't explicitly contrast with 'scanPageComponents' which might also retrieve images, preventing a perfect score.

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 'scanPageComponents' or 'getPageContent'. It lacks context about prerequisites, such as whether the page must exist or be accessible, and doesn't mention any exclusions or specific scenarios where this tool is preferred.

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