gateway

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 10 Imported by: 1 module, 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 gateway provides the MCP gateway tools (list_servers, list_tools, invoke_tool) of the `serve` TCP front end. Ranked tool search lives in pkg/toolsearch, served by `server run --stdio` as search_tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GatewayTools

type GatewayTools interface {
	ListTools() []Tool
	InvokeTool(ctx context.Context, params InvokeToolParams) (interface{}, error)
	ListServers(ctx context.Context) ([]ServerInfo, error)
}

func NewGatewayTools

func NewGatewayTools(serverReg registry.Registry, toolReg router.ToolRegistry, router router.Router, logger *slog.Logger) GatewayTools

type InvokeToolParams

type InvokeToolParams struct {
	ServerName string          `json:"server_name"`
	ToolName   string          `json:"tool_name"`
	Arguments  json.RawMessage `json:"arguments,omitempty"`
}

InvokeToolParams are the invoke_tool arguments. Arguments stays raw JSON end to end so the tool's arguments are relayed byte for byte: decoding them into a map would turn every number into a float64 and corrupt integers above 2^53 (9007199254740993 would become ...992).

type ServerInfo

type ServerInfo struct {
	Name      string `json:"name"`
	Status    string `json:"status"`
	Transport string `json:"transport"`
	ToolCount int    `json:"tool_count"`
}

type Tool

type Tool struct {
	Name        string      `json:"name"`
	Description string      `json:"description"`
	InputSchema interface{} `json:"inputSchema,omitempty"`
}

Jump to

Keyboard shortcuts

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