AgentToolFactory

Helpers & Utilities · AiDotNet.Agentic.Tools

Creates IAgentTool instances from delegates or from objects whose methods are annotated with AgentToolAttribute.

For Beginners

Two easy ways to make tools without writing a tool class:

  • FromDelegate: wrap a lambda or method reference directly.
  • ScanInstance: take any object, find every method you marked with [AgentTool],

and turn each into a tool automatically.

Methods

Method Summary
IAgentTool FromDelegate(string name, string description, Delegate function) Creates a tool from a delegate (lambda or method group).
IReadOnlyList<IAgentTool> ScanInstance(object target) Scans an object for methods annotated with AgentToolAttribute and creates a tool for each (covering both instance and static annotated methods).