Documentation
¶
Index ¶
- func GetSessionID(ctx context.Context) (string, bool)
- func MustGetSessionID(ctx context.Context) string
- func NewErrorResponse(id json.RawMessage, code int, message string, data interface{}) (*protocol.Response, error)
- func NewSuccessResponse(id json.RawMessage, result interface{}) (*protocol.Response, error)
- func WithSessionID(ctx context.Context, sessionID string) context.Context
- type Dispatcher
- type ListPromptsResult
- type ListResourcesResult
- type ListToolsResult
- type PromptResult
- type ResourceResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSessionID ¶
GetSessionID retrieves the session ID from the context
func MustGetSessionID ¶
MustGetSessionID retrieves the session ID from the context, panicking if not found
func NewErrorResponse ¶
func NewErrorResponse(id json.RawMessage, code int, message string, data interface{}) (*protocol.Response, error)
NewErrorResponse creates a new error response
func NewSuccessResponse ¶
func NewSuccessResponse(id json.RawMessage, result interface{}) (*protocol.Response, error)
NewSuccessResponse creates a new success response with the given result
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher handles the MCP protocol methods and dispatches them to appropriate services
func NewDispatcher ¶
func NewDispatcher( logger zerolog.Logger, ps services.PromptService, rs services.ResourceService, ts services.ToolService, is services.InitializeService, ) *Dispatcher
NewDispatcher creates a new dispatcher instance
type ListPromptsResult ¶
type ListPromptsResult struct { Prompts []protocol.Prompt `json:"prompts"` NextCursor string `json:"nextCursor"` }
Common result types
type ListResourcesResult ¶
type ListToolsResult ¶
type PromptResult ¶
type PromptResult struct { Description string `json:"description"` Messages []protocol.PromptMessage `json:"messages"` }
type ResourceResult ¶
type ResourceResult struct {
Contents []protocol.ResourceContent `json:"contents"`
}
Click to show internal directories.
Click to hide internal directories.