Documentation
¶
Overview ¶
Package tools connects to MCP servers and offers the tools the config lists as abilities. Only reading tools exist yet: what a tool returns is fenced as material, never instructions, and every call is logged and counted against a daily cap. A local server is given only PATH, HOME and the variables the config names, never the rest of the environment.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrOverCap = errors.New("over today's limit of tool calls")
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
Action is a tool that changes things: it is never run as it is proposed, only once the gate (its class) allows it.
func (Action) Destructive ¶
Destructive is true unless its server says it only adds: a tool that says nothing is taken to be destructive.
type Connected ¶
Connected is a server, its reading tools (abilities) and its tools that change things (actions); Err says why it has none (it couldn't be reached, or a tool isn't there).
func Connect ¶
func Connect(ctx context.Context, cfg config.Tools, limit int, st Store, log *slog.Logger) []Connected
Connect reaches every server, keeping those it can: a server it can't reach is reported in its Connected's Err, not a reason to stop. limit is the reading calls a day across all of them.
type Server ¶
type Server struct {
Name string
// contains filtered or unexported fields
}
Server is one MCP server's connection: made again once if it drops.
type Store ¶
type Store interface {
LogWeb(ctx context.Context, kind, what string, costUSD float64, at time.Time) error
WebSince(ctx context.Context, kind string, since time.Time) (int, error)
}
Store is where calls are logged and counted (the web log).
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool is a reading tool, offered as an ability: its query is its arguments.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher looks with one of a server's reading tools on a schedule (config.Watch) and returns what it found, item by item.