Documentation
¶
Overview ¶
Package connroute answers a call that names a connection its tool does not serve (#2812), in one copy for every toolkit.
Agents send a connection to the wrong tool: an application database's name to trino_query, an API connection to graphql_query. Each kind refuses an unknown name in its own words ("unknown connection: \"apps\""), and none of them says the name exists under another kind. This layer reads a refused call's connection argument, finds the kind that does serve that name, and adds to the refusal which kind it is and the tools that take it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KindName ¶
KindName is how a connection kind is named to an agent: the refusal here and the baseline instructions' connection line (#2812) read one list.
func Middleware ¶
func Middleware(d Deps) mcp.Middleware
Middleware adds the routing sentence to a refused call whose connection argument names a connection of another kind than the tool's. A tool whose kind has no connections of its own (manage_table, which takes a Trino connection from the portal toolkit) is left alone, as is any call whose connection is served by the tool's kind: its refusal is about something else.
func ScriptRoute ¶
ScriptRoute is the way a kind is reached outside its tools, "" when it has none: an application database is reached through platform.query in a managed script.
Types ¶
type Deps ¶
type Deps struct {
// Connections lists every configured connection with its kind.
Connections func() []knowledge.ConnectionInfo
// ToolKind is the kind of the toolkit registering a tool, "" when no
// toolkit does.
ToolKind func(tool string) string
// KindTools lists the tools the toolkits of a kind register.
KindTools func(kind string) []string
}
Deps is what the layer reads, all read per call so a connection added at run time is known.