Skip to main content
Glama

tiktok_available_subtitles

Retrieve available subtitles for a TikTok video by URL. Output includes languages and formats like ASR, machine translation, or creator captions.

Instructions

Looks up the available subtitle, i.e., content for a TikTok video.This is used for looking up if there is any content (subtitle) available to a TikTok video.Supports TikTok video url as input in objectReturns the available subtitle for the video which can be in different languages and differentformats like Automatic Speech Recognition, Machine Translation or Creator Captionsand different languages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tiktok_urlYesTikTok video URL, e.g., https://www.tiktok.com/@username/video/1234567890 or https://vm.tiktok.com/1234567890

Implementation Reference

  • Tool definition (schema) for tiktok_available_subtitles including name, description, and inputSchema requiring tiktok_url
    const AVAILABLE_SUBTITLES: Tool = {
        name: "tiktok_available_subtitles",
        description:
            "Looks up the available subtitle, i.e., content for a TikTok video." +
            "This is used for looking up if there is any content (subtitle) available to a TikTok video." +
            "Supports TikTok video url as input in object" +
            "Returns the available subtitle for the video which can be in different languages and different" +
            "formats like Automatic Speech Recognition, Machine Translation or Creator Captions" +
            "and different languages.",
        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",
                },
            },
            required: ["tiktok_url"],
        },
    };
  • Handler case in CallToolRequestSchema that dispatches tiktok_available_subtitles, validates args using isAvailableSubtitleArgs, and calls performAvailableSubtitle
    case "tiktok_available_subtitles": {
    
        if (!isAvailableSubtitleArgs(args)) {
            throw new Error("Invalid arguments for tiktok_available_subtitles");
        }
        const { tiktok_url } = args;
    
        const results = await performAvailableSubtitle(tiktok_url);
        return {
            content: [{ type: "text", text: results }],
            isError: false,
        };
    }
  • Core business logic: performAvailableSubtitle function that calls the TikNeuron API to fetch available subtitles and formats the result
    async function performAvailableSubtitle(tiktok_url: string) {
        const url = new URL('https://tikneuron.com/api/mcp/available-subtitles');
        url.searchParams.set('tiktok_url', tiktok_url);
    
        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 AvailableSubtitle;
    
    
        return data.subtitles?.map(subtitle => {
            return `Language: ${subtitle.language}\nSource: ${subtitle.source}`;
        }).join('\n\n') || 'No subtitles available';
    }
  • Type guard function isAvailableSubtitleArgs that validates the arguments object has a required tiktok_url string property
    function isAvailableSubtitleArgs(args: unknown): args is { tiktok_url: string } {
        return (
            typeof args === "object" &&
            args !== null &&
            "tiktok_url" in args &&
            typeof (args as { tiktok_url: string }).tiktok_url === "string"
        );
    }
  • index.ts:249-251 (registration)
    Tool registration: AVAILABLE_SUBTITLES is listed in the tools array returned by ListToolsRequestSchema handler
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
        tools: [AVAILABLE_SUBTITLES, GET_SUBTITLE, GET_POST_DETAILS],
    }));
Behavior2/5

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

No annotations provided. The description fails to clarify whether the operation is read-only, requires authentication, or any rate limits. It implies returning subtitle data but doesn't disclose the full behavior.

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

Conciseness2/5

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

The description is verbose and repetitive, restating the same idea multiple times. It could be condensed into a single clear sentence.

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?

Without an output schema, the description should clearly explain the return value structure. It only mentions 'different languages and formats' but lacks specificity, leaving ambiguity about the response.

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 a clear description for 'tiktok_url'. The tool description adds no additional semantic value beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states it 'Looks up the available subtitle' but also says 'Returns the available subtitle', creating ambiguity about whether it checks availability or retrieves content. With sibling 'tiktok_get_subtitle', the exact purpose is unclear.

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 mentions 'looking up if there is any content available' but does not explicitly contrast with siblings or specify when to use this tool instead of alternatives.

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