Skip to main content
Glama
Decodo

Decodo MCP Server

amazon_bestsellers

Read-only

Scrape Amazon bestseller lists by category and domain, with automatic parsing and pagination support. Customize device type and page number for targeted results.

Instructions

Scrape Amazon Bestsellers list with automatic parsing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesAmazon category (e.g., "mobile-apps", "electronics")
domainNoAmazon domain (e.g., amazon.com, amazon.co.uk)
deviceTypeNoDevice type to emulate for the request
pageFromNoStarting page number for pagination

Implementation Reference

  • The AmazonBestsellersTool class that registers and implements the 'amazon_bestsellers' MCP tool. The handler function builds scraping params with the AMAZON_BESTSELLERS target, calls sapiClient.scrape(), and returns the data as text content.
    export class AmazonBestsellersTool extends Tool {
      toolset = TOOLSET.ECOMMERCE;
    
      transformResponse = ({ data }: { data: object }) => {
        return { data: JSON.stringify(data) };
      };
    
      register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
        server.registerTool(
          'amazon_bestsellers',
          {
            description: 'Scrape Amazon Bestsellers list with automatic parsing',
            inputSchema: {
              query: z.string().describe('Amazon category (e.g., "mobile-apps", "electronics")'),
              domain: zodDomain,
              deviceType: zodDeviceType,
              pageFrom: zodPageFrom,
            },
            annotations: {
              readOnlyHint: true,
              openWorldHint: true,
            },
          },
          async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
            const params = {
              ...scrapingParams,
              target: SCRAPER_API_TARGETS.AMAZON_BESTSELLERS,
              parse: true,
            } satisfies ScraperAPIParams;
    
            const { data } = await sapiClient.scrape<object>({ auth, scrapingParams: params, extra });
    
            return {
              content: [
                {
                  type: 'text',
                  text: JSON.stringify(data),
                },
              ],
            };
          }
        );
      };
    }
  • Input schema for the amazon_bestsellers tool: query (required string), domain (optional string), deviceType (optional), pageFrom (optional number).
    inputSchema: {
      query: z.string().describe('Amazon category (e.g., "mobile-apps", "electronics")'),
      domain: zodDomain,
      deviceType: zodDeviceType,
      pageFrom: zodPageFrom,
    },
  • Zod schema definitions for optional inputs: domain (Amazon domain) and pageFrom (pagination start page).
    const zodDomain = z
      .string()
      .describe('Amazon domain (e.g., amazon.com, amazon.co.uk)')
      .optional();
    
    const zodPageFrom = z
      .number()
      .describe('Starting page number for pagination')
      .optional();
  • Registration: AmazonBestsellersTool is instantiated in the allTools array (line 78) and registered via registerAllTools() or registerTools() which calls tool.register() on it.
    registerAllTools() {
      for (const tool of ScraperAPIBaseServer.allTools) {
        tool.register({ server: this.server, sapiClient: this.sapiClient, auth: this.auth });
      }
    }
  • The SCRAPER_API_TARGETS.AMAZON_BESTSELLERS constant used as the target value when making the scraping API call.
    AMAZON_BESTSELLERS = 'amazon_bestsellers',
Behavior3/5

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

Annotations already indicate readOnlyHint and openWorldHint, so the safe read operation is clear. The description adds 'automatic parsing' but lacks details on pagination or output format.

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 with no unnecessary words. Front-loaded with action and resource.

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

Completeness3/5

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

Adequate for a simple scraping tool, but could mention that it returns a parsed list of bestsellers or provide an example. No output schema, so return format is unclear.

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?

Schema coverage is 100%, so the schema fully documents parameters. The description adds no extra parameter context beyond the schema definitions.

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 it scrapes the Amazon Bestsellers list with automatic parsing, distinguishing it from sibling tools like amazon_search and amazon_product which focus on general search or specific products.

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?

No guidance on when to use this tool versus alternatives like amazon_search or amazon_pricing. No exclusions or context provided.

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