execute_tool

Function execute_tool 

Source
pub async fn execute_tool(
    tool: &ToolDefinition,
    params: Value,
    app_config: &Config,
) -> Result<Value>
Expand description

Execute a tool script with the given parameters.

Spawns a blocking thread, creates a sandboxed Lua VM with all host APIs plus the context bridge, and calls tool.execute(params, context).

§Arguments

  • tool — tool definition (script source, config, timeout).
  • params — validated JSON parameters for the tool.
  • app_config — full application config (needed for context bridge).

§Returns

The JSON value returned by tool.execute().