get_asr_task
Poll the status of an automatic speech recognition task and retrieve the transcript with timestamps when processing completes. Returns status values: queued, downloading, transcribing, finalizing, done, or failed.
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
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | Task ID returned by transcribe_video. |
Implementation Reference
- src/index.js:172-188 (schema)Schema definition for the 'get_asr_task' tool. Declares the tool name, description, annotations (using ANN.ASR_POLL), and inputSchema with a required 'task_id' string parameter. This tells the MCP client what parameters the tool accepts.
{ 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"], }, }, - src/index.js:443-448 (registration)Registration of all tools (including get_asr_task) in the MCP server via the TOOLS array. The ListToolsRequestSchema handler returns the TOOLS array containing the get_asr_task schema definition.
const server = new Server( { name: "subdownload", version: "1.0.0" }, { capabilities: { tools: {} } } ); server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS })); - src/index.js:450-462 (handler)Handler for tool calls. The CallToolRequestSchema handler forwards any tool call (including 'get_asr_task') to the upstream SubDownload API via callUpstream, passing the tool name and arguments as-is. There is no local implementation — this is a proxy that delegates to https://api.subdownload.com/mcp.
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, }; } }); - src/index.js:408-441 (helper)The callUpstream helper function that executes the actual logic. It sends a JSON-RPC tools/call request with the tool name and arguments to the upstream SubDownload MCP endpoint, authenticating with the Bearer token from SUBDOWNLOAD_API_KEY.
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:49-55 (helper)Annotation hints (ANN.ASR_POLL) used by get_asr_task. Marks the tool as readOnlyHint=true (safe to call), idempotentHint=false (status changes over time), and openWorldHint=false (hits own backend only).
// ASR poll — hits our backend only, status changes over time ASR_POLL: { readOnlyHint: true, destructiveHint: false, idempotentHint: false, openWorldHint: false, },