loadtools

package
v0.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package loadtools provides a meta-tool for on-demand loading of deferred tool schemas.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inputs

type Inputs struct {
	Tools  []string `json:"tools,omitempty"  jsonschema:"description=Tool names or glob patterns to load"`
	Server string   `json:"server,omitempty" jsonschema:"description=MCP server name - loads all its deferred tools"`
}

Inputs defines the parameters for the LoadTools tool.

type Tool

type Tool struct {
	tool.Base
	// contains filtered or unexported fields
}

Tool loads deferred tool schemas on demand. When called, it marks the requested tools as loaded and triggers a state rebuild so they appear in subsequent request.Tools.

func New

func New(deferred tool.Tools, onLoad func([]string) error) *Tool

New creates a LoadTools tool. deferred is the current set of deferred tools (for name resolution and descriptions). onLoad is called with the resolved tool names — it must update the loaded set and rebuild state.

func (*Tool) Execute

func (t *Tool) Execute(_ context.Context, args map[string]any) (string, error)

Execute resolves the requested tools, loads them, and returns their descriptions.

func (*Tool) Name

func (t *Tool) Name() string

Name returns the tool's identifier.

func (*Tool) Parallel

func (t *Tool) Parallel() bool

Parallel returns false because LoadTools triggers a full state rebuild via onLoad.

func (*Tool) Sandboxable

func (t *Tool) Sandboxable() bool

Sandboxable returns false as this tool has no filesystem operations.

func (*Tool) Schema

func (t *Tool) Schema() tool.Schema

Schema returns the provider-agnostic tool definition.

Jump to

Keyboard shortcuts

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