Skip to main content
Glama

get_asr_task

Read-only

Check the progress of a transcription task by polling its status. Returns queued, downloading, transcribing, finalizing, done (with full transcript and timestamps), or failed. Free to use with 3-5 second polling interval.

Instructions

Poll the status of an ASR task created by transcribe_video. Returns one of queued, downloading, transcribing, finalizing, done, or failed. When status is done, includes the full transcript with timestamps. Recommended polling interval: 3-5 seconds. Free — does not consume credits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesTask ID returned by transcribe_video.

Implementation Reference

  • Tool schema/registration for 'get_asr_task' — defines the tool name, description, annotations (ASR_POLL: readOnly, non-idempotent, not openWorld), and inputSchema requiring a 'task_id' string. This is the inline registration of the tool in the TOOLS array.
      name: "get_asr_task",
      description:
        "Poll the status of an ASR task created by transcribe_video. Returns one of `queued`, `downloading`, `transcribing`, `finalizing`, `done`, or `failed`. When status is `done`, includes the full transcript with timestamps. Recommended polling interval: 3-5 seconds. Free — does not consume credits.",
      annotations: { title: "Get ASR Task Status", ...ANN.ASR_POLL },
      inputSchema: {
        type: "object",
        properties: {
          task_id: {
            type: "string",
            description: "Task ID returned by transcribe_video.",
            minLength: 1,
          },
        },
        required: ["task_id"],
      },
    },
  • Generic handler that proxies ALL tool calls (including get_asr_task) to the upstream MCP server via callUpstream(). The CallToolRequestSchema handler forwards request.params.name (the tool name) and request.params.arguments to the upstream URL with a Bearer token.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
    
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        return await callUpstream(
          request.params.name,
          request.params.arguments || {}
        );
      } catch (err) {
        return {
          content: [{ type: "text", text: err.message || String(err) }],
          isError: true,
        };
      }
    });
  • The callUpstream function — the actual helper that forwards tool calls to https://api.subdownload.com/mcp via JSON-RPC. It sends the tool name and arguments as a 'tools/call' request with the API key as a Bearer token, then returns the result or throws on error.
    async function callUpstream(name, args) {
      if (!API_KEY) {
        throw new Error(
          "SUBDOWNLOAD_API_KEY env var is not set. Get one at https://subdownload.com/account, then run with -e SUBDOWNLOAD_API_KEY=<your-key>."
        );
      }
      const res = await fetch(UPSTREAM_URL, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Accept: "application/json, text/event-stream",
          Authorization: `Bearer ${API_KEY}`,
        },
        body: JSON.stringify({
          jsonrpc: "2.0",
          id: Date.now(),
          method: "tools/call",
          params: { name, arguments: args },
        }),
      });
      const text = await res.text();
      let body;
      try {
        body = JSON.parse(text);
      } catch {
        throw new Error(
          `Upstream returned non-JSON response (HTTP ${res.status}): ${text.slice(0, 200)}`
        );
      }
      if (body.error) {
        throw new Error(body.error.message || JSON.stringify(body.error));
      }
      return body.result;
    }
  • src/index.js:443-446 (registration)
    MCP Server instantiation and tool capability declaration — creates the Server with name 'subdownload' and version '1.0.0', declaring the 'tools' capability so the SDK handles tool-related requests.
    const server = new Server(
      { name: "subdownload", version: "1.0.0" },
      { capabilities: { tools: {} } }
    );
  • Sibling tool 'transcribe_video' which creates the ASR tasks that get_asr_task polls. Important context: transcribe_video returns task_id, and get_asr_task accepts that task_id to poll for results.
      name: "transcribe_video",
      description:
        "Start an asynchronous AI ASR (Whisper) transcription of a YouTube video. Returns immediately with a task_id and estimated_wait_seconds; the actual transcription runs in the background. Poll status with get_asr_task. Use this when fetch_transcript returned NO_CAPTIONS or when the video has no captions. Costs 5 credits, debited only on successful completion.",
      annotations: { title: "Transcribe YouTube Video (Async)", ...ANN.ASR_START },
      inputSchema: {
        type: "object",
        properties: {
          video_url: {
            type: "string",
            description:
              "YouTube URL (watch, youtu.be, shorts, or embed form). Full URL preferred.",
            minLength: 5,
          },
          lang: {
            type: "string",
            description:
              "Optional language hint (ISO 639-1, e.g. 'en', 'zh'). Omit to auto-detect.",
          },
        },
        required: ["video_url"],
      },
    },
Behavior5/5

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

Adds behavioral details beyond annotations: specifics of status values, transcript inclusion on 'done', polling recommendation, and cost info.

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?

Three concise, front-loaded sentences with no redundancy.

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

Completeness5/5

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

For a polling tool with no output schema, description fully explains return values, statuses, and usage context.

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 covers the single parameter fully with description linking to transcribe_video. Description does not add further semantic detail beyond that.

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?

Description clearly states the tool polls ASR task status, lists possible statuses, and distinguishes from transcribe_video which creates the task.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly ties to transcribe_video, recommends polling interval of 3-5 seconds, and notes it's free (no credit consumption).

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/SubDownload/subdownload-mcp'

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