Skip to main content
Glama
Decodo

Decodo MCP Server

tiktok_shop_search

Read-only

Search TikTok Shop products by keyword to retrieve scraped results with automatic parsing. Supports geolocation, country code, and device emulation for targeted queries.

Instructions

Scrape TikTok Shop Search results with automatic parsing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for TikTok Shop products
geoNoGeolocation of the desired request, expressed as a country name
jsRenderNoShould the request be opened in a headless browser, false by default
countryNoCountry code for the request (e.g., US, GB, DE)
deviceTypeNoDevice type to emulate for the request

Implementation Reference

  • TiktokShopSearchTool class that implements the tool logic. The register() method (lines 21-58) contains the handler which calls sapiClient.scrape() with target 'tiktok_shop_search', then transforms the response by removing high-char-count fields ('suggested', 'refinements') from the nested data.
    export class TiktokShopSearchTool extends Tool {
      toolset = TOOLSET.ECOMMERCE;
    
      private static FIELDS_WITH_HIGH_CHAR_COUNT = ['suggested', 'refinements'];
    
      transformResponse = ({ data }: { data: object }) => {
        for (const fieldToRemove of TiktokShopSearchTool.FIELDS_WITH_HIGH_CHAR_COUNT) {
          data = removeKeyFromNestedObject({ obj: data, keyToRemove: fieldToRemove });
        }
    
        return { data: JSON.stringify(data) };
      };
    
      register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
        server.registerTool(
          'tiktok_shop_search',
          {
            description: 'Scrape TikTok Shop Search results with automatic parsing',
            inputSchema: {
              query: z.string().describe('Search query for TikTok Shop products'),
              geo: zodGeo,
              jsRender: zodJsRender,
              country: zodCountry,
              deviceType: zodDeviceType,
            },
            annotations: {
              readOnlyHint: true,
              openWorldHint: true,
            },
          },
          async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
            const params = {
              ...scrapingParams,
              target: SCRAPER_API_TARGETS.TIKTOK_SHOP_SEARCH,
              markdown: 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 defining parameters: query (string), geo, jsRender, country, deviceType. Uses Zod validation with reusable zod types.
    description: 'Scrape TikTok Shop Search results with automatic parsing',
    inputSchema: {
      query: z.string().describe('Search query for TikTok Shop products'),
      geo: zodGeo,
      jsRender: zodJsRender,
      country: zodCountry,
      deviceType: zodDeviceType,
    },
  • Tool instantiation in the allTools static array on the ScraperAPIBaseServer class, which is then registered via tool.register() in registerAllTools() or registerTools().
    new TiktokShopSearchTool(),
  • Import statement for TiktokShopSearchTool in the server file.
    TiktokShopSearchTool,
  • The SCRAPER_API_TARGETS enum value TIKTOK_SHOP_SEARCH = 'tiktok_shop_search', used as the target parameter in the scraper API call.
    TIKTOK_SHOP_SEARCH = 'tiktok_shop_search',
Behavior2/5

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

Annotations declare readOnlyHint and openWorldHint, but the description only adds 'automatic parsing', which is vague. It does not disclose behavior like rate limits, pagination, error handling, or data freshness, leaving agents without critical operational context.

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

Conciseness4/5

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

The description is very brief, using a single sentence that directly states the tool's function. It is front-loaded and without filler, though slightly terse.

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?

With no output schema and 5 parameters, the description is insufficient. It does not explain the return format, how parameters like geo or deviceType affect results, or any behavioral details beyond 'automatic parsing', leaving significant gaps for an AI agent.

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% with all parameters described. The description adds no additional meaning beyond the schema, so it meets the baseline of 3 but does not enhance parameter understanding.

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 indicates the tool scrapes TikTok Shop Search results with automatic parsing, specifying the action and resource. However, it does not differentiate from sibling tools like tiktok_shop_product or tiktok_shop_url, missing a chance to clarify its unique role.

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 such as tiktok_shop_product or other search tools. No when-not-to-use or prerequisite information is given.

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