toolcatalog

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDispatcher

func BuildDispatcher(catalog *Catalog) []*agent.Tool

BuildDispatcher returns two meta-tools that provide dynamic access to the catalog: builtin_list (discovery) and builtin_invoke (proxy execution).

Types

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

Catalog is a thread-safe registry of built-in tools grouped by category.

func New

func New() *Catalog

New creates an empty Catalog.

func (*Catalog) Get

func (c *Catalog) Get(name string) (ToolEntry, bool)

Get returns the entry for the named tool.

func (*Catalog) ListCategories

func (c *Catalog) ListCategories() []Category

ListCategories returns all registered categories sorted by name.

func (*Catalog) ListTools

func (c *Catalog) ListTools(category string) []ToolSchema

ListTools returns schemas for all tools in the given category. If category is empty, all tools are returned.

func (*Catalog) Register

func (c *Catalog) Register(category string, tools []*agent.Tool)

Register adds tools under the given category. The category must already be registered via RegisterCategory.

func (*Catalog) RegisterCategory

func (c *Catalog) RegisterCategory(cat Category)

RegisterCategory adds a category descriptor.

func (*Catalog) ToolCount

func (c *Catalog) ToolCount() int

ToolCount returns the total number of registered tools.

type Category

type Category struct {
	Name        string
	Description string
	ConfigKey   string
	Enabled     bool
}

Category describes a group of related tools.

type ToolEntry

type ToolEntry struct {
	Tool     *agent.Tool
	Category string
}

ToolEntry pairs a tool with its category.

type ToolSchema

type ToolSchema struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Category    string `json:"category"`
	SafetyLevel string `json:"safety_level"`
}

ToolSchema is a summary returned by ListTools (no handler exposed).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL