{"record":{"id":"ba22c52bc7fa62dd","repo":"BoundaryML/baml","slug":"missing-parameter-name","errorCode":null,"errorMessage":"missing parameter: {name}","messagePattern":"missing parameter: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/async_vm_runtime.rs","lineNumber":253,"sourceCode":"        // VM. Imagine this in Python:\n        //\n        // asyncio.gather(b.FnA(), b.FnB())\n        //\n        // Those function calls are not sharing the same VM obviously. So we\n        // instantiate a new one for each function call.\n        //\n        // TODO: This is expensive for big programs, figure out how to share\n        // compiler produced objects betweeen VMs. We know they are read only.\n        let mut vm = Vm::new(self.program.clone(), env_vars.clone());\n\n        // TODO: We can't assume ordering of `params` is correct, figure out why.\n        let args = match expr_fn\n            .elem\n            .inputs()\n            .iter()\n            .map(|(name, _)| {\n                let Some(param) = params.get(name) else {\n                    anyhow::bail!(\"missing parameter: {name}\");\n                };\n\n                try_vm_value_from_baml_value(\n                    &mut vm,\n                    &self.program.resolved_class_names,\n                    &self.program.resolved_enums_names,\n                    param,\n                )\n                .context(\"failed to convert baml argument to vm value\")\n            })\n            .collect::<Result<Vec<_>, _>>()\n            .context(\"failed to convert baml args to vm values\")\n        {\n            Ok(args) => args,\n            Err(e) => return (Err(e), current_call_id),\n        };\n\n        vm.set_entry_point(*function_index, &args);","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/async_vm_runtime.rs#L235-L271","documentation":"Runtime argument validation in the async VM bridge: while binding a function call's arguments to the function's declared parameters, a declared parameter named {name} had no corresponding entry in the supplied params map. The VM cannot synthesize a default (or none is declared), so the call is rejected before execution starts.","triggerScenarios":"call_function on an expr fn where params lacks a key matching one of expr_fn.elem.inputs() names.","commonSituations":"Omitting optional-looking arguments that are actually required, param name mismatches (snake_case vs camelCase), or partial arg maps built dynamically.","solutions":["Provide a value for every parameter declared by the function.","Match parameter names exactly as declared in the .baml function signature.","Inspect the function's inputs() and validate your args map before calling."],"exampleFix":"// before\nvm.call_function(\"Score\", { \"text\": txt })\n// after\nvm.call_function(\"Score\", { \"text\": txt, \"threshold\": 0.5 })","handlingStrategy":"validation","validationCode":"for (const [name] of exprFn.elem.inputs()) {\n  if (!(name in params)) {\n    throw new Error(`missing parameter: ${name}`);\n  }\n}","typeGuard":null,"tryCatchPattern":"match vm.call_function(name, params).await {\n    Ok(v) => v,\n    Err(e) if e.to_string().starts_with(\"missing parameter\") => {\n        eprintln!(\"{e}; declared inputs: {:?}\", expr_fn.elem.inputs());\n        Default::default()\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Build call args from the function's declared input list, not by hand.","Watch for casing mismatches between caller language and BAML parameter names."],"tags":["runtime","arguments","validation","baml"],"backgroundTag":"missing-required-argument","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}