{"record":{"id":"829354d373a5538e","repo":"remotion-dev/remotion","slug":"version-must-be-an-exact-semantic-version","errorCode":null,"errorMessage":"version must be an exact semantic version.","messagePattern":"version must be an exact semantic version\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/WebMcp.tsx","lineNumber":419,"sourceCode":"\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: async ({packageName, version}) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof packageName !== 'string' ||\n\t\t\t\t\t\t\t!isValidPackageName(packageName)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error('packageName must be a valid npm package name.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tversion !== undefined &&\n\t\t\t\t\t\t\t(typeof version !== 'string' ||\n\t\t\t\t\t\t\t\t!/^[0-9]+\\.[0-9]+\\.[0-9]+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/.test(\n\t\t\t\t\t\t\t\t\tversion,\n\t\t\t\t\t\t\t\t))\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error('version must be an exact semantic version.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tawait installPackages([\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: packageName,\n\t\t\t\t\t\t\t\tversion: typeof version === 'string' ? version : null,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]);\n\t\t\t\t\t\tmarkOptionalPackageInstalled(packageName);\n\t\t\t\t\t\treturn {installed: true, packageName};\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{signal: controller.signal},\n\t\t\t),\n\t\t\tmodelContext.registerTool(\n\t\t\t\t{\n\t\t\t\t\tname: 'transcribe_asset',\n\t\t\t\t\ttitle: 'Transcribe Studio asset',","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/components/WebMcp.tsx#L401-L437","documentation":"The WebMcp install tool accepts an optional version but requires an exact semver (major.minor.patch, optionally with prerelease/build). Ranges like ^5.0.0 or latest are rejected because installations must be reproducible.","triggerScenarios":"Calling the install tool with version set to a range ('^4.0.0', '~5.x', '>1.0.0'), a tag ('latest'), or a non-string value.","commonSituations":"Agents copying package.json range syntax; users asking for 'latest'; typos like '5.0' missing the patch segment.","solutions":["Pass an exact version string, e.g. '4.0.249'.","Look up the exact latest version via `npm view <pkg> version` and use that.","Omit the version argument entirely to install without pinning.","Format as major.minor.patch (prerelease suffixes allowed, e.g. '4.0.0-rc.1')."],"exampleFix":"// before\nawait tool.execute({packageName: 'remotion', version: '^4.0.0'});\n// after\nawait tool.execute({packageName: 'remotion', version: '4.0.249'});","handlingStrategy":"validation","validationCode":"const EXACT_SEMVER = /^[0-9]+\\.[0-9]+\\.[0-9]+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/;\nif (version !== undefined && !(typeof version === 'string' && EXACT_SEMVER.test(version))) {\n  throw new Error('version must be an exact semver like 4.0.249');\n}","typeGuard":"const isExactSemver = (v: unknown): v is string =>\n  typeof v === 'string' && /^[0-9]+\\.[0-9]+\\.[0-9]+(-[0-9A-Za-z.-]+)?(\\+[0-9A-Za-z.-]+)?$/.test(v);","tryCatchPattern":"try {\n  await installTool({packageName, version});\n} catch (e) {\n  if (e.message.includes('exact semantic version')) {\n    version = await npmViewVersion(packageName);\n  }\n}","preventionTips":["Resolve ranges/tags to exact versions via `npm view <pkg> version`.","Omit version rather than passing 'latest'.","Use full x.y.z, never x.y."],"tags":["mcp","npm","semver","validation"],"backgroundTag":"invalid-argument-format","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}