execute

Executes the tool with the provided arguments and returns the result.

This method constructs a Message.Tool.Call with the given arguments, passes it to the environment for execution, and converts the received tool result into a safe result encapsulated in a Result type.

Return

A Result containing the outcome of the tool execution, either a success or a failure.

Parameters

args

The arguments required for the tool execution.