tools

package
v0.27.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionPoolConfig added in v0.27.0

type ConnectionPoolConfig struct {
	MaxIdleTime         time.Duration
	MaxRetries          int
	HealthCheckInterval time.Duration
	MaxErrorCount       int
	ReconnectDelay      time.Duration
}

ConnectionPoolConfig configuration for connection pool

func DefaultConnectionPoolConfig added in v0.27.0

func DefaultConnectionPoolConfig() *ConnectionPoolConfig

DefaultConnectionPoolConfig returns default configuration

type MCPConnection added in v0.27.0

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

MCPConnection represents an MCP connection

func (*MCPConnection) ServerName added in v0.27.0

func (c *MCPConnection) ServerName() string

ServerName returns the server name for this connection

type MCPConnectionPool added in v0.27.0

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

MCPConnectionPool manages MCP connections

func NewMCPConnectionPool added in v0.27.0

func NewMCPConnectionPool(config *ConnectionPoolConfig, model model.ToolCallingChatModel) *MCPConnectionPool

NewMCPConnectionPool creates a new connection pool

func (*MCPConnectionPool) Close added in v0.27.0

func (p *MCPConnectionPool) Close() error

Close closes the connection pool

func (*MCPConnectionPool) GetClients added in v0.27.0

func (p *MCPConnectionPool) GetClients() map[string]client.MCPClient

GetClients returns all client names in the pool

func (*MCPConnectionPool) GetConnection added in v0.27.0

func (p *MCPConnectionPool) GetConnection(ctx context.Context, serverName string, serverConfig config.MCPServerConfig) (*MCPConnection, error)

GetConnection gets a connection from the pool

func (*MCPConnectionPool) GetConnectionStats added in v0.27.0

func (p *MCPConnectionPool) GetConnectionStats() map[string]interface{}

GetConnectionStats returns connection statistics

func (*MCPConnectionPool) GetConnectionWithHealthCheck added in v0.27.0

func (p *MCPConnectionPool) GetConnectionWithHealthCheck(ctx context.Context, serverName string, serverConfig config.MCPServerConfig) (*MCPConnection, error)

GetConnectionWithHealthCheck gets a connection from the pool with proactive health check

func (*MCPConnectionPool) HandleConnectionError added in v0.27.0

func (p *MCPConnectionPool) HandleConnectionError(serverName string, err error)

HandleConnectionError handles connection errors

type MCPToolManager

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

MCPToolManager manages MCP tools and clients

func NewMCPToolManager

func NewMCPToolManager() *MCPToolManager

NewMCPToolManager creates a new MCP tool manager

func (*MCPToolManager) Close

func (m *MCPToolManager) Close() error

Close closes all MCP clients

func (*MCPToolManager) GetLoadedServerNames added in v0.19.0

func (m *MCPToolManager) GetLoadedServerNames() []string

GetLoadedServerNames returns the names of successfully loaded MCP servers

func (*MCPToolManager) GetTools

func (m *MCPToolManager) GetTools() []tool.BaseTool

GetTools returns all loaded tools

func (*MCPToolManager) LoadTools

func (m *MCPToolManager) LoadTools(ctx context.Context, config *config.Config) error

LoadTools loads tools from MCP servers based on configuration

func (*MCPToolManager) SetModel added in v0.23.0

func (m *MCPToolManager) SetModel(model model.ToolCallingChatModel)

SetModel sets the LLM model for sampling support

Jump to

Keyboard shortcuts

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