mcp

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearLocalServers

func ClearLocalServers()

ClearLocalServers clears all registered local servers (for testing)

func RegisterLocalServer

func RegisterLocalServer(server *Server)

RegisterLocalServer registers a server for local transport

func RegisterTypedTool

func RegisterTypedTool[TInput any, TOutput any](
	s *Server,
	name string,
	description string,
	handler func(context.Context, TInput) (TOutput, error),
) error

RegisterTypedTool registers a tool with type-safe handler

Types

type Args

type Args map[string]any

Args provides type-safe access to tool arguments

func (Args) Bool

func (a Args) Bool(key string) bool

Bool returns a boolean argument

func (Args) Float

func (a Args) Float(key string) float64

Float returns a float argument

func (Args) Int

func (a Args) Int(key string) int

Int returns an integer argument

func (Args) Map

func (a Args) Map(key string) map[string]any

Map returns a map argument

func (Args) String

func (a Args) String(key string) string

String returns a string argument

func (Args) ValidatedFloat

func (a Args) ValidatedFloat(key string, validator security.ArgValidator) (float64, error)

ValidatedFloat returns a validated float argument

func (Args) ValidatedInt

func (a Args) ValidatedInt(key string, validator security.ArgValidator) (int, error)

ValidatedInt returns a validated integer argument

func (Args) ValidatedString

func (a Args) ValidatedString(key string, validator security.ArgValidator) (string, error)

ValidatedString returns a validated string argument

type AuthConfig

type AuthConfig struct {
	Type     string // "bearer", "oauth"
	Token    string
	TokenEnv string
}

AuthConfig represents authentication configuration

type CallToolParams

type CallToolParams struct {
	Name      string         `json:"name"`
	Arguments map[string]any `json:"arguments"`
}

CallToolParams represents parameters for calling a tool

type CallToolResult

type CallToolResult struct {
	Content []Content `json:"content"`
	IsError bool      `json:"isError,omitempty"`
}

CallToolResult represents the result of a tool call

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents an MCP client that connects to servers

func NewClient

func NewClient() *Client

NewClient creates a new MCP client

func (*Client) Close

func (c *Client) Close() error

Close closes all sessions

func (*Client) Connect

func (c *Client) Connect(ctx context.Context, config ServerConfig) (*Session, error)

Connect establishes a connection to an MCP server

func (*Client) GetSession

func (c *Client) GetSession(name string) (*Session, error)

GetSession retrieves an existing session by name

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

Cluster coordinates multiple service nodes with load balancing and failover

func NewCluster

func NewCluster(config ClusterConfig) (*Cluster, error)

NewCluster creates a new cluster coordinator

func (*Cluster) DeregisterNode

func (c *Cluster) DeregisterNode(instanceID string) error

DeregisterNode removes a node from the cluster

func (*Cluster) GetNode

func (c *Cluster) GetNode() (*ClusterNode, error)

GetNode returns a node using the configured load balancing strategy

func (*Cluster) HealthyNodes

func (c *Cluster) HealthyNodes() []*ClusterNode

HealthyNodes returns only healthy nodes

func (*Cluster) Nodes

func (c *Cluster) Nodes() []*ClusterNode

Nodes returns all registered nodes

func (*Cluster) RegisterNode

func (c *Cluster) RegisterNode(instance *ServiceInstance) error

RegisterNode manually registers a node

func (*Cluster) Send

func (c *Cluster) Send(ctx context.Context, method string, params any) (any, error)

Send sends a request with automatic failover

func (*Cluster) Start

func (c *Cluster) Start(ctx context.Context) error

Start initializes the cluster and begins health checking

func (*Cluster) Stop

func (c *Cluster) Stop() error

Stop gracefully shuts down the cluster

type ClusterConfig

type ClusterConfig struct {
	ServiceName         string
	Discovery           ServiceDiscovery
	Strategy            LoadBalancerStrategy
	HealthCheckInterval time.Duration
	HealthCheckTimeout  time.Duration
	MaxFailures         int
	RetryAttempts       int
	RetryDelay          time.Duration
	TLS                 *TLSConfig
}

ClusterConfig configures the cluster coordinator

type ClusterNode

type ClusterNode struct {
	Instance        *ServiceInstance
	State           NodeState
	LastHealthCheck time.Time
	FailureCount    int
	Connections     int64
	Transport       *GRPCTransport
	// contains filtered or unexported fields
}

ClusterNode represents a node in the cluster

func (*ClusterNode) DecrementConnections

func (n *ClusterNode) DecrementConnections()

DecrementConnections atomically decrements the connection count

func (*ClusterNode) GetConnections

func (n *ClusterNode) GetConnections() int64

GetConnections atomically returns the connection count

func (*ClusterNode) IncrementConnections

func (n *ClusterNode) IncrementConnections()

IncrementConnections atomically increments the connection count

type ClusterTransport

type ClusterTransport struct {
	// contains filtered or unexported fields
}

ClusterTransport wraps a Cluster to implement the Transport interface

func NewClusterTransport

func NewClusterTransport(cluster *Cluster) *ClusterTransport

NewClusterTransport creates a Transport backed by cluster coordination

func (*ClusterTransport) Close

func (t *ClusterTransport) Close() error

Close stops the cluster

func (*ClusterTransport) Send

func (t *ClusterTransport) Send(ctx context.Context, method string, params any) (any, error)

Send sends a request through the cluster with load balancing and failover

type ConsulDiscovery

type ConsulDiscovery struct {
	// contains filtered or unexported fields
}

ConsulDiscovery implements ServiceDiscovery using Consul

func NewConsulDiscovery

func NewConsulDiscovery(config ConsulDiscoveryConfig) *ConsulDiscovery

NewConsulDiscovery creates a new Consul-based service discovery

func (*ConsulDiscovery) Close

func (d *ConsulDiscovery) Close() error

Close cleans up resources

func (*ConsulDiscovery) Deregister

func (d *ConsulDiscovery) Deregister(ctx context.Context, instanceID string) error

Deregister removes a service from Consul

func (*ConsulDiscovery) Discover

func (d *ConsulDiscovery) Discover(ctx context.Context, serviceName string) ([]*ServiceInstance, error)

Discover queries Consul for healthy service instances Note: In production, this would use the Consul API client

func (*ConsulDiscovery) Register

func (d *ConsulDiscovery) Register(ctx context.Context, instance *ServiceInstance) error

Register registers a service with Consul

func (*ConsulDiscovery) UpdateService

func (d *ConsulDiscovery) UpdateService(serviceName string, instances []*ServiceInstance)

UpdateService updates service instances (simulates Consul watch)

func (*ConsulDiscovery) Watch

func (d *ConsulDiscovery) Watch(ctx context.Context, serviceName string) (<-chan []*ServiceInstance, error)

Watch watches for service changes in Consul

type ConsulDiscoveryConfig

type ConsulDiscoveryConfig struct {
	Address string
	Token   string
}

ConsulDiscoveryConfig configures Consul-based discovery

type Content

type Content struct {
	Type string `json:"type"` // "text", "image", "resource"
	Text string `json:"text,omitempty"`
	Data string `json:"data,omitempty"`
}

Content represents tool result content

type DNSDiscovery

type DNSDiscovery struct {
	// contains filtered or unexported fields
}

DNSDiscovery implements ServiceDiscovery using DNS SRV records

func NewDNSDiscovery

func NewDNSDiscovery(config DNSDiscoveryConfig) *DNSDiscovery

NewDNSDiscovery creates a new DNS-based service discovery

func (*DNSDiscovery) Close

func (d *DNSDiscovery) Close() error

Close cleans up resources

func (*DNSDiscovery) Deregister

func (d *DNSDiscovery) Deregister(ctx context.Context, instanceID string) error

Deregister is not supported for DNS discovery

func (*DNSDiscovery) Discover

func (d *DNSDiscovery) Discover(ctx context.Context, serviceName string) ([]*ServiceInstance, error)

Discover looks up SRV records for the service

func (*DNSDiscovery) Register

func (d *DNSDiscovery) Register(ctx context.Context, instance *ServiceInstance) error

Register is not supported for DNS discovery

func (*DNSDiscovery) Watch

func (d *DNSDiscovery) Watch(ctx context.Context, serviceName string) (<-chan []*ServiceInstance, error)

Watch polls DNS at intervals for changes

type DNSDiscoveryConfig

type DNSDiscoveryConfig struct {
	CacheTTL    time.Duration
	DefaultPort int
	Resolver    *net.Resolver
}

DNSDiscoveryConfig configures DNS-based discovery

type GRPCServer

type GRPCServer struct {
	pb.UnimplementedMCPServiceServer
	// contains filtered or unexported fields
}

GRPCServer wraps an MCP server for gRPC serving

func NewGRPCServer

func NewGRPCServer(mcpServer *Server, tlsConfig *TLSConfig) (*GRPCServer, error)

NewGRPCServer creates a new gRPC server wrapper

func (*GRPCServer) Address

func (s *GRPCServer) Address() string

Address returns the server's listening address

func (*GRPCServer) CallTool

func (s *GRPCServer) CallTool(ctx context.Context, req *pb.CallToolRequest) (*pb.CallToolResponse, error)

CallTool implements the CallTool RPC

func (*GRPCServer) ForceStop

func (s *GRPCServer) ForceStop()

ForceStop immediately stops the gRPC server

func (*GRPCServer) Initialize

Initialize implements the Initialize RPC

func (*GRPCServer) ListTools

func (s *GRPCServer) ListTools(ctx context.Context, req *pb.ListToolsRequest) (*pb.ListToolsResponse, error)

ListTools implements the ListTools RPC

func (*GRPCServer) Ping

func (s *GRPCServer) Ping(ctx context.Context, req *pb.PingRequest) (*pb.PingResponse, error)

Ping implements the Ping RPC

func (*GRPCServer) Serve

func (s *GRPCServer) Serve(address string) error

Serve starts the gRPC server on the given address

func (*GRPCServer) Stop

func (s *GRPCServer) Stop()

Stop gracefully stops the gRPC server

func (*GRPCServer) StreamCallTool

StreamCallTool implements the StreamCallTool RPC

type GRPCTransport

type GRPCTransport struct {
	// contains filtered or unexported fields
}

GRPCTransport implements Transport for gRPC communication

func NewGRPCTransportWithConfig

func NewGRPCTransportWithConfig(config GRPCTransportConfig) (*GRPCTransport, error)

NewGRPCTransportWithConfig creates a new gRPC transport with detailed config

func (*GRPCTransport) Close

func (t *GRPCTransport) Close() error

Close closes the gRPC connection

func (*GRPCTransport) Connect

func (t *GRPCTransport) Connect(ctx context.Context) error

Connect establishes the gRPC connection

func (*GRPCTransport) IsConnected

func (t *GRPCTransport) IsConnected() bool

IsConnected returns whether the transport is connected

func (*GRPCTransport) Receive

func (t *GRPCTransport) Receive() ([]byte, error)

Receive reads a message from the transport

func (*GRPCTransport) Send

func (t *GRPCTransport) Send(ctx context.Context, method string, params any) (any, error)

Send sends a request and returns the response

func (*GRPCTransport) StreamCallTool

func (t *GRPCTransport) StreamCallTool(ctx context.Context, name string, args map[string]any) (<-chan *CallToolResult, <-chan error)

StreamCallTool executes a tool with streaming response

type GRPCTransportConfig

type GRPCTransportConfig struct {
	Address string
	TLS     *TLSConfig
}

GRPCTransportConfig holds gRPC transport configuration

type KubernetesDiscovery

type KubernetesDiscovery struct {
	// contains filtered or unexported fields
}

KubernetesDiscovery implements ServiceDiscovery using Kubernetes endpoints API

func NewKubernetesDiscovery

func NewKubernetesDiscovery(config KubernetesDiscoveryConfig) *KubernetesDiscovery

NewKubernetesDiscovery creates a new Kubernetes-based service discovery

func (*KubernetesDiscovery) Close

func (d *KubernetesDiscovery) Close() error

Close cleans up resources

func (*KubernetesDiscovery) Deregister

func (d *KubernetesDiscovery) Deregister(ctx context.Context, instanceID string) error

Deregister removes an endpoint

func (*KubernetesDiscovery) Discover

func (d *KubernetesDiscovery) Discover(ctx context.Context, serviceName string) ([]*ServiceInstance, error)

Discover returns instances from Kubernetes endpoints Note: In production, this would use the Kubernetes client-go library

func (*KubernetesDiscovery) Register

func (d *KubernetesDiscovery) Register(ctx context.Context, instance *ServiceInstance) error

Register adds an endpoint to the service

func (*KubernetesDiscovery) UpdateEndpoints

func (d *KubernetesDiscovery) UpdateEndpoints(serviceName string, instances []*ServiceInstance)

UpdateEndpoints updates the endpoints for a service (simulates k8s watch)

func (*KubernetesDiscovery) Watch

func (d *KubernetesDiscovery) Watch(ctx context.Context, serviceName string) (<-chan []*ServiceInstance, error)

Watch returns a channel for endpoint updates

type KubernetesDiscoveryConfig

type KubernetesDiscoveryConfig struct {
	Namespace  string
	LabelKey   string
	LabelValue string
}

KubernetesDiscoveryConfig configures Kubernetes-based discovery

type LoadBalancerStrategy

type LoadBalancerStrategy string

LoadBalancerStrategy defines the load balancing algorithm

const (
	RoundRobin       LoadBalancerStrategy = "round-robin"
	LeastConnections LoadBalancerStrategy = "least-connections"
	Random           LoadBalancerStrategy = "random"
	WeightedRandom   LoadBalancerStrategy = "weighted-random"
)

type LocalTransport

type LocalTransport struct {
	// contains filtered or unexported fields
}

LocalTransport implements in-process MCP communication

func NewLocalTransport

func NewLocalTransport(serverName string) (*LocalTransport, error)

NewLocalTransport creates a new local transport

func (*LocalTransport) Close

func (t *LocalTransport) Close() error

Close closes the transport

func (*LocalTransport) Send

func (t *LocalTransport) Send(ctx context.Context, method string, params any) (any, error)

Send sends a request to the local server

type NodeState

type NodeState string

NodeState represents the state of a cluster node

const (
	NodeStateHealthy   NodeState = "healthy"
	NodeStateUnhealthy NodeState = "unhealthy"
	NodeStateDraining  NodeState = "draining"
	NodeStateRemoved   NodeState = "removed"
)

type Schema

type Schema map[string]SchemaField

Schema represents a JSON Schema for tool input validation

func (Schema) ValidateArgs

func (s Schema) ValidateArgs(args Args) error

ValidateSchema validates arguments against the tool's schema

type SchemaField

type SchemaField struct {
	Type        string   `json:"type"`
	Description string   `json:"description,omitempty"`
	Required    bool     `json:"required,omitempty"`
	Default     any      `json:"default,omitempty"`
	Pattern     string   `json:"pattern,omitempty"`   // Regex pattern for strings
	MaxLength   int      `json:"maxLength,omitempty"` // Max length for strings
	MinLength   int      `json:"minLength,omitempty"` // Min length for strings
	Enum        []any    `json:"enum,omitempty"`      // Allowed values
	Minimum     *float64 `json:"minimum,omitempty"`   // Minimum for numbers
	Maximum     *float64 `json:"maximum,omitempty"`   // Maximum for numbers
}

SchemaField represents a single field in the schema

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents an MCP server that hosts tools

func NewServer

func NewServer(name string, opts ...ServerOption) *Server

NewServer creates a new MCP server with options

func (*Server) CallTool

func (s *Server) CallTool(ctx context.Context, params CallToolParams) (*CallToolResult, error)

CallTool executes a tool by name with full security checks

func (*Server) Close

func (s *Server) Close() error

Close stops the server

func (*Server) GetAuthExtractor

func (s *Server) GetAuthExtractor() security.AuthExtractor

GetAuthExtractor returns the configured auth extractor This is useful for HTTP middleware that needs to extract auth from requests

func (*Server) GetSecurityConfig

func (s *Server) GetSecurityConfig() *security.SecurityConfig

GetSecurityConfig returns the security configuration

func (*Server) ListTools

func (s *Server) ListTools() []Tool

ListTools returns all registered tools

func (*Server) Name

func (s *Server) Name() string

Name returns the server name

func (*Server) RegisterTool

func (s *Server) RegisterTool(tool Tool) error

RegisterTool registers a tool with the server

func (*Server) RegisterTypedTool

func (s *Server) RegisterTypedTool(tool interface{ ToTool() Tool }) error

RegisterTypedTool registers a TypedTool with the server

func (*Server) Serve

func (s *Server) Serve(transport Transport) error

Serve starts the MCP server with the given transport

type ServerConfig

type ServerConfig struct {
	Name      string
	Transport string // "local" or "grpc"
	Address   string
	TLS       bool
	Auth      *AuthConfig
}

ServerConfig represents MCP server configuration

type ServerOption

type ServerOption func(*Server)

ServerOption is a functional option for configuring the server

func WithAuditLogger

func WithAuditLogger(logger security.AuditLogger) ServerOption

WithAuditLogger sets the audit logger

func WithAuthenticator

func WithAuthenticator(auth security.Authenticator) ServerOption

WithAuthenticator sets the authenticator

func WithAuthorizer

func WithAuthorizer(authz security.Authorizer) ServerOption

WithAuthorizer sets the authorizer

func WithDebugMode

func WithDebugMode(debug bool) ServerOption

WithDebugMode enables debug mode (exposes internal errors)

func WithIntegratedAuditLogger

func WithIntegratedAuditLogger(logger *security.IntegratedAuditLogger) ServerOption

WithIntegratedAuditLogger sets the integrated audit logger with middleware support

func WithRateLimit

func WithRateLimit(requestsPerSecond float64, burst int) ServerOption

WithRateLimit sets rate limiting

func WithSecurityConfig

func WithSecurityConfig(config *security.SecurityConfig) ServerOption

WithSecurityConfig sets the security configuration

type ServiceDiscovery

type ServiceDiscovery interface {
	// Discover returns available service instances
	Discover(ctx context.Context, serviceName string) ([]*ServiceInstance, error)
	// Register registers a service instance (for dynamic discovery)
	Register(ctx context.Context, instance *ServiceInstance) error
	// Deregister removes a service instance
	Deregister(ctx context.Context, instanceID string) error
	// Watch returns a channel that emits updates when services change
	Watch(ctx context.Context, serviceName string) (<-chan []*ServiceInstance, error)
	// Close cleans up resources
	Close() error
}

ServiceDiscovery defines the interface for service discovery implementations

type ServiceInstance

type ServiceInstance struct {
	ID       string            `json:"id"`
	Name     string            `json:"name"`
	Address  string            `json:"address"`
	Port     int               `json:"port"`
	Metadata map[string]string `json:"metadata,omitempty"`
	Healthy  bool              `json:"healthy"`
	Weight   int               `json:"weight,omitempty"`
}

ServiceInstance represents a discovered service instance

func (*ServiceInstance) Endpoint

func (s *ServiceInstance) Endpoint() string

Endpoint returns the full address:port string

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session represents a connection to an MCP server

func (*Session) CallTool

func (s *Session) CallTool(ctx context.Context, params CallToolParams) (*CallToolResult, error)

CallTool executes a tool on the server

func (*Session) Close

func (s *Session) Close() error

Close closes the session

func (*Session) GetTool

func (s *Session) GetTool(name string) (Tool, bool)

GetTool retrieves a cached tool definition

func (*Session) ListTools

func (s *Session) ListTools(ctx context.Context) ([]Tool, error)

ListTools retrieves available tools from the server

type StaticDiscovery

type StaticDiscovery struct {
	// contains filtered or unexported fields
}

StaticDiscovery implements ServiceDiscovery with a static list of addresses

func NewStaticDiscovery

func NewStaticDiscovery(services map[string][]string) *StaticDiscovery

NewStaticDiscovery creates a new static discovery with the given addresses

func (*StaticDiscovery) Close

func (d *StaticDiscovery) Close() error

Close cleans up resources

func (*StaticDiscovery) Deregister

func (d *StaticDiscovery) Deregister(ctx context.Context, instanceID string) error

Deregister removes a service instance

func (*StaticDiscovery) Discover

func (d *StaticDiscovery) Discover(ctx context.Context, serviceName string) ([]*ServiceInstance, error)

Discover returns all configured instances for a service

func (*StaticDiscovery) Register

func (d *StaticDiscovery) Register(ctx context.Context, instance *ServiceInstance) error

Register adds a service instance (static discovery supports dynamic registration)

func (*StaticDiscovery) SetHealthy

func (d *StaticDiscovery) SetHealthy(instanceID string, healthy bool)

SetHealthy updates the health status of an instance

func (*StaticDiscovery) Watch

func (d *StaticDiscovery) Watch(ctx context.Context, serviceName string) (<-chan []*ServiceInstance, error)

Watch returns a channel for service updates (static discovery returns closed channel)

type TLSConfig

type TLSConfig struct {
	Enabled            bool
	CertFile           string
	KeyFile            string
	CAFile             string
	InsecureSkipVerify bool
	ServerName         string
	ClientAuth         tls.ClientAuthType
}

TLSConfig holds TLS configuration for gRPC

func CreateInsecureTLSConfig

func CreateInsecureTLSConfig() (*TLSConfig, error)

CreateInsecureTLSConfig creates a TLS config for development (skip verification).

SECURITY WARNING: This function creates a TLS configuration that disables certificate verification. This makes the connection vulnerable to man-in-the-middle attacks. NEVER use this in production environments. This is intended ONLY for local development and testing purposes.

This function will return an error if called in a production environment.

func CreateSecureTLSConfig

func CreateSecureTLSConfig(certFile, keyFile, caFile string) (*TLSConfig, error)

CreateSecureTLSConfig creates a secure TLS configuration with best practices

type Tool

type Tool struct {
	Name               string              `json:"name"`
	Description        string              `json:"description"`
	Handler            ToolHandler         `json:"-"`
	Schema             Schema              `json:"input_schema"`
	RequiredPermission security.Permission `json:"-"` // Required permission to execute this tool
	AllowedRoles       []string            `json:"-"` // Allowed roles to execute this tool
}

Tool represents an MCP tool definition

type ToolHandler

type ToolHandler func(context.Context, Args) (any, error)

ToolHandler is the function signature for tool handlers

type ToolRegistry

type ToolRegistry struct {
	// contains filtered or unexported fields
}

ToolRegistry manages tools across multiple MCP servers

func NewToolRegistry

func NewToolRegistry() *ToolRegistry

NewToolRegistry creates a new tool registry

func (*ToolRegistry) GetServer

func (r *ToolRegistry) GetServer(toolName string) string

GetServer returns the server name that hosts a tool

func (*ToolRegistry) GetTool

func (r *ToolRegistry) GetTool(name string) (Tool, error)

GetTool retrieves a tool by name

func (*ToolRegistry) HasTool

func (r *ToolRegistry) HasTool(name string) bool

HasTool checks if a tool is registered

func (*ToolRegistry) ListTools

func (r *ToolRegistry) ListTools() []Tool

ListTools returns all registered tools

func (*ToolRegistry) Register

func (r *ToolRegistry) Register(serverName string, tools []Tool) error

Register registers tools from a server with collision detection

func (*ToolRegistry) RegisterWithOverride

func (r *ToolRegistry) RegisterWithOverride(serverName string, tools []Tool)

RegisterWithOverride registers tools from a server, overriding existing tools (use with caution)

type Transport

type Transport interface {
	Send(ctx context.Context, method string, params any) (any, error)
	Close() error
}

Transport defines the interface for MCP communication

func NewGRPCTransport

func NewGRPCTransport(config ServerConfig) (Transport, error)

NewGRPCTransport creates a new gRPC client transport

type TypedTool

type TypedTool[I, O any] struct {
	// contains filtered or unexported fields
}

TypedTool provides compile-time type safety for MCP tools

func NewTypedTool

func NewTypedTool[I, O any](
	name string,
	description string,
	handler func(context.Context, I) (O, error),
) *TypedTool[I, O]

NewTypedTool creates a new type-safe tool with auto-generated schema

func (*TypedTool[I, O]) Description

func (t *TypedTool[I, O]) Description() string

Description returns the tool description

func (*TypedTool[I, O]) Name

func (t *TypedTool[I, O]) Name() string

Name returns the tool name

func (*TypedTool[I, O]) Schema

func (t *TypedTool[I, O]) Schema() Schema

Schema returns the generated JSON schema

func (*TypedTool[I, O]) ToTool

func (t *TypedTool[I, O]) ToTool() Tool

ToTool converts the typed tool to the standard Tool interface

Jump to

Keyboard shortcuts

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