Table of Contents

Property ForcedToolName

Namespace
LMKit.Agents.Tools
Assembly
LM-Kit.NET.dll

ForcedToolName

Gets or sets the name of the tool to force when Choice is Specific.

public string ForcedToolName { get; set; }

Property Value

string

The exact name of the tool to invoke. This property is ignored when Choice is not Specific.

Examples

Example: Forcing a calculator tool

using LMKit.Agents.Tools;

var policy = new ToolCallPolicy
{
    Choice = ToolChoice.Specific,
    ForcedToolName = "calculator"
};

// The agent will be required to call the "calculator" tool
// before producing its response

Remarks

Tool name comparison uses ordinal (case-sensitive) string comparison. The name must exactly match a tool registered in the agent's tool registry.

Before prompting the model, the runtime should validate that a tool with this name exists. If the tool is not found, an error should be raised.