Skip to main content
Glama

extract_subtitles

Extracts subtitles from YouTube or Bilibili videos, returning text with or without timestamps. Supports language selection and authentication for restricted videos.

Instructions

从视频 URL 提取字幕。 支持平台:YouTube、Bilibili 返回:完整字幕文本,包含时间戳

认证配置(按优先级):

  1. cookies_file 参数

  2. YT_DLP_COOKIES 环境变量

  3. 浏览器 cookies(仅本地环境)

参数:

  • url: 视频链接 (必填)

  • lang: 首选字幕语言,如 'zh', 'en', 'ja' (可选,默认自动检测)

  • format: 输出格式 'text' (纯文本) 或 'srt' (带时间戳) (可选,默认 'srt')

  • cookies_file: cookies 文件路径,用于认证需要登录的视频 (可选)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes视频 URL (YouTube 或 Bilibili)
langNo首选字幕语言代码,如 zh, en, jazh
formatNo输出格式:text (纯文本) 或 srt (带时间戳)srt
cookies_fileNocookies 文件路径,用于认证需要登录的视频
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses supported platforms, return type (complete subtitle text with timestamps), and authentication fallback hierarchy. It does not mention error handling or rate limits, but sufficiently covers expected behavior for a read operation.

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 well-structured with clear sections (purpose, platforms, return, authentication, parameters), front-loaded with the main action, and no extraneous information.

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 adequately explains return values and formatting. It covers input parameters, authentication, and supported platforms. Lacks edge-case handling but is complete for typical use.

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?

Despite 100% schema coverage, the description adds value by explicitly stating defaults (lang: auto-detect, format: 'srt') and providing authentication priority context for 'cookies_file'. This goes beyond the schema's parameter descriptions.

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 '从视频 URL 提取字幕' (extract subtitles from video URL), specifying supported platforms (YouTube, Bilibili) and distinguishing this tool from siblings like 'list_available_subtitles' and 'search_timestamp' by focusing on actual extraction.

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 provides authentication configuration priorities, offering some usage context, but does not explicitly state when to use this tool versus siblings (e.g., when to use 'list_available_subtitles' instead). No direct comparison to 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/hgao1604/subtitle-analyzer-mcp'

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