Register a SWAIG tool with a typed handler that receives named parameters instead of
the standard (args, rawData) convention. The SDK wraps the handler to unpack the
args object into positional params.
If no parameters schema is provided, one is inferred from the handler’s source
code (parameter names and default values).
Use defineTypedTool() when you want cleaner handler signatures with named
parameters. Use defineTool() when you need full control over
the args object.
Tool definition object.
Tool name. Must be unique within the agent.
Human-readable description. The AI reads this to decide when to call the tool.
JSON Schema describing the tool’s parameters. If omitted, the schema is inferred from the handler’s parameter names and default values.
Typed handler that receives named parameters extracted from the args object. Parameter names must match the JSON Schema property names.
Whether to require token validation on tool calls. Recommended for production.
Language-specific filler phrases spoken while the tool executes.
URL of an audio file to play while the tool executes.
Number of times to loop the wait file.
List of required parameter names from the JSON Schema.
AgentBase — Returns this for method chaining.