toolinventory

package
v1.131.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package toolinventory compares the tools a deployment says it registers with the tools its MCP server actually holds.

The two are written in different places and were never compared. A toolkit's Tools() list feeds the admin tool listing, platform_find_tools, the instruction baseline and the persona gates, while what a client can call is whatever reached mcp.AddTool. 1.131.0 shipped graphql_export named by the first and absent from the second, because the tool registers only once its dependencies are set and the platform set them after registration had run (#1675). Every unit gate was green and the tool was unreachable on every deployment (#1680).

It lives here rather than on the platform facade for the reason the other seams under internal/platform do: the facade is at its size and method budget, and this is cohesive enough to own its own package. pkg/platform assembles what only it holds and hands it over.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Verify

func Verify(ctx context.Context, d Deps) error

Verify fails when a toolkit or the platform names a tool the MCP server does not hold, and warns when the server holds a tool nothing claims.

The listing is read through a real client session, so it is the set a caller sees rather than an internal accounting of it.

The missing direction fails; the unexpected direction warns. A name that reaches the server with nothing claiming it is a real finding, but a fan-out kind that namespaces its tools per upstream can legitimately be mid-reconcile, and a deployment that refused to boot over it would trade a listing defect for an outage.

Types

type Deps

type Deps struct {
	// Server holds the registered handlers. A nil Server is a platform
	// assembled without one, which has no listing to be wrong about.
	Server *mcp.Server
	// Registry holds the toolkits that name their tools.
	Registry *registry.Registry
	// PlatformTools are the tools registered outside any toolkit. The
	// registry does not know them, so a comparison without them reports
	// every one of them as unclaimed.
	PlatformTools []PlatformTool
	// Visible reports whether the operator's tools.allow / tools.deny globs
	// leave a tool in tools/list. A tool the operator hid is absent from the
	// listing by intent, not by fault. Nil hides nothing.
	Visible func(name string) bool
}

Deps is what the comparison reads.

type PlatformTool

type PlatformTool struct {
	Name string
	Kind string
}

PlatformTool is one tool the platform registers outside any toolkit. The facade's own type is not imported here, so this package stays a leaf.

Jump to

Keyboard shortcuts

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