gateway

package
v0.1.0-beta.10 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package gateway adapts the existing pkg/mcp.Gateway into the agent.ToolCaller surface the runtime invokes during agentic loops. Tool calls flow through Gateway.CallTool so existing tracing, pricing, replica routing, vault auth, and tool whitelisting apply unchanged — the runtime never sees a tool any differently than an upstream MCP client would.

The package is intentionally small. It exists because pkg/agent must not import pkg/mcp at the type-surface level (the surface is used by provider packages that should remain decoupled from gateway internals); the adapter constructs a thin agent.ToolCaller from a *mcp.Gateway so wiring code in pkg/controller/gateway_builder.go (which already imports both packages) can hand the runtime a caller without introducing a new dependency edge.

Index

Constants

This section is empty.

Variables

View Source
var ErrNilGateway = errors.New("agent/gateway: nil *mcp.Gateway")

ErrNilGateway is returned by NewToolCaller when the gateway argument is nil. Callers that hold a nullable *mcp.Gateway should branch on the value before constructing a caller; the explicit error keeps nil-deref crashes out of agent code paths.

Functions

func NewToolCaller

func NewToolCaller(gw *mcp.Gateway) (agent.ToolCaller, error)

NewToolCaller wraps a *mcp.Gateway as an agent.ToolCaller. Returns (nil, ErrNilGateway) when gw is nil. The returned caller delegates directly to gw.CallTool; the gateway's existing observers, schema-pinning gate, and replica routing apply on every call.

Types

This section is empty.

Jump to

Keyboard shortcuts

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