connroute

package
v1.169.4 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func KindName(kind string) string

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

func ScriptRoute(kind string) string

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.

Jump to

Keyboard shortcuts

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