Table of Contents

Method Remove

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

Remove(string)

Removes a tool from the registry by its name.

public bool Remove(string name)

Parameters

name string

The exact name of the tool to remove (case-sensitive).

Returns

bool

true if the tool was found and removed; otherwise, false.

Examples

Example: Removing a tool

using LMKit.Agents.Tools;

var registry = new ToolRegistry();
registry.Register(new TemporaryTool());

// Later, remove the tool
if (registry.Remove("temporary_tool"))
{
    Console.WriteLine("Tool removed successfully");
}

Exceptions

ArgumentException

Thrown when name is null, empty, or whitespace.

Remove(IEnumerable<ITool>)

Removes multiple tools from the registry.

public int Remove(IEnumerable<ITool> tools)

Parameters

tools IEnumerable<ITool>

The tools to remove (by their names).

Returns

int

The number of tools successfully removed.

Remarks

Tools with null or whitespace names are skipped. Tools not found in the registry are also skipped without error.

Exceptions

ArgumentNullException

Thrown when tools is null.