Skip to main content
Glama
Decodo

Decodo MCP Server

tiktok_post

Read-only

Scrapes a TikTok post URL to extract structured data including engagement metrics, captions, and hashtags.

Instructions

Scrape a TikTok post URL for structured data such as engagement, captions, and hashtags

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesTikTok post URL, e.g. https://www.tiktok.com/@user/video/1234567890
xhrNoWhen true, includes XHR/fetch responses in the scrape result where supported by the target

Implementation Reference

  • The TiktokPostTool class with the register method containing the full handler logic. It registers the 'tiktok_post' tool which takes a TikTok post URL and optional xhr parameter, calls the ScraperAPI client with target 'tiktok_post', and returns scraped data as text content.
    register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
      server.registerTool(
        'tiktok_post',
        {
          description:
            'Scrape a TikTok post URL for structured data such as engagement, captions, and hashtags',
          inputSchema: {
            url: z
              .string()
              .describe('TikTok post URL, e.g. https://www.tiktok.com/@user/video/1234567890'),
            xhr: zodXhr,
          },
          annotations: {
            readOnlyHint: true,
            openWorldHint: true,
          },
        },
        async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
          const params = {
            ...scrapingParams,
            target: SCRAPER_API_TARGETS.TIKTOK_POST,
          } 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 tiktok_post tool: requires a 'url' string and optional 'xhr' boolean, with read-only and open-world annotations.
      inputSchema: {
        url: z
          .string()
          .describe('TikTok post URL, e.g. https://www.tiktok.com/@user/video/1234567890'),
        xhr: zodXhr,
      },
      annotations: {
        readOnlyHint: true,
        openWorldHint: true,
      },
    },
  • TiktokPostTool is instantiated as part of the allTools array (line 83) and registered via the registerAllTools method or registerTools method in the server.
    registerAllTools() {
      for (const tool of ScraperAPIBaseServer.allTools) {
        tool.register({ server: this.server, sapiClient: this.sapiClient, auth: this.auth });
      }
    }
  • The toolset is SOCIAL_MEDIA, which controls which toolsets filter the tool is included in.
    import { ProgressExtra } from '../../utils';
    
    export class TiktokPostTool extends Tool {
      toolset = TOOLSET.SOCIAL_MEDIA;
  • The SCRAPER_API_TARGETS constant that maps 'tiktok_post' to the target used in the scraping request.
      TIKTOK_POST = 'tiktok_post',
      TIKTOK_SHOP_SEARCH = 'tiktok_shop_search',
      TIKTOK_SHOP_PRODUCT = 'tiktok_shop_product',
      TIKTOK_SHOP_URL = 'tiktok',
    
      YOUTUBE_VIDEO = 'youtube_video',
      YOUTUBE_METADATA = 'youtube_metadata',
      YOUTUBE_CHANNEL = 'youtube_channel',
      YOUTUBE_SUBTITLES = 'youtube_subtitles',
      YOUTUBE_SEARCH = 'youtube_search',
    
      REDDIT_POST = 'reddit_post',
      REDDIT_SUBREDDIT = 'reddit_subreddit',
      REDDIT_USER = 'reddit_user',
    
      BING_SEARCH = 'bing_search',
    
      CHATGPT = 'chatgpt',
      PERPLEXITY = 'perplexity',
    }
Behavior3/5

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

Annotations already provide readOnlyHint and openWorldHint, which the description does not contradict. The description adds minimal behavioral context beyond the core scrape action, missing details like auth needs or error handling.

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 front-loads the action and key outputs. No unnecessary words, highly efficient.

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

Completeness4/5

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

Given no output schema, the description mentions key outputs (engagement, captions, hashtags). Annotations cover readOnly and openWorld. Lacks details on rate limits or error scenarios, but adequate for a simple scraping tool.

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 covers all parameters with descriptions (100% coverage). The tool description does not add new semantics for parameters, so baseline score 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?

The description clearly states the tool scrapes a TikTok post URL for structured data like engagement, captions, and hashtags. It distinguishes from sibling tools that target other platforms or specific TikTok shop functions.

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?

No explicit guidance on when to use vs. alternatives. While sibling names imply context, the description does not state when not to use or mention alternative tools.

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