pub fn dispatch( name: &str, params: Value, state: &mut EngineState, ) -> Result<ToolResult, (i32, String)>