dynamic

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package dynamic implements the 'dynamic' load mode: instead of exposing the full product tool catalog (110+ tools) to the MCP client, the server exposes only three meta-tools — ionos_search_tools, ionos_describe_tools and ionos_call_tool — through which the model discovers and invokes the real tools at runtime. The real catalog never enters the client's tool list, so this works for clients with hard tool caps and no client-side tool search of their own (e.g. Cursor, Windsurf), without relying on notifications/tools/list_changed.

Mechanism: the full catalog is registered onto a private, in-memory "catalog" server (reusing each product's existing RegisterAll, unchanged). The dynamic package self-connects to that server over an in-memory transport, snapshots the tool metadata once at startup, and forwards ionos_call_tool invocations to it. Input validation, schema inference and error enrichment all run inside the catalog server exactly as they would in eager mode.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(ctx context.Context, public *mcp.Server, products []Product) (io.Closer, error)

Register builds the private catalog from products and registers the three dynamic meta-tools on the public server. It returns an io.Closer that tears down the catalog connection; main defers it for a clean shutdown and tests Close it to avoid leaks. Returns an error if the catalog cannot be built.

Types

type Product

type Product struct {
	Name     string
	Summary  string
	Register func(s *mcp.Server)
}

Product is one registrable product group (compute, dns, ...). Register adds the product's tools to the given server; it is the same closure the eager path runs, so the catalog stays in lockstep with eager mode.

Jump to

Keyboard shortcuts

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