Table of Contents

Method AddBuiltIns

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

AddBuiltIns(ToolRegistry, Action<BuiltInToolSelection>)

Registers built-in tools selected through a fluent selector.

public static ToolRegistry AddBuiltIns(this ToolRegistry registry, Action<BuiltInToolSelection> configure)

Parameters

registry ToolRegistry

The tool registry to populate.

configure Action<BuiltInToolSelection>

A delegate that configures the BuiltInToolSelection filters.

Returns

ToolRegistry

The same registry instance, for fluent chaining.

Examples

Example: Registering only low-risk I/O tools

var registry = new ToolRegistry();

registry.AddBuiltIns(selection => selection
    .Category("io")
    .MaxRisk(ToolRiskLevel.Low));

Example: Cherry-picking individual tools by name

var registry = new ToolRegistry();

registry.AddBuiltIns(selection => selection
    .Include("http_get")
    .Include("websearch")
    .Include("calculator"));

AddBuiltIns(ToolRegistry, Action<BuiltInToolSelection>, Action<BuiltInToolRegistrationOptions>)

Registers built-in tools selected through a fluent selector and optional instantiation overrides.

public static ToolRegistry AddBuiltIns(this ToolRegistry registry, Action<BuiltInToolSelection> configure, Action<BuiltInToolRegistrationOptions> configureOptions)

Parameters

registry ToolRegistry

The tool registry to populate.

configure Action<BuiltInToolSelection>

A delegate that configures the BuiltInToolSelection filters.

configureOptions Action<BuiltInToolRegistrationOptions>

An optional delegate that configures BuiltInToolRegistrationOptions to override how specific tools are instantiated.

Returns

ToolRegistry

The same registry instance, for fluent chaining.

Examples

Example: Registering data tools with custom XML options

var registry = new ToolRegistry();

registry.AddBuiltIns(
    selection => selection.Category("data"),
    options => options.Xml(new XmlToolOptions { MaxDepth = 32 }));

Example: Overriding a specific tool factory

var registry = new ToolRegistry();

registry.AddBuiltIns(
    selection => selection.Category("net"),
    options => options.Override("websearch",
        () => BuiltInTools.CreateWebSearch(WebSearchTool.Provider.Brave, "my-api-key")));

AddBuiltIns(ToolRegistry, BuiltInProfile)

Registers built-in tools matching a predefined profile.

public static ToolRegistry AddBuiltIns(this ToolRegistry registry, BuiltInProfile profile)

Parameters

registry ToolRegistry

The tool registry to populate.

profile BuiltInProfile

A predefined profile such as All or SafeOnly.

Returns

ToolRegistry

The same registry instance, for fluent chaining.

Examples

Example: Registering all built-in tools

var registry = new ToolRegistry();
registry.AddBuiltIns(BuiltInProfiles.All);

Example: Registering only safe, read-only tools

var registry = new ToolRegistry();
registry.AddBuiltIns(BuiltInProfiles.SafeOnly);

AddBuiltIns(ToolRegistry, BuiltInProfile, Action<BuiltInToolRegistrationOptions>)

Registers built-in tools matching a predefined profile and optional instantiation overrides.

public static ToolRegistry AddBuiltIns(this ToolRegistry registry, BuiltInProfile profile, Action<BuiltInToolRegistrationOptions> configureOptions)

Parameters

registry ToolRegistry

The tool registry to populate.

profile BuiltInProfile

A predefined profile such as All or SafeOnly.

configureOptions Action<BuiltInToolRegistrationOptions>

An optional delegate that configures BuiltInToolRegistrationOptions to override how specific tools are instantiated.

Returns

ToolRegistry

The same registry instance, for fluent chaining.

Examples

Example: Registering all tools with a custom web-search provider

var registry = new ToolRegistry();

registry.AddBuiltIns(
    BuiltInProfiles.All,
    options => options.Override("websearch",
        () => BuiltInTools.CreateWebSearch(WebSearchTool.Provider.Tavily, "my-api-key")));