pub async fn dispatch_tool(
tool_call: &ToolCall,
user_tools: &HashMap<String, ToolHandler>,
agent: &Prompty,
parent_inputs: Option<&Value>,
) -> StringExpand description
Dispatch a tool call using 3-layer resolution.
Resolution order (matches TypeScript):
user_tools— theTurnOptions.toolsmap (runtime-provided handlers)- Global name registry — tools registered via
register_tool() - Kind handler — handlers registered via
register_tool_handler()for the tool’skindfromagent.tools, with fallback to"*"wildcard
Before dispatching, resolves tool bindings from parent_inputs into args.
Returns an error message string (never throws) — the LLM can recover.