Documentation
¶
Index ¶
- type Client
- func (c *Client) CallTool(ctx context.Context, server *mcp.Server, toolName string, ...) ToolCallResult
- func (c *Client) CheckHealth(ctx context.Context, server *mcp.Server) HealthResult
- func (c *Client) ListTools(ctx context.Context, server *mcp.Server) ([]Tool, error)
- func (c *Client) WithTimeout(d time.Duration) *Client
- type HealthResult
- type Tool
- type ToolCallResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the MCP SDK client for health checks and tool discovery
func (*Client) CallTool ¶
func (c *Client) CallTool(ctx context.Context, server *mcp.Server, toolName string, arguments map[string]any) ToolCallResult
CallTool connects to a server and calls a specific tool with arguments
func (*Client) CheckHealth ¶
CheckHealth performs a health check on an MCP server It connects, performs the initialize handshake, and optionally lists tools
type HealthResult ¶
type HealthResult struct {
Healthy bool `json:"healthy"`
ServerName string `json:"serverName,omitempty"`
Version string `json:"version,omitempty"`
Tools []Tool `json:"tools,omitempty"`
Error error `json:"error,omitempty"`
Latency time.Duration `json:"latency"`
}
HealthResult represents the result of a health check
type ToolCallResult ¶
type ToolCallResult struct {
Success bool `json:"success"`
Content []string `json:"content,omitempty"` // Text content from the result
IsError bool `json:"isError,omitempty"`
Error error `json:"error,omitempty"`
Latency time.Duration `json:"latency"`
}
ToolCallResult represents the result of calling a tool
Click to show internal directories.
Click to hide internal directories.