Documentation
¶
Index ¶
- type Pool
- func (p *Pool) CallTool(ctx context.Context, server, tool string, args map[string]any) (*mcp.CallToolResult, error)
- func (p *Pool) Close() error
- func (p *Pool) Connect(ctx context.Context, name string, ref *mcpconfig.MCPServerRef) error
- func (p *Pool) Disconnect(name string) error
- func (p *Pool) ListTools(ctx context.Context, server string) ([]mcp.Tool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool manages a set of named MCP client sessions. It is safe for concurrent use: sessions can be connected, queried, and disconnected from multiple goroutines.
func (*Pool) CallTool ¶
func (p *Pool) CallTool(ctx context.Context, server, tool string, args map[string]any) (*mcp.CallToolResult, error)
CallTool invokes a tool by name on a connected server with the given args.
func (*Pool) Close ¶
Close disconnects all sessions and drains the pool. Errors from individual sessions are collected and returned together.
func (*Pool) Connect ¶
Connect creates a new MCP client session for the given server ref. It returns an error if the name is already connected or if the transport handshake fails.
func (*Pool) Disconnect ¶
Disconnect closes the session for the named server and removes it from the pool.
Click to show internal directories.
Click to hide internal directories.