Class SkillTool
An ITool implementation that exposes Agent Skills to models.
When invoked, this tool activates a specified skill and returns its instructions for the agent to follow. The tool description dynamically lists all available skills, implementing progressive disclosure.
public sealed class SkillTool : ITool
- Inheritance
-
SkillTool
- Implements
- Inherited Members
Remarks
Tool Behavior
The SkillTool enables LLMs to discover and activate skills through function calling:
- The tool's description lists all available skill names and their purposes.
- When the LLM calls the tool with a skill name, the full instructions are returned.
- The LLM then follows those instructions to complete the task.
Usage
var skillRegistry = new SkillRegistry();
skillRegistry.LoadFromDirectory("./skills");
var skillTool = new SkillTool(skillRegistry);
conversation.Tools.Register(skillTool);
// The LLM can now discover and activate skills through function calling
Constructors
- SkillTool(SkillRegistry, string)
Initializes a new instance of the SkillTool class.
Fields
- DefaultName
Gets the default name for the skill tool.
Properties
- Description
Concise, human-readable summary of what the tool does. This text is surfaced to the model and influences tool selection. Prefer an imperative, single sentence (≈ 200 chars or fewer).
- InputSchema
JSON Schema (Draft-07 subset) describing the expected input arguments object. Aligned with MCP naming (
inputSchema). Provide this schema when registering the tool.
- Name
Stable, unique identifier for the tool (e.g.,
get_weather). Used by the LLM to reference this tool; keep it stable across versions.
Methods
- InvokeAsync(string, CancellationToken)
Executes the tool with the provided JSON argument payload and returns a JSON payload result.
Events
- SkillActivated
Occurs when a skill is activated through this tool.