Property ToolCalls
ToolCalls
Gets the list of tool calls made during execution, in order of invocation.
public IReadOnlyList<ToolCallResult> ToolCalls { get; }
Property Value
Examples
Analyzing tool usage:
using LMKit.Model;
using LMKit.Agents;
using var model = new LM("path/to/model.gguf");
var agent = new Agent(model);
agent.EnsureTools().Register(new CalculatorTool());
agent.Planning = PlanningStrategy.ReAct;
var result = agent.Run("What is 125 * 48?");
Console.WriteLine($"Answer: {result.Content}");
Console.WriteLine($"Tool calls: {result.ToolCalls.Count}");
foreach (var call in result.ToolCalls)
{
Console.WriteLine($" Called: {call.ToolName}");
Console.WriteLine($" Args: {call.Arguments}");
Console.WriteLine($" Result: {call.Result}");
Console.WriteLine($" Status: {call.ResultType}");
}
Remarks
Each entry contains the tool name, arguments passed, and the result of the invocation. The list is empty if no tools were called. This is useful for debugging, auditing, and understanding how the agent reached its conclusion.