{"record":{"id":"2fe5d906b3a0ebb2","repo":"BoundaryML/baml","slug":"unknown-builtin-function-at","errorCode":null,"errorMessage":"unknown builtin function '{}' at {:?}","messagePattern":"unknown builtin function '(.+?)' at (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-compiler/src/thir/interpret.rs","lineNumber":2793,"sourceCode":"                    \"baml.fetch_as: HTTP request failed: HTTP {}\\nBody: {} at {:?}\",\n                    status,\n                    body,\n                    meta.0\n                );\n            }\n\n            let body = response.text().await.with_context(|| {\n                format!(\n                    \"baml.fetch_as: failed to read response body at {:?}\",\n                    meta.0\n                )\n            })?;\n\n            // Parse the JSON body into the target type\n            let parsed_value = parse_json_to_baml_value(&body, target_type, meta)?;\n            Ok(parsed_value)\n        }\n        _ => bail!(\"unknown builtin function '{}' at {:?}\", fn_name, meta.0),\n    }\n}\n\nfn evaluate_method_call(\n    receiver: &BamlValueWithMeta<ExprMetadata>,\n    method_name: &str,\n    args: &[BamlValueWithMeta<ExprMetadata>],\n    meta: &ExprMetadata,\n) -> Result<BamlValueWithMeta<ExprMetadata>> {\n    match method_name {\n        \"length\" => {\n            // Array/List/String/Map length method\n            match receiver {\n                BamlValueWithMeta::List(items, _) => {\n                    if !args.is_empty() {\n                        bail!(\"length() method takes no arguments at {:?}\", meta.0);\n                    }\n                    Ok(BamlValueWithMeta::Int(items.len() as i64, meta.clone()))","sourceCodeStart":2775,"sourceCodeEnd":2811,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-compiler/src/thir/interpret.rs#L2775-L2811","documentation":"The BAML interpreter dispatches builtin function calls by name. When evaluate_builtin_function encounters a function name it does not recognize (not one of the implemented builtins such as baml.fetch_as), it throws this error with the name and source span.","triggerScenarios":"Calling a function that does not exist as a builtin, e.g. a typo like baml.fetch_as2 or baml.fetc_as, or calling a function only available in a newer BAML version on an older interpreter.","commonSituations":"Typo in a builtin name; copying code using a builtin from newer docs than the installed engine version; assuming a helper exists when it must be defined in BAML or supplied another way.","solutions":["Check the spelling of the function name against the documented builtin list","Verify your BAML engine version supports the builtin; upgrade if needed","Implement the logic as a regular BAML function or expression if no builtin exists"],"exampleFix":"// before\nlet v = baml.fetcha_as::<T>(url)\n// after\nlet v = baml.fetch_as::<T>(url)","handlingStrategy":"validation","validationCode":"const KNOWN_BUILTINS: [&str; 1] = [\"baml.fetch_as\"];\nfn is_known_builtin(name: &str) -> bool {\n    KNOWN_BUILTINS.contains(&name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a list of valid builtins for your engine version","Enable editor autocomplete for BAML builtins to avoid typos","Pin and verify the engine version when using recently added builtins"],"tags":["baml","builtin-function","unknown-identifier","interpreter"],"backgroundTag":"unsupported-operation","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}