Documentation
¶
Index ¶
- Variables
- func IsUnsupported(err error) bool
- type CallToolResult
- type Clock
- type Content
- type ListResourceTemplatesRequest
- type ListResourceTemplatesResult
- type ListResourcesRequest
- type ListResourcesResult
- type Manager
- func (m *Manager) CallTool(ctx context.Context, server string, tool string, args json.RawMessage) (CallToolResult, error)
- func (m *Manager) EnsureStarted(ctx context.Context, name string) (ServerStatus, error)
- func (m *Manager) List() []ServerStatus
- func (m *Manager) ListResourceTemplates(ctx context.Context, server string, req ListResourceTemplatesRequest) (ListResourceTemplatesResult, error)
- func (m *Manager) ListResources(ctx context.Context, server string, req ListResourcesRequest) (ListResourcesResult, error)
- func (m *Manager) ListTools(ctx context.Context, name string) ([]Tool, error)
- func (m *Manager) ReadResource(ctx context.Context, server string, req ReadResourceRequest) (ReadResourceResult, error)
- func (m *Manager) Register(cfg ServerConfig) error
- func (m *Manager) Stop(ctx context.Context, name string) error
- func (m *Manager) StopIdle(ctx context.Context) error
- type RPCError
- type ReadResourceRequest
- type ReadResourceResult
- type ResourceClient
- type ResourceContent
- type ResourceDescriptor
- type ResourceTemplateDescriptor
- type ServerConfig
- type ServerStatus
- type Tool
- type ToolAnnotations
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func IsUnsupported ¶
Types ¶
type CallToolResult ¶
type CallToolResult struct {
Content []Content `json:"content"`
IsError bool `json:"isError,omitempty"`
Raw json.RawMessage `json:"-"`
}
type ListResourceTemplatesRequest ¶
type ListResourceTemplatesRequest struct {
Cursor string `json:"cursor,omitempty"`
}
type ListResourceTemplatesResult ¶
type ListResourceTemplatesResult struct {
ResourceTemplates []ResourceTemplateDescriptor `json:"resourceTemplates"`
NextCursor string `json:"nextCursor,omitempty"`
Raw json.RawMessage `json:"-"`
}
type ListResourcesRequest ¶
type ListResourcesRequest struct {
Cursor string `json:"cursor,omitempty"`
}
type ListResourcesResult ¶
type ListResourcesResult struct {
Resources []ResourceDescriptor `json:"resources"`
NextCursor string `json:"nextCursor,omitempty"`
Raw json.RawMessage `json:"-"`
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) CallTool ¶
func (m *Manager) CallTool(ctx context.Context, server string, tool string, args json.RawMessage) (CallToolResult, error)
func (*Manager) EnsureStarted ¶
func (*Manager) List ¶
func (m *Manager) List() []ServerStatus
func (*Manager) ListResourceTemplates ¶
func (m *Manager) ListResourceTemplates(ctx context.Context, server string, req ListResourceTemplatesRequest) (ListResourceTemplatesResult, error)
func (*Manager) ListResources ¶
func (m *Manager) ListResources(ctx context.Context, server string, req ListResourcesRequest) (ListResourcesResult, error)
func (*Manager) ReadResource ¶
func (m *Manager) ReadResource(ctx context.Context, server string, req ReadResourceRequest) (ReadResourceResult, error)
func (*Manager) Register ¶
func (m *Manager) Register(cfg ServerConfig) error
type ReadResourceRequest ¶
type ReadResourceRequest struct {
URI string `json:"uri"`
}
type ReadResourceResult ¶
type ReadResourceResult struct {
Contents []ResourceContent `json:"contents"`
Raw json.RawMessage `json:"-"`
}
type ResourceClient ¶
type ResourceClient interface {
ListResources(ctx context.Context, server string, req ListResourcesRequest) (ListResourcesResult, error)
ReadResource(ctx context.Context, server string, req ReadResourceRequest) (ReadResourceResult, error)
ListResourceTemplates(ctx context.Context, server string, req ListResourceTemplatesRequest) (ListResourceTemplatesResult, error)
}
ResourceClient is the stable seam callers use for MCP resource discovery and reads.
type ResourceContent ¶
type ResourceDescriptor ¶
type ServerConfig ¶
type ServerStatus ¶
type Tool ¶
type Tool struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
InputSchema json.RawMessage `json:"inputSchema,omitempty"`
Annotations ToolAnnotations `json:"annotations,omitempty"`
}
type ToolAnnotations ¶ added in v0.0.2
type ToolAnnotations struct {
ReadOnlyHint *bool `json:"readOnlyHint,omitempty"`
}
ToolAnnotations are the server's self-reported behavioral hints. They are UNTRUSTED — a server declaring a destructive tool read-only would otherwise talk its way past a read-only approval tier — so consumers may only act on them in the restrictive direction: honor readOnlyHint:true as a downgrade to read, and treat everything else (absent, false, or unparseable) as the stricter class.
func (ToolAnnotations) IsReadOnly ¶ added in v0.0.2
func (a ToolAnnotations) IsReadOnly() bool
IsReadOnly reports an explicit readOnlyHint:true. Absent or false is not read-only.
Click to show internal directories.
Click to hide internal directories.