RESULT is a reactive reference to $result — the return value available inside on_success callbacks. When an action completes successfully, the framework captures its output and makes it available through this variable.
Where It’s Available
RESULT is only meaningful inside on_success handlers. Outside that context, $result is undefined. Every action that supports callbacks (on_success / on_error) makes this variable available when the action succeeds.
For CallTool, $result is the tool’s return value (parsed as JSON when possible). When the action includes unwrapResult: true (set automatically by callable references), the renderer extracts the value from a {"result": X} envelope before exposing it. For Fetch, it’s the parsed response body. You can use it with any action in the callback:
$result is the success counterpart of $error: one is available in on_success, the other in on_error. Neither exists outside its callback scope.