{"record":{"id":"2de4397bfeecf7f6","repo":"remotion-dev/remotion","slug":"task-must-be-transcribe-or-translate","errorCode":null,"errorMessage":"task must be transcribe or translate.","messagePattern":"task must be transcribe or translate\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/WebMcp.tsx","lineNumber":526,"sourceCode":"\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst whisper = await import('@remotion/whisper-webgpu');\n\t\t\t\t\t\tconst modelName = input.model ?? 'small.en';\n\t\t\t\t\t\tif (typeof modelName !== 'string') {\n\t\t\t\t\t\t\tthrow new Error('model must be a string.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst model = whisper\n\t\t\t\t\t\t\t.getAvailableModels()\n\t\t\t\t\t\t\t.find((candidate) => candidate.name === modelName);\n\t\t\t\t\t\tif (!model) {\n\t\t\t\t\t\t\tthrow new Error(`Unknown Whisper model: ${modelName}.`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst task = input.task ?? 'transcribe';\n\t\t\t\t\t\tif (task !== 'transcribe' && task !== 'translate') {\n\t\t\t\t\t\t\tthrow new Error('task must be transcribe or translate.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (task === 'translate' && !model.supportsTranslation) {\n\t\t\t\t\t\t\tthrow new Error(`${model.name} does not support translation.`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst language = input.language ?? 'en';\n\t\t\t\t\t\tif (typeof language !== 'string' || language.length === 0) {\n\t\t\t\t\t\t\tthrow new Error('language must be a non-empty string.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst chunkLengthInSeconds = input.chunkLengthInSeconds ?? 30;\n\t\t\t\t\t\tconst strideLengthInSeconds = input.strideLengthInSeconds ?? 5;\n\t\t\t\t\t\tconst temperature = input.temperature ?? 1;\n\t\t\t\t\t\tconst topK = input.topK ?? 50;\n\t\t\t\t\t\tconst repetitionPenalty = input.repetitionPenalty ?? 1;\n\t\t\t\t\t\tconst noRepeatNgramSize = input.noRepeatNgramSize ?? 0;\n\t\t\t\t\t\tif (","sourceCodeStart":508,"sourceCodeEnd":544,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/components/WebMcp.tsx#L508-L544","documentation":"Validation inside the WebMcp transcription tool. The Whisper task parameter (defaulting to 'transcribe') only accepts the literal values 'transcribe' or 'translate'; any other input value passed via the MCP tool call is rejected before a model is loaded. This is an input-validation guard on the caller-supplied task field.","triggerScenarios":"Passing input.task as anything other than the two allowed strings, e.g. \"Transcribe\", \"translation\", \"subtitle\", or a non-string value.","commonSituations":"Confusing OpenAI Whisper CLI task vocabulary with this API; using a synonym like \"translate-to-english\"; case errors.","solutions":["Omit input.task entirely to get the default \"transcribe\"","Set input.task to exactly \"transcribe\"","Set input.task to exactly \"translate\" (only for models with supportsTranslation)"],"exampleFix":"// before\n{ \"task\": \"Translate\" }\n// after\n{ \"task\": \"translate\" }","handlingStrategy":"validation","validationCode":"const TASKS = ['transcribe', 'translate'];\nif (input.task !== undefined && !TASKS.includes(input.task)) {\n  throw new Error(`task must be one of ${TASKS.join(', ')}`);\n}","typeGuard":"const isWhisperTask = (v: unknown): v is 'transcribe' | 'translate' =>\n  v === 'transcribe' || v === 'translate';","tryCatchPattern":"try {\n  await callWhisperTool({ task: input.task });\n} catch (err) {\n  if (err instanceof Error && err.message === 'task must be transcribe or translate.') {\n    input.task = 'transcribe'; // fall back to default\n  }\n}","preventionTips":["Omit the field when you want the default 'transcribe'","Keep a constant whitelist of valid tasks in client code","Validate lowercase spelling before sending"],"tags":["validation","whisper","mcp"],"backgroundTag":"invalid-enum-value","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}