Skip to main content
Glama
Decodo

Decodo MCP Server

tiktok_shop_url

Read-only

Scrape TikTok Shop pages by URL to extract product data. Optionally render with a headless browser for dynamic content.

Instructions

Scrape TikTok Shop page by URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesTikTok Shop URL (e.g., "https://www.tiktok.com/shop/s?q=HEADPHONES")
jsRenderNoShould the request be opened in a headless browser, false by default

Implementation Reference

  • The TiktokShopUrlTool class contains the handler logic. The register method defines the tool name 'tiktok_shop_url', input schema (url, jsRender), and the async handler that calls sapiClient.scrape with target SCRAPER_API_TARGETS.TIKTOK_SHOP_URL.
    export class TiktokShopUrlTool extends Tool {
      toolset = TOOLSET.ECOMMERCE;
    
      transformResponse = ({ data }: { data: object }) => {
        return { data: JSON.stringify(data) };
      };
    
      register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
        server.registerTool(
          'tiktok_shop_url',
          {
            description: 'Scrape TikTok Shop page by URL',
            inputSchema: {
              url: z.string().describe('TikTok Shop URL (e.g., "https://www.tiktok.com/shop/s?q=HEADPHONES")'),
              jsRender: zodJsRender,
            },
            annotations: {
              readOnlyHint: true,
              openWorldHint: true,
            },
          },
          async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
            const params = {
              ...scrapingParams,
              target: SCRAPER_API_TARGETS.TIKTOK_SHOP_URL,
            } satisfies ScraperAPIParams;
    
            const { data } = await sapiClient.scrape<object>({ auth, scrapingParams: params, extra });
    
            return {
              content: [
                {
                  type: 'text',
                  text: JSON.stringify(data),
                },
              ],
            };
          }
        );
      };
    }
  • Input schema for the tool: url (string with example TikTok Shop URL) and jsRender (optional boolean from zodJsRender).
    {
      description: 'Scrape TikTok Shop page by URL',
      inputSchema: {
        url: z.string().describe('TikTok Shop URL (e.g., "https://www.tiktok.com/shop/s?q=HEADPHONES")'),
        jsRender: zodJsRender,
      },
      annotations: {
        readOnlyHint: true,
        openWorldHint: true,
      },
    },
  • The register method registers the tool name 'tiktok_shop_url' with the MCP server via server.registerTool().
    register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
      server.registerTool(
        'tiktok_shop_url',
        {
          description: 'Scrape TikTok Shop page by URL',
          inputSchema: {
            url: z.string().describe('TikTok Shop URL (e.g., "https://www.tiktok.com/shop/s?q=HEADPHONES")'),
            jsRender: zodJsRender,
          },
          annotations: {
            readOnlyHint: true,
            openWorldHint: true,
          },
        },
        async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
          const params = {
            ...scrapingParams,
            target: SCRAPER_API_TARGETS.TIKTOK_SHOP_URL,
          } satisfies ScraperAPIParams;
    
          const { data } = await sapiClient.scrape<object>({ auth, scrapingParams: params, extra });
    
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(data),
              },
            ],
          };
        }
      );
    };
  • TiktokShopUrlTool is imported and instantiated at line 86 in the allTools array, then registered when the server starts via registerTools/registerAllTools.
      TiktokShopUrlTool,
      WalmartSearchTool,
      WalmartProductTool,
      YoutubeMetadataTool,
      YoutubeChannelTool,
      YoutubeSubtitlesTool,
      YoutubeSearchTool,
      ScrapeAsMarkdownTool,
      ScreenshotTool,
    } from '../tools';
    import { Tool } from '../tools/tool';
    import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
    import { TOOLSET } from '../constants';
    
    export class ScraperAPIBaseServer {
      server: McpServer;
    
      sapiClient: ScraperApiClient;
    
      auth: string = '';
    
      constructor({ auth, toolsets = [] }: { auth: string; toolsets: TOOLSET[] }) {
        this.server = new McpServer({
          name: 'decodo',
          version: PACKAGE_VERSION,
        });
        this.sapiClient = new ScraperApiClient({});
    
        this.auth = auth;
    
        this.registerTools({ toolsets });
    
        this.registerResources();
      }
    
      connect(transport: StdioServerTransport | StreamableHTTPServerTransport) {
        this.server.connect(transport);
      }
    
      static allTools: Tool[] = [
        new ScrapeAsMarkdownTool(),
        new ScreenshotTool(),
        new GoogleSearchTool(),
        new GoogleAdsTool(),
        new GoogleLensTool(),
        new GoogleAiModeTool(),
        new GoogleTravelHotelsTool(),
        new AmazonSearchTool(),
        new AmazonProductTool(),
        new AmazonPricingTool(),
        new AmazonSellersTool(),
        new AmazonBestsellersTool(),
        new WalmartSearchTool(),
        new WalmartProductTool(),
        new TargetSearchTool(),
        new TargetProductTool(),
        new TiktokPostTool(),
        new TiktokShopSearchTool(),
        new TiktokShopProductTool(),
        new TiktokShopUrlTool(),
        new YoutubeMetadataTool(),
        new YoutubeChannelTool(),
        new YoutubeSubtitlesTool(),
        new YoutubeSearchTool(),
        new RedditPostTool(),
        new RedditSubredditTool(),
        new RedditUserTool(),
        new BingSearchTool(),
        new ChatGPTTool(),
        new PerplexityTool(),
      ];
  • The zodJsRender schema used as an optional input parameter for the tool.
    export const zodJsRender = z
      .boolean()
      .describe('Should the request be opened in a headless browser, false by default')
      .optional();
Behavior3/5

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

Annotations already provide readOnlyHint and openWorldHint. The description adds no additional behavioral details (e.g., headless browser usage via jsRender parameter, rate limits). Adequate but not enhanced.

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?

Single sentence, no redundant phrasing. Efficiently conveys the core purpose without extraneous text.

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?

Lacks output format details (e.g., raw HTML, structured data). For a scraping tool without an output schema, this omission reduces completeness given the presence of similar sibling tools.

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% and descriptions are clear (URL with example, jsRender with default). The tool description does not add extra parameter meaning beyond the schema, meeting the baseline.

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 specifies a clear action ('Scrape') and resource ('TikTok Shop page by URL'). It distinguishes from siblings like tiktok_shop_product and tiktok_shop_search, which have different scopes.

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. No context for when scraping a page URL is appropriate vs. using product or search endpoints.

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