{"record":{"id":"ec694ae0952cd94f","repo":"remotion-dev/remotion","slug":"position-must-be-a-finite-number","errorCode":null,"errorMessage":"position must be a finite number.","messagePattern":"position must be a finite number\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/WebMcp.tsx","lineNumber":1409,"sourceCode":"\t\t\t\t\t\t\tposition: {\n\t\t\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'The guide position in composition pixels. Vertical guides use an x-coordinate and horizontal guides use a y-coordinate.',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\trequired: ['orientation', 'position'],\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: ({orientation, position}) => {\n\t\t\t\t\t\tif (orientation !== 'horizontal' && orientation !== 'vertical') {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t'orientation must be either \"horizontal\" or \"vertical\".',\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (typeof position !== 'number' || !Number.isFinite(position)) {\n\t\t\t\t\t\t\tthrow new Error('position must be a finite number.');\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 guide: Guide = {\n\t\t\t\t\t\t\tid: crypto.randomUUID(),\n\t\t\t\t\t\t\torientation,\n\t\t\t\t\t\t\tposition,\n\t\t\t\t\t\t\tshow: true,\n\t\t\t\t\t\t\tcompositionId,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst nextGuides = [...guidesListRef.current, guide];\n\t\t\t\t\t\tguidesListRef.current = nextGuides;\n\t\t\t\t\t\tsetGuidesList(() => nextGuides);\n\t\t\t\t\t\tpersistGuidesList(nextGuides);","sourceCodeStart":1391,"sourceCodeEnd":1427,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/components/WebMcp.tsx#L1391-L1427","documentation":"The add-guide MCP tool requires position to be a finite number (not NaN, Infinity, or a non-number).","triggerScenarios":"Passing position as a string (\"100\"), null, NaN, or Infinity in the add-guide tool call.","commonSituations":"JSON tool calls from LLM clients that quote numbers or pass non-finite math results.","solutions":["Pass a plain finite JSON number for position"],"exampleFix":"// before\n{\"orientation\": \"vertical\", \"position\": \"50%\"}\n// after\n{\"orientation\": \"vertical\", \"position\": 540}","handlingStrategy":"validation","validationCode":"if (typeof position !== 'number' || !Number.isFinite(position)) throw new Error('bad position');","typeGuard":"const isFiniteNumber = (v: unknown): v is number => typeof v === 'number' && Number.isFinite(v);","tryCatchPattern":null,"preventionTips":["Never quote numeric JSON arguments","Compute positions with plain arithmetic, avoiding NaN/Infinity"],"tags":["mcp","validation","guides"],"backgroundTag":"invalid-argument-value","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-08-28T15:39:09.316Z","contentChangedAt":"2026-08-28T15:39:09.316Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}