Documentation
¶
Overview ¶
Package einotool adapts gateway-managed MCP services (pkg/mcp/service) to eino tools, so gateway-governed MCP tools are directly consumable by in-process eino agents and graphs without an HTTP loopback. Resource governance (service config, auth, allowlisting by the caller) stays in the gateway; execution stays in eino.
The adapter is a pure bridge: it does not record MCP usage events. In-process callers own their observability span; the builtin agent runtime (see docs/design/agents-control-plane.md §5.7.6) is the layer that attributes tool calls.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Tools ¶
func Tools(ctx context.Context, caller ToolCaller, serviceID string, names ...string) ([]tool.BaseTool, error)
Tools lists the MCP service's tools and wraps each as an eino InvokableTool. When names is non-empty it acts as an allowlist and every listed name must exist — a missing tool is an error, not a silent skip, so an agent definition referencing a renamed tool fails loudly at materialization time.
Types ¶
type ToolCaller ¶
type ToolCaller interface {
ListTools(ctx context.Context, id string) ([]basemcp.Tool, error)
CallTool(ctx context.Context, id string, name string, args map[string]any, progressCh chan<- mcpservice.UpstreamProgress) (*basemcp.ToolResult, error)
}
ToolCaller is the slice of *service.Manager the adapter needs. It is an interface so tests can stub the MCP service layer.