execute
Executes the tool with the provided arguments and returns the result.
This method constructs a MessagePart.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
The arguments required for the tool execution.
The JSON serializer for encoding the tool arguments.
Executes the tool with the provided arguments and caller-supplied metadata, returning the result.
The metadata is threaded through the environment into Tool.execute as a side channel (e.g. a trace span id). When combined with metadata contributed by installed features, the caller-supplied entries take precedence on key collision.
Return
A Result containing the outcome of the tool execution.
Parameters
The arguments required for the tool execution.
The JSON serializer for encoding the tool arguments.
Caller-contributed per-call context.