Directive to execute a Jido.Action as a tool.
The runtime will execute this asynchronously and send the result back
as a ai.tool.result signal.
Execution Modes
Direct module execution (preferred): When
action_moduleis provided, the module is executed directly viaTurn.execute_module/4, bypassing name-based lookup. This is used by strategies that maintain their own tool lists.Name lookup: When
action_moduleis nil, runtime resolves the tool name against the current strategy/plugin tool map and executes viaJido.AI.Turn.
Argument Normalization
LLM tool calls return arguments with string keys (from JSON). The execution normalizes arguments using the tool's schema before execution:
- Converts string keys to atom keys
- Parses string numbers to integers/floats based on schema type
This ensures consistent argument semantics whether tools are called via DirectiveExec or any other path.
Summary
Functions
Create a new ToolExec directive.