registration

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 11 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 registration finds where MCP tools, prompts and resources are registered, across direct SDK calls, decorators/annotations/attributes, a wrapper function that forwards into the SDK, and registration inside a loop - working entirely off the graph the parser already built, so it never re-reads source. A registration that cannot be fully resolved is retained with unresolved flags so coverage records uncertainty instead of dropping it.

requesthandler.go recognizes the low-level SDK's request-based registration form, used by the reference MCP servers: a ListToolsRequestSchema (or Python's @app.list_tools()) handler returns the capabilities themselves - an array literal, or an object literal with a "tools"/"prompts"/"resources" array field - and a separate CallToolRequestSchema (@app.call_tool()) handler dispatches every call by name

Index

Constants

View Source
const (
	// SkipLibraryModule: the receiver is a third-party Python module bound by a plain
	// `import boto3`, so `boto3.resource("s3")` calls that module's own function
	SkipLibraryModule = "receiver is an imported third-party module, not a server object"
	// SkipNoHandler: every argument is a string literal, so the call supplies no handler and no
	// content - `api.root.add_resource("v1")` in an infrastructure library
	SkipNoHandler = "only string literal arguments: no handler or content to register"
)

Reasons a call shaped like a registration is set aside. Both are facts about the call itself, not guesses from names; each skipped call is kept in graph.SkippedRegistrations for review.

Variables

This section is empty.

Functions

func Discover

func Discover(g *graph.Graph)

Discover finds every tool, prompt and resource registration reachable from the graph's calls, decorators and annotations, and appends them to g.Capabilities

func FileImportsMCPSDK

func FileImportsMCPSDK(f *graph.File) bool

FileImportsMCPSDK reports whether f imports a module this build recognizes as an MCP SDK

func TreeImportsMCPSDK

func TreeImportsMCPSDK(g *graph.Graph) bool

TreeImportsMCPSDK reports whether any file in the graph imports a recognized MCP SDK, which is what qualifies a bare `.tool(` call anywhere in it as a registration. The check is tree-wide because helper modules commonly receive a server object without importing its SDK.

Types

This section is empty.

Jump to

Keyboard shortcuts

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