BoundaryML/baml · error

missing parameter: {name}

Error message

missing parameter: {name}

What it means

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.

Source

Thrown at engine/baml-runtime/src/async_vm_runtime.rs:253

        // VM. Imagine this in Python:
        //
        // asyncio.gather(b.FnA(), b.FnB())
        //
        // Those function calls are not sharing the same VM obviously. So we
        // instantiate a new one for each function call.
        //
        // TODO: This is expensive for big programs, figure out how to share
        // compiler produced objects betweeen VMs. We know they are read only.
        let mut vm = Vm::new(self.program.clone(), env_vars.clone());

        // TODO: We can't assume ordering of `params` is correct, figure out why.
        let args = match expr_fn
            .elem
            .inputs()
            .iter()
            .map(|(name, _)| {
                let Some(param) = params.get(name) else {
                    anyhow::bail!("missing parameter: {name}");
                };

                try_vm_value_from_baml_value(
                    &mut vm,
                    &self.program.resolved_class_names,
                    &self.program.resolved_enums_names,
                    param,
                )
                .context("failed to convert baml argument to vm value")
            })
            .collect::<Result<Vec<_>, _>>()
            .context("failed to convert baml args to vm values")
        {
            Ok(args) => args,
            Err(e) => return (Err(e), current_call_id),
        };

        vm.set_entry_point(*function_index, &args);

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Provide a value for every parameter declared by the function.
  2. Match parameter names exactly as declared in the .baml function signature.
  3. Inspect the function's inputs() and validate your args map before calling.

Example fix

// before
vm.call_function("Score", { "text": txt })
// after
vm.call_function("Score", { "text": txt, "threshold": 0.5 })
Defensive patterns

Strategy: validation

Validate before calling

for (const [name] of exprFn.elem.inputs()) {
  if (!(name in params)) {
    throw new Error(`missing parameter: ${name}`);
  }
}

Try / catch

match vm.call_function(name, params).await {
    Ok(v) => v,
    Err(e) if e.to_string().starts_with("missing parameter") => {
        eprintln!("{e}; declared inputs: {:?}", expr_fn.elem.inputs());
        Default::default()
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: call_function on an expr fn where params lacks a key matching one of expr_fn.elem.inputs() names.

Common situations: Omitting optional-looking arguments that are actually required, param name mismatches (snake_case vs camelCase), or partial arg maps built dynamically.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/ba22c52bc7fa62dd. Report an issue: GitHub.