Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPromptNotFound = NewError("prompt not found", -32000) ErrResourceNotFound = NewError("resource not found", -32001) ErrToolNotFound = NewError("tool not found", -32002) ErrNotImplemented = NewError("not implemented", -32003) )
Common errors
Functions ¶
This section is empty.
Types ¶
type Error ¶
Error represents a protocol error with a code and message
type PromptProvider ¶
type PromptProvider interface {
// ListPrompts returns a list of available prompts with optional pagination
ListPrompts(ctx context.Context, cursor string) ([]protocol.Prompt, string, error)
// GetPrompt retrieves a specific prompt with the given arguments
GetPrompt(ctx context.Context, name string, arguments map[string]string) (*protocol.PromptMessage, error)
}
PromptProvider defines the interface for serving prompts
type ResourceProvider ¶
type ResourceProvider interface {
// ListResources returns a list of available resources with optional pagination
ListResources(ctx context.Context, cursor string) ([]protocol.Resource, string, error)
// ReadResource retrieves the contents of a specific resource
ReadResource(ctx context.Context, uri string) ([]protocol.ResourceContent, error)
// ListResourceTemplates returns a list of available resource templates
ListResourceTemplates(ctx context.Context) ([]protocol.ResourceTemplate, error)
// SubscribeToResource registers for notifications about resource changes
// Returns a channel that will receive notifications and a cleanup function
SubscribeToResource(ctx context.Context, uri string) (chan struct{}, func(), error)
}
ResourceProvider defines the interface for serving resources
type ToolProvider ¶
type ToolProvider interface {
// ListTools returns a list of available tools with optional pagination
ListTools(ctx context.Context, cursor string) ([]protocol.Tool, string, error)
// CallTool invokes a specific tool with the given arguments
CallTool(ctx context.Context, name string, arguments map[string]interface{}) (*protocol.ToolResult, error)
}
ToolProvider defines the interface for serving tools
Directories
¶
| Path | Synopsis |
|---|---|
|
examples/basic
command
|
|
|
examples/enhanced
command
|
|
|
examples/session
command
|
|
|
examples/struct
command
|
|
|
mcp
|
|
|
scholarly
|
|
|
ui
|
|
Click to show internal directories.
Click to hide internal directories.