tool_registry

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(ctx context.Context, tool tools.Tool, arguments map[string]interface{}) (*protocol.ToolResult, error)

Handler is a function that executes a tool with given arguments

type Registry

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

Registry provides a simple way to register individual tools

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new tool registry

func (*Registry) CallTool

func (r *Registry) CallTool(ctx context.Context, name string, arguments map[string]interface{}) (*protocol.ToolResult, error)

CallTool implements ToolProvider interface

func (*Registry) ListTools

func (r *Registry) ListTools(_ context.Context, cursor string) ([]protocol.Tool, string, error)

ListTools implements ToolProvider interface

func (*Registry) RegisterTool

func (r *Registry) RegisterTool(tool tools.Tool)

RegisterTool adds a tool to the registry

func (*Registry) RegisterToolWithHandler

func (r *Registry) RegisterToolWithHandler(tool tools.Tool, handler Handler)

RegisterToolWithHandler adds a tool with a custom handler

func (*Registry) UnregisterTool

func (r *Registry) UnregisterTool(name string)

UnregisterTool removes a tool from the registry

Jump to

Keyboard shortcuts

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