Skip to main content
Glama
Decodo

Decodo MCP Server

amazon_product

Read-only

Scrape Amazon product pages by ASIN with automatic parsing. Supports custom domain, device type, geolocation, and headless browser rendering.

Instructions

Scrape Amazon Product page with automatic parsing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesAmazon product ASIN (e.g., "B09H74FXNW")
jsRenderNoShould the request be opened in a headless browser, false by default
domainNoAmazon domain (e.g., amazon.com, amazon.co.uk)
deviceTypeNoDevice type to emulate for the request
geoNoAmazon geo location (e.g., 10001 for US ZIP code)

Implementation Reference

  • The AmazonProductTool class extends Tool. The register() method (lines 31-69) defines the handler that scrapes an Amazon product page using the Scraper API with 'amazon_product' target, parses the response, and strips high-character-count fields (bullet_points, description) via transformResponse.
    export class AmazonProductTool extends Tool {
      toolset = TOOLSET.ECOMMERCE;
    
      private static FIELDS_WITH_HIGH_CHAR_COUNT = ['bullet_points', 'description'];
    
      transformResponse = ({ data }: { data: object }) => {
        for (const fieldToRemove of AmazonProductTool.FIELDS_WITH_HIGH_CHAR_COUNT) {
          data = removeKeyFromNestedObject({ obj: data, keyToRemove: fieldToRemove });
        }
    
        return { data: JSON.stringify(data) };
      };
    
      register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
        server.registerTool(
          'amazon_product',
          {
            description: 'Scrape Amazon Product page with automatic parsing',
            inputSchema: {
              query: z.string().describe('Amazon product ASIN (e.g., "B09H74FXNW")'),
              jsRender: zodJsRender,
              domain: zodDomain,
              deviceType: zodDeviceType,
              geo: zodGeo,
            },
            annotations: {
              readOnlyHint: true,
              openWorldHint: true,
            },
          },
          async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
            const params = {
              ...scrapingParams,
              target: SCRAPER_API_TARGETS.AMAZON_PRODUCT,
              parse: true,
            } satisfies ScraperAPIParams;
    
            const { data } = await sapiClient.scrape<object>({ auth, scrapingParams: params, extra });
    
            const { data: text } = this.transformResponse({ data });
    
            return {
              content: [
                {
                  type: 'text',
                  text,
                },
              ],
            };
          }
        );
      };
    }
  • Input schema for the amazon_product tool, defining 'query' (ASIN string required), and optional fields: 'jsRender', 'domain', 'deviceType', and 'geo'.
    inputSchema: {
      query: z.string().describe('Amazon product ASIN (e.g., "B09H74FXNW")'),
      jsRender: zodJsRender,
      domain: zodDomain,
      deviceType: zodDeviceType,
      geo: zodGeo,
    },
  • The AmazonProductTool is instantiated and added to the allTools array in ScraperAPIBaseServer (line 75), which triggers its registration with the MCP server.
    new AmazonProductTool(),
  • removeKeyFromNestedObject helper function used to recursively strip specified keys (e.g., 'bullet_points', 'description') from the scraped data object.
    export const removeKeyFromNestedObject = ({
      obj,
      keyToRemove,
    }: {
      obj: object;
      keyToRemove: string;
    }): object => {
      if (typeof obj !== 'object' || obj === null) {
        return obj;
      }
    
      if (Array.isArray(obj)) {
        return obj.map(item => removeKeyFromNestedObject({ obj: item, keyToRemove }));
      }
    
      const record = obj as Record<string, unknown>;
      const newObj: Record<string, unknown> = {};
    
      for (const key in record) {
        if (key === keyToRemove) {
          continue;
        }
    
        newObj[key] = removeKeyFromNestedObject({ obj: record[key] as object, keyToRemove });
      }
    
      return newObj;
    };
  • The register() method calls server.registerTool('amazon_product', ...) to register the tool name 'amazon_product' with the MCP server.
    register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
      server.registerTool(
        'amazon_product',
Behavior3/5

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

Annotations already indicate read-only (readOnlyHint=true) and open-world (openWorldHint=true). Description adds 'automatic parsing' but does not disclose potential rate limits, authentication needs, or response format. With annotations covering some safety, description provides minimal extra behavioral context.

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?

Single sentence, no redundancy, front-loaded with purpose. Every word adds value.

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?

Tool has 5 parameters and no output schema. Description does not explain what the parsed output contains (e.g., title, price, rating). For a scraping tool with automatic parsing, users would benefit from knowing the returned data structure. Incomplete for the 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?

Input schema has 100% description coverage for all 5 parameters (query, jsRender, domain, deviceType, geo), so description does not need to add parameter details. Description mentions no specific parameter meanings beyond schema; baseline of 3 is appropriate.

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

Purpose5/5

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

Description clearly states 'Scrape Amazon Product page with automatic parsing', which is a specific verb ('scrape') and resource ('Amazon Product page'). It distinguishes from sibling tools like amazon_search (search) and amazon_pricing (pricing) by focusing on a single product page.

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

Usage Guidelines3/5

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

Description implies usage for scraping a product page via ASIN, but does not provide explicit when-to-use or alternatives. Given many sibling Amazon tools, guidance like 'Use for detailed product info; for search use amazon_search' would be helpful.

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

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/Decodo/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server