Class ToolPluginAttribute
- Namespace
- JD.AI.Core.Attributes
- Assembly
- JD.AI.Core.dll
Marks a class as a tool plugin for automatic discovery and registration.
Classes decorated with this attribute are scanned at startup and registered
with the Semantic Kernel without requiring manual AddFromType calls.
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class ToolPluginAttribute : Attribute
- Inheritance
-
ToolPluginAttribute
- Inherited Members
Examples
[ToolPlugin("file", Description = "File system operations")]
public sealed class FileTools { ... }
Constructors
ToolPluginAttribute(string)
Initializes a new ToolPluginAttribute with the specified plugin name.
public ToolPluginAttribute(string name)
Parameters
namestringThe plugin name used for Semantic Kernel registration (e.g., "file", "git", "shell").
Properties
Description
Gets or sets a human-readable description of the plugin.
public string? Description { get; set; }
Property Value
Name
Gets the plugin registration name.
public string Name { get; }
Property Value
Order
Gets or sets the order in which this plugin should be registered. Lower values are registered first. Default is 0.
public int Order { get; set; }
Property Value
RequiresInjection
Gets or sets whether this plugin requires constructor injection
(i.e., cannot be registered via AddFromType and needs AddFromObject).
When true, the assembly scanner will skip auto-registration and the plugin
must be registered explicitly with its dependencies.
public bool RequiresInjection { get; set; }