Documentation
¶
Overview ¶
Package custom shows how to implement a fully custom MCP tool and register it with a server.
Index ¶
- func New(config *Config) protoserver.NewHandler
- type Config
- type Handler
- func (i *Handler) Implements(method string) bool
- func (i *Handler) ListResources(ctx context.Context, ...) (*schema.ListResourcesResult, *jsonrpc.Error)
- func (i *Handler) ReadResource(ctx context.Context, ...) (*schema.ReadResourceResult, *jsonrpc.Error)
- func (i *Handler) Subscribe(ctx context.Context, request *jsonrpc.TypedRequest[*schema.SubscribeRequest]) (*schema.SubscribeResult, *jsonrpc.Error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶ added in v0.4.2
type Handler struct {
*protoserver.DefaultHandler
// contains filtered or unexported fields
}
func (*Handler) Implements ¶ added in v0.4.2
Implements returns true if the method is supported by this implementer
func (*Handler) ListResources ¶ added in v0.4.2
func (i *Handler) ListResources(ctx context.Context, request *jsonrpc.TypedRequest[*schema.ListResourcesRequest]) (*schema.ListResourcesResult, *jsonrpc.Error)
func (*Handler) ReadResource ¶ added in v0.4.2
func (i *Handler) ReadResource(ctx context.Context, request *jsonrpc.TypedRequest[*schema.ReadResourceRequest]) (*schema.ReadResourceResult, *jsonrpc.Error)
func (*Handler) Subscribe ¶ added in v0.4.2
func (i *Handler) Subscribe(ctx context.Context, request *jsonrpc.TypedRequest[*schema.SubscribeRequest]) (*schema.SubscribeResult, *jsonrpc.Error)
Subscribe adds the URI to the subscription map.
Click to show internal directories.
Click to hide internal directories.