ws

package
v0.0.0-...-1267af6 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchRequest

type BatchRequest struct {
	Method string
	Params interface{}
}

BatchRequest represents a single request in a batch

type BatchResponse

type BatchResponse struct {
	Result json.RawMessage
	Error  *types.MCPError
}

BatchResponse represents a single response in a batch

type WebSocketClient

type WebSocketClient struct {
	transport.BaseTransport
	*client.BaseClient
	// contains filtered or unexported fields
}

WebSocketClient implements a WebSocket-based MCP client

func NewWebSocketClient

func NewWebSocketClient(url string) (*WebSocketClient, error)

func (*WebSocketClient) Close

func (c *WebSocketClient) Close() error

func (*WebSocketClient) ExecuteTool

func (c *WebSocketClient) ExecuteTool(ctx context.Context, toolCall types.ToolCall) (*types.ToolResult, error)

func (*WebSocketClient) Initialize

func (c *WebSocketClient) Initialize(ctx context.Context) error

func (*WebSocketClient) ListTools

func (c *WebSocketClient) ListTools(ctx context.Context) ([]types.Tool, error)

ListTools returns a list of available tools

func (*WebSocketClient) SendBatchRequest

func (c *WebSocketClient) SendBatchRequest(ctx context.Context, requests []BatchRequest) ([]BatchResponse, error)

SendBatchRequest sends multiple requests in a single batch

func (*WebSocketClient) SendRequest

func (c *WebSocketClient) SendRequest(ctx context.Context, method string, params interface{}) (*types.Response, error)

func (*WebSocketClient) SetInitializeParams

func (c *WebSocketClient) SetInitializeParams(params *types.InitializeParams)

Jump to

Keyboard shortcuts

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