Versions in this module Expand all Collapse all v0 v0.1.0 Apr 15, 2025 Changes in this version + type Client struct + func (c *Client) CreateMessage(ctx context.Context, params *schema.CreateMessageRequestParams) (*schema.CreateMessageResult, *jsonrpc.Error) + func (c *Client) ListRoots(ctx context.Context, params *schema.ListRootsRequestParams) (*schema.ListRootsResult, *jsonrpc.Error) + type Handler struct + func (h *Handler) CallTool(ctx context.Context, request *jsonrpc.Request) (*schema.CallToolResult, *jsonrpc.Error) + func (h *Handler) Cancel(ctx context.Context, notification *jsonrpc.Notification) *jsonrpc.Error + func (h *Handler) Complete(ctx context.Context, request *jsonrpc.Request) (*schema.CompleteResult, *jsonrpc.Error) + func (h *Handler) GetPrompt(ctx context.Context, request *jsonrpc.Request) (*schema.GetPromptResult, *jsonrpc.Error) + func (h *Handler) Initialize(ctx context.Context, request *jsonrpc.Request) (*schema.InitializeResult, *jsonrpc.Error) + func (h *Handler) ListPrompts(ctx context.Context, request *jsonrpc.Request) (*schema.ListPromptsResult, *jsonrpc.Error) + func (h *Handler) ListResourceTemplates(ctx context.Context, request *jsonrpc.Request) (*schema.ListResourceTemplatesResult, *jsonrpc.Error) + func (h *Handler) ListResources(ctx context.Context, request *jsonrpc.Request) (*schema.ListResourcesResult, *jsonrpc.Error) + func (h *Handler) ListTools(ctx context.Context, request *jsonrpc.Request) (*schema.ListToolsResult, *jsonrpc.Error) + func (h *Handler) OnNotification(ctx context.Context, notification *jsonrpc.Notification) + func (h *Handler) Ping(ctx context.Context, request *jsonrpc.Request) (*schema.PingResult, *jsonrpc.Error) + func (h *Handler) ReadResource(ctx context.Context, request *jsonrpc.Request) (*schema.ReadResourceResult, *jsonrpc.Error) + func (h *Handler) Serve(parent context.Context, request *jsonrpc.Request, response *jsonrpc.Response) + func (h *Handler) SetLevel(ctx context.Context, request *jsonrpc.Request) (*schema.SetLevelResult, *jsonrpc.Error) + func (h *Handler) Subscribe(ctx context.Context, request *jsonrpc.Request) (*schema.SubscribeResult, *jsonrpc.Error) + func (h *Handler) Unsubscribe(ctx context.Context, request *jsonrpc.Request) (*schema.UnsubscribeResult, *jsonrpc.Error) + type Implementer interface + Implements func(method string) bool + OnNotification func(ctx context.Context, notification *jsonrpc.Notification) + type Logger struct + func NewLogger(name string, level *schema.LoggingLevel, notifier transport.Notifier) *Logger + func (l *Logger) Alert(ctx context.Context, data interface{}) error + func (l *Logger) Critical(ctx context.Context, data interface{}) error + func (l *Logger) Debug(ctx context.Context, data interface{}) error + func (l *Logger) Emergency(ctx context.Context, data interface{}) error + func (l *Logger) Error(ctx context.Context, data interface{}) error + func (l *Logger) Info(ctx context.Context, data interface{}) error + func (l *Logger) Logger(name string) logger.Logger + func (l *Logger) Notice(ctx context.Context, data interface{}) error + func (l *Logger) Warning(ctx context.Context, data interface{}) error + type NewImplementer func(ctx context.Context, notifier transport.Notifier, logger logger.Logger, ...) Implementer + type Operations interface + CallTool func(ctx context.Context, request *schema.CallToolRequest) (*schema.CallToolResult, *jsonrpc.Error) + Complete func(ctx context.Context, request *schema.CompleteRequest) (*schema.CompleteResult, *jsonrpc.Error) + GetPrompt func(ctx context.Context, request *schema.GetPromptRequest) (*schema.GetPromptResult, *jsonrpc.Error) + Initialize func(ctx context.Context, init *schema.InitializeRequestParams, ...) + ListPrompts func(ctx context.Context, request *schema.ListPromptsRequest) (*schema.ListPromptsResult, *jsonrpc.Error) + ListResourceTemplates func(ctx context.Context, request *schema.ListResourceTemplatesRequest) (*schema.ListResourceTemplatesResult, *jsonrpc.Error) + ListResources func(ctx context.Context, request *schema.ListResourcesRequest) (*schema.ListResourcesResult, *jsonrpc.Error) + ListTools func(ctx context.Context, request *schema.ListToolsRequest) (*schema.ListToolsResult, *jsonrpc.Error) + ReadResource func(ctx context.Context, request *schema.ReadResourceRequest) (*schema.ReadResourceResult, *jsonrpc.Error) + Subscribe func(ctx context.Context, request *schema.SubscribeRequest) (*schema.SubscribeResult, *jsonrpc.Error) + Unsubscribe func(ctx context.Context, request *schema.UnsubscribeRequest) (*schema.UnsubscribeResult, *jsonrpc.Error) + type Option func(s *Server) + func WithCapabilities(capabilities schema.ServerCapabilities) Option + func WithImplementation(implementation schema.Implementation) Option + func WithLoggerName(name string) Option + func WithNewImplementer(newImplementer NewImplementer) Option + type Server struct + func New(options ...Option) (*Server, error) + func (s *Server) HTTP(ctx context.Context, addr string) *http.Server + func (s *Server) NewHandler(ctx context.Context, transport transport.Transport) transport.Handler + func (s *Server) Stdio(ctx context.Context) *stdio.Server