Table of Contents

Class DelegateTool

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

A tool that enables an agent to delegate tasks to other specialized agents.

When registered, this tool allows the model to request handoff to another agent from the available delegates registry. The tool handles execution routing and returns the delegate's response.

public sealed class DelegateTool : ITool
Inheritance
DelegateTool
Implements
Inherited Members

Remarks

Usage
Register this tool with an agent that has delegates configured. The model can then call this tool when it determines another agent would be better suited for a task.

Input Schema
The tool expects JSON with agent (target agent name), task (the query/task), and optionally context and reason.

Constructors

DelegateTool(AgentRegistry, Agent)

Initializes a new instance of the DelegateTool class.

Properties

Description

Gets the tool description.

InputSchema

Gets the JSON input schema.

Name

Gets the tool name.

Methods

FromAgent(Agent)

Creates a delegate tool from an agent's configured delegates.

InvokeAsync(string, CancellationToken)

Invokes the delegation tool with the specified arguments.

Events

AfterDelegation

Fired after delegation completes.

BeforeDelegation

Fired before delegation occurs. Handlers can cancel or modify the request.