{"record":{"id":"7d5b80d16c69ec22","repo":"remotion-dev/remotion","slug":"zoom-must-be-a-finite-number-between-0-and-1","errorCode":null,"errorMessage":"zoom must be a finite number between 0 and 1.","messagePattern":"zoom must be a finite number between 0 and 1\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/WebMcp.tsx","lineNumber":1660,"sourceCode":"\t\t\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\t\t\tminimum: 0,\n\t\t\t\t\t\t\t\tmaximum: 1,\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'The normalized timeline zoom, from 0 (fully zoomed out) to 1 (maximum zoom).',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\trequired: ['zoom'],\n\t\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\t},\n\t\t\t\t\tannotations: {readOnlyHint: false},\n\t\t\t\t\texecute: ({zoom}) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof zoom !== 'number' ||\n\t\t\t\t\t\t\t!Number.isFinite(zoom) ||\n\t\t\t\t\t\t\tzoom < 0 ||\n\t\t\t\t\t\t\tzoom > 1\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error('zoom must be a finite number between 0 and 1.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst compositionId = currentCompositionRef.current;\n\t\t\t\t\t\tif (compositionId === null) {\n\t\t\t\t\t\t\tthrow new Error('No composition is currently selected.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst durationInFrames = getCurrentDuration();\n\t\t\t\t\t\tif (durationInFrames <= 1) {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t'The current composition is a still and has no timeline zoom.',\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst timelineViewportWidth =\n\t\t\t\t\t\t\tscrollableRef.current?.clientWidth ?? 0;\n\t\t\t\t\t\tconst minZoom = getTimelineMinZoom({\n\t\t\t\t\t\t\tdurationInFrames,","sourceCodeStart":1642,"sourceCodeEnd":1678,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/components/WebMcp.tsx#L1642-L1678","documentation":"The timeline zoom MCP tool requires zoom to be a finite number in [0, 1], where 1 is fully zoomed out. Values outside that range, NaN, or non-numbers throw.","triggerScenarios":"Passing zoom as a percentage (e.g. 50 or 150), a string, or a negative number.","commonSituations":"Clients interpreting zoom as a percent (0-100) instead of the normalized 0-1 scale.","solutions":["Divide percentage values by 100 before passing","Pass a number between 0 and 1"],"exampleFix":"// before\n{\"zoom\": 50}\n// after\n{\"zoom\": 0.5}","handlingStrategy":"validation","validationCode":"if (typeof zoom !== 'number' || !Number.isFinite(zoom) || zoom < 0 || zoom > 1) throw new Error('zoom must be in [0,1]');","typeGuard":"const isValidZoom = (v: unknown): v is number => typeof v === 'number' && Number.isFinite(v) && v >= 0 && v <= 1;","tryCatchPattern":null,"preventionTips":["Treat zoom as a normalized 0-1 value, not a percentage"],"tags":["mcp","validation","timeline-zoom"],"backgroundTag":"value-out-of-range","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-08-28T15:39:09.316Z","contentChangedAt":"2026-08-28T15:39:09.316Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}