Define a tool
RuntimeContext includes the run ID, agent ID, step index, application context, and original tool call.
Create the agent
Run through Phaseo Gateway
Complete example
Run state
RunResult contains:
run: status, IDs, effective model, step limit, context, and pause statesteps: each model turn, request ID, provider, model, finish reason, tool calls, and usagemessages: the complete model and tool message historyoutput: the final output valueusage: aggregate token values and any cost supplied by the model client