ButlerSDK.Tools.DiscovererTool
1.2.0-preview
dotnet add package ButlerSDK.Tools.DiscovererTool --version 1.2.0-preview
NuGet\Install-Package ButlerSDK.Tools.DiscovererTool -Version 1.2.0-preview
<PackageReference Include="ButlerSDK.Tools.DiscovererTool" Version="1.2.0-preview" />
<PackageVersion Include="ButlerSDK.Tools.DiscovererTool" Version="1.2.0-preview" />
<PackageReference Include="ButlerSDK.Tools.DiscovererTool" />
paket add ButlerSDK.Tools.DiscovererTool --version 1.2.0-preview
#r "nuget: ButlerSDK.Tools.DiscovererTool, 1.2.0-preview"
#:package ButlerSDK.Tools.DiscovererTool@1.2.0-preview
#addin nuget:?package=ButlerSDK.Tools.DiscovererTool&version=1.2.0-preview&prerelease
#tool nuget:?package=ButlerSDK.Tools.DiscovererTool&version=1.2.0-preview&prerelease
ButlerSDK.Tools.DiscovererTool (version 1.2.0preview)
What's new:
Due to an some fixes and updatees the the SDK, including the base ButlerSDK.Abstractions project, this was bumped to v1.2.0preview to keep in step.
Dynamic, on-demand tool loading for ButlerSDK.
The Discoverer allows an LLM to "shop" for the tools it needs, rather than carrying every tool in its context window at all times. It is a critical component for managing token costs in large agentic systems.
🚀 Why use Discoverer?
The Problem: Context Pollution If you have a library of 300+ tools (Calendar, Network, FileSystem, Database, etc.), adding all of them to the LLM's system prompt consumes massive amounts of tokens. This increases cost and confuses the model.
The Solution: Dynamic Loading The Discoverer creates a specific workflow:
- Search: The LLM asks, "Do we have a tool to check the network?"
- Activate: Discoverer scans available resources, finds
GetPublicIP, and spins it up. - Execute: The tool is added to the active
Butlersession for use. - Wind-down: When the task is done, the tools can be unloaded to free up context.
Note: This pattern works best with high-intelligence Cloud Models (GPT-4o, Gemini 3.1 Pro).
🛠 How it Works
The default implementation (DefaultButlerTool_DiscoverResource) uses Reflection to scan your currently loaded assemblies for tools.
Scanning Logic: It will automatically find and instantiate any class that meets these criteria:
- Implements
IButlerToolBaseInterface(The core contract). - Is Public and Concrete (Not Abstract).
- Is NOT tagged with
[ButlerTool_DiscoverAttributes(DisableDiscover = true)].
Custom Discovery Sources
You are not limited to Reflection. You can implement ButlerTool_DiscoverResource to load tools from a database, a plugin folder, or a remote API, provided your source can return instantiated IButlerToolBaseInterface objects.
// Example: Adding a custom discovery source
var myDiscoverer = new ButlerTool_DiscoverTools(keyVault);
myDiscoverer.AddButlerToolSource(new MyDatabaseToolSource());
Adding Discover to a Butler Instance
// 1. Setup your KeyVault
var keyVault = new EnvironmentApiKeyMgr(); // or your own implementation
// 2. Initialize Butler
var butler = new Butler(/* parameters */);
// 3. Configure the Discoverer
var discoverer = new ButlerTool_DiscoverTools(keyVault);
discoverer.AssignButler(butler); // Link it to the session
// 4. Add Sources (Where to look for tools)
discoverer.AddDefaultButlerSources(keyVault); // Adds the Reflection scanner
discoverer.AddButlerToolSource(new MyVerifiedPluginScanner()); // Optional custom source
// 5. Register the Discoverer as a Tool so the LLM can use it
butler.TheToolBox = discoverer;
butler.AddTool(butler.TheToolBox);
⚠️ Versioning & Breaking Changes
v1.0.3-preview Update: To improve modularity, the core interfaces have moved.
DefaultButlerTool_DiscoverResourceandButlerTool_Discoverernow rely on contracts defined in ButlerSDK.Core.Abstractions.- Ensure your Core and Tool packages are version-aligned to avoid type mismatches.
- They have also been renamed to to be IButlerTool_Discoverer and IButlerTool_DiscoverResource to be more typical interface names.
📄 License
Apache 2.0 License. See LICENSE for details.
Copyright 2025-2026 Thomas Paul Betterly.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- ButlerSDK.ApiKeyMgr (>= 1.2.0-preview)
- ButlerSDK.ChatController (>= 1.2.0-preview)
- ButlerSDK.Core.Abstractions (>= 1.2.0-preview)
- ButlerSDK.Tools.ButlerSystemToolBase (>= 1.2.0-preview)
- ButlerSDK.Tools.ButlerToolBase (>= 1.2.0-preview)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ButlerSDK.Tools.DiscovererTool:
| Package | Downloads |
|---|---|
|
ButlerSDK.Tools.ExternProcessLauncher
Package Description |
|
|
ButlerSDK.Tools.VirtualTool
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.0-preview | 100 | 5/12/2026 |
| 1.1.0-preview | 115 | 3/9/2026 |
| 1.0.0.1 | 112 | 2/22/2026 |