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 ¶
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.