BoundaryML/baml · error · BridgeError

Missing argument '{parameter}' for function '{function}'

Error message

Missing argument '{parameter}' for function '{function}'

What it means

BridgeError::MissingArgument names both the function and the missing parameter. The bridge validated the supplied arguments against the BAML function's signature and found a required parameter with no corresponding value. It is a pre-execution argument-count validation failure.

Source

Thrown at baml_language/crates/bridge_cffi/src/error.rs:31

    #[error("Project not initialized")]
    ProjectNotInitialized,

    #[error("Engine lock poisoned")]
    LockPoisoned,

    #[error("{0}")]
    Runtime(#[from] bex_project::RuntimeError),

    #[error("CallFunctionArgs.call_target must be set")]
    MissingCallTarget,

    #[error("type arguments are not supported when invoking a BAML function handle")]
    FunctionHandleTypeArgs,

    #[error("Function not found: {name}")]
    FunctionNotFound { name: String },

    #[error("Missing argument '{parameter}' for function '{function}'")]
    MissingArgument { function: String, parameter: String },

    #[error("Not implemented: {0}")]
    NotImplemented(String),

    #[error("call_id {0} is already in use by an active call")]
    DuplicateCallId(u64),

    #[error("call_id must be a nonzero uint64")]
    InvalidCallId,

    #[error("Internal error: {0}")]
    Internal(String),

    #[error("{0}")]
    Startup(String),
}

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Supply a value for the named parameter '{parameter}' in the call args.
  2. Check the function's signature in the .baml file for the exact parameter name.
  3. If the parameter should be optional, mark it with a default in the BAML function definition.
  4. Update stale call sites after signature changes.

Example fix

// before
args.inputs = {"resume_text": text};
// after
args.inputs = {"resume_text": text, "language": "en"};
Defensive patterns

Strategy: validation

Validate before calling

required = FUNCTION_SIGNATURES[fn_name]  # from .baml signature
missing = required - set(inputs)
if missing:
    raise ValueError(f'missing args: {missing}')

Try / catch

try:
    bridge.call_function(args)
except BridgeError as e:
    if e is BridgeError.MissingArgument:
        inputs[e.parameter] = default_for(e.function, e.parameter)
        retry(inputs)

Prevention

When it happens

Trigger: Calling a BAML function via the bridge while omitting one of its required parameters from the args map/list.

Common situations: A .baml function gained a new required parameter and old call sites were not updated; optional-vs-required misunderstanding; keyword arguments misspelled so the bridge counts one as missing.

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/c2aee866423c6fae. Report an issue: GitHub.