ButlerSDK.Tools.DiscovererTool 1.2.0-preview

This is a prerelease version of ButlerSDK.Tools.DiscovererTool.
dotnet add package ButlerSDK.Tools.DiscovererTool --version 1.2.0-preview
                    
NuGet\Install-Package ButlerSDK.Tools.DiscovererTool -Version 1.2.0-preview
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ButlerSDK.Tools.DiscovererTool" Version="1.2.0-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ButlerSDK.Tools.DiscovererTool" Version="1.2.0-preview" />
                    
Directory.Packages.props
<PackageReference Include="ButlerSDK.Tools.DiscovererTool" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ButlerSDK.Tools.DiscovererTool --version 1.2.0-preview
                    
#r "nuget: ButlerSDK.Tools.DiscovererTool, 1.2.0-preview"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ButlerSDK.Tools.DiscovererTool@1.2.0-preview
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ButlerSDK.Tools.DiscovererTool&version=1.2.0-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ButlerSDK.Tools.DiscovererTool&version=1.2.0-preview&prerelease
                    
Install as a Cake Tool

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.

License: Apache 2.0

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:

  1. Search: The LLM asks, "Do we have a tool to check the network?"
  2. Activate: Discoverer scans available resources, finds GetPublicIP, and spins it up.
  3. Execute: The tool is added to the active Butler session for use.
  4. 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:

  1. Implements IButlerToolBaseInterface (The core contract).
  2. Is Public and Concrete (Not Abstract).
  3. 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_DiscoverResource and ButlerTool_Discoverer now 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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