Skip to main content
Glama

tiktok_get_subtitle

Retrieve subtitles or content for any TikTok video URL. Optionally specify language code; defaults to automatic speech recognition.

Instructions

Get the subtitle (content) for a TikTok video url.This is used for getting the subtitle, content or context for a TikTok video.Supports TikTok video url as input and optionally language code from tool 'AVAILABLE_SUBTITLES'Returns the subtitle for the video in the requested language and format.If no language code is provided, the tool will return the subtitle of automatic speech recognition.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tiktok_urlYesTikTok video URL, e.g., https://www.tiktok.com/@username/video/1234567890 or https://vm.tiktok.com/1234567890
language_codeNoLanguage code for the subtitle, e.g., en for English, es for Spanish, fr for French, etc.

Implementation Reference

  • The performGetSubtitle function is the core handler that calls the TikNeuron API to fetch the subtitle content for a TikTok video. It takes tiktok_url and optional language_code, sends a fetch request to https://tikneuron.com/api/mcp/get-subtitles, and returns the subtitle_content.
    async function performGetSubtitle(tiktok_url: string, language_code: string) {
        const url = new URL('https://tikneuron.com/api/mcp/get-subtitles');
        url.searchParams.set('tiktok_url', tiktok_url);
    
        if (language_code){
            url.searchParams.set('language_code', language_code);
        }
    
        const response = await fetch(url, {
            headers: {
                'Accept': 'application/json',
                'Accept-Encoding': 'gzip',
                'MCP-API-KEY': TIKNEURON_MCP_API_KEY,
            }
        });
    
        if (!response.ok) {
            throw new Error(`TikNeuron API error: ${response.status} ${response.statusText}\n${await response.text()}`);
        }
    
        const data = await response.json() as Subtitle;
    
        return data.subtitle_content || 'No subtitle available';
    }
  • The GET_SUBTITLE Tool definition providing name 'tiktok_get_subtitle', description, and inputSchema which requires tiktok_url (string) and optionally language_code (string).
    const GET_SUBTITLE: Tool = {
        name: "tiktok_get_subtitle",
        description:
            "Get the subtitle (content) for a TikTok video url." +
            "This is used for getting the subtitle, content or context for a TikTok video." +
            "Supports TikTok video url as input and optionally language code from tool 'AVAILABLE_SUBTITLES'" +
            "Returns the subtitle for the video in the requested language and format." +
            "If no language code is provided, the tool will return the subtitle of automatic speech recognition.",
        inputSchema: {
            type: "object",
            properties: {
                tiktok_url: {
                    type: "string",
                    description: "TikTok video URL, e.g., https://www.tiktok.com/@username/video/1234567890 or https://vm.tiktok.com/1234567890",
                },
                language_code: {
                    type: "string",
                    description: "Language code for the subtitle, e.g., en for English, es for Spanish, fr for French, etc.",
                },
            },
            required: ["tiktok_url"]
        }
    };
  • The isGetSubtitleArgs type guard function validates that the input arguments match the expected shape (object with tiktok_url string).
    function isGetSubtitleArgs(args: unknown): args is { tiktok_url: string, language_code: string } {
        return (
            typeof args === "object" &&
            args !== null &&
            "tiktok_url" in args &&
            typeof (args as { tiktok_url: string }).tiktok_url === "string"
        );
    }
  • The Subtitle interface defines the response shape from the API, including subtitle_content field which holds the actual subtitle text.
    interface Subtitle {
        success?: boolean;
        subtitles?: Array<{
            language?: string;
            source?: string;
        }>;
        subtitle_content?: string;
    }
  • index.ts:249-251 (registration)
    Registration of the tool in the ListToolsRequestSchema handler, adding GET_SUBTITLE to the list of available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
        tools: [AVAILABLE_SUBTITLES, GET_SUBTITLE, GET_POST_DETAILS],
    }));
  • index.ts:276-287 (registration)
    The case handler in the CallToolRequestSchema switch statement that dispatches to performGetSubtitle when the tool name is 'tiktok_get_subtitle'.
    case "tiktok_get_subtitle": {
        if (!isGetSubtitleArgs(args)) {
            throw new Error("Invalid arguments for tiktok_get_subtitle");
        }
        const { tiktok_url, language_code } = args;
    
        const results = await performGetSubtitle(tiktok_url, language_code);
        return {
            content: [{ type: "text", text: results }],
            isError: false,
        };
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the default behavior (returns automatic speech recognition subtitle when no language code is provided) but does not mention error handling, response format details, or performance characteristics.

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

Conciseness3/5

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

The description is somewhat repetitive ('Get the subtitle ... This is used for getting the subtitle, content or context') and contains a typo ('AVAILABLE_SUBTITLES'). It could be more concise and better formatted with proper spacing.

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?

For a simple tool with 2 parameters and no output schema or annotations, the description covers basic behavior and default. However, it omits details about the output format and any limitations, leaving some uncertainty about the return structure.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds value by specifying that the language code should come from the 'AVAILABLE_SUBTITLES' tool and explains the default when omitted. This gives meaningful context beyond the schema.

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 that the tool gets the subtitle for a TikTok video URL, mentioning input and optional language code. It references the sibling tool 'AVAILABLE_SUBTITLES' (likely tiktok_available_subtitles) for obtaining language codes, which helps differentiate from siblings like tiktok_get_post_details. However, it could be more explicit about the exact output format.

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?

The description implies a workflow by mentioning the language code from 'AVAILABLE_SUBTITLES', but does not explicitly state when to use this tool vs alternatives. It lacks clear guidance on prerequisites or exclusion conditions.

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

Install Server

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/davibauer/tiktok-mcp'

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