remotion-dev/remotion · error
task must be transcribe or translate.
Error message
task must be transcribe or translate.
What it means
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.
Source
Thrown at packages/studio/src/components/WebMcp.tsx:526
);
}
const whisper = await import('@remotion/whisper-webgpu');
const modelName = input.model ?? 'small.en';
if (typeof modelName !== 'string') {
throw new Error('model must be a string.');
}
const model = whisper
.getAvailableModels()
.find((candidate) => candidate.name === modelName);
if (!model) {
throw new Error(`Unknown Whisper model: ${modelName}.`);
}
const task = input.task ?? 'transcribe';
if (task !== 'transcribe' && task !== 'translate') {
throw new Error('task must be transcribe or translate.');
}
if (task === 'translate' && !model.supportsTranslation) {
throw new Error(`${model.name} does not support translation.`);
}
const language = input.language ?? 'en';
if (typeof language !== 'string' || language.length === 0) {
throw new Error('language must be a non-empty string.');
}
const chunkLengthInSeconds = input.chunkLengthInSeconds ?? 30;
const strideLengthInSeconds = input.strideLengthInSeconds ?? 5;
const temperature = input.temperature ?? 1;
const topK = input.topK ?? 50;
const repetitionPenalty = input.repetitionPenalty ?? 1;
const noRepeatNgramSize = input.noRepeatNgramSize ?? 0;
if (View on GitHub (pinned to b2f4e34732)
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)
Example fix
// before
{ "task": "Translate" }
// after
{ "task": "translate" } Defensive patterns
Strategy: validation
Validate before calling
const TASKS = ['transcribe', 'translate'];
if (input.task !== undefined && !TASKS.includes(input.task)) {
throw new Error(`task must be one of ${TASKS.join(', ')}`);
} Type guard
const isWhisperTask = (v: unknown): v is 'transcribe' | 'translate' => v === 'transcribe' || v === 'translate';
Try / catch
try {
await callWhisperTool({ task: input.task });
} catch (err) {
if (err instanceof Error && err.message === 'task must be transcribe or translate.') {
input.task = 'transcribe'; // fall back to default
}
} Prevention
- Omit the field when you want the default 'transcribe'
- Keep a constant whitelist of valid tasks in client code
- Validate lowercase spelling before sending
When it happens
Trigger: Passing input.task as anything other than the two allowed strings, e.g. "Transcribe", "translation", "subtitle", or a non-string value.
Common situations: Confusing OpenAI Whisper CLI task vocabulary with this API; using a synonym like "translate-to-english"; case errors.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Unknown Whisper model: ${modelName}.
- Invalid whisper model ${model}. Available: ${models.join(',
- The artifact filename ${artifact.filename} was emitted more
- Non-semantic version provided. Only releases of Whisper.cpp
- Composition ${compositionName} not found.
AI-assisted analysis of remotion-dev/remotion@b2f4e34732 (2026-09-09).
Data as JSON: /api/errors/2de4397bfeecf7f6.
Report an issue: GitHub.