ai.tools.tool
The explicit constructor. `tools: [f]` normalizes through this.
Reference version
Signature
function ai.tools.tool(
handler: reflect.AnyFunction<Returns = unknown, Throws = unknown>,
name: string | null = …,
description: string | null = …,
on_error: ai.tools.ErrorMode | null = …
) -> ai.tools.Tool throws baml.errors.InvalidArgument | baml.errors.Unsupported
The explicit constructor. tools: [f] normalizes through this.
Source:<builtin>/ai/ns_tools/tools.bamlbytes 2212–3026