Documentation
¶
Index ¶
- func ToolName(serverID, toolName string) string
- func ValidateServerConfig(id string, cfg config.MCPServer) error
- type Manager
- func (m *Manager) Close() error
- func (m *Manager) ConnectAll(ctx context.Context) error
- func (m *Manager) ConnectServer(ctx context.Context, id string) error
- func (m *Manager) DisconnectServer(id string) error
- func (m *Manager) ExecuteTool(ctx context.Context, serverID, toolName string, args map[string]any) (tools.Result, error)
- func (m *Manager) ExposedToolName(serverID, toolName string, reserved []provider.ToolDefinition) (string, bool)
- func (m *Manager) GetPrompt(ctx context.Context, serverID, name string, args map[string]string) (PromptResult, error)
- func (m *Manager) ListPrompts(serverID string) []PromptDescriptor
- func (m *Manager) ListResourceTemplates(serverID string) []ResourceTemplateDescriptor
- func (m *Manager) ListResources(serverID string) []ResourceDescriptor
- func (m *Manager) ListServers() []ServerState
- func (m *Manager) ListTools() []ToolDescriptor
- func (m *Manager) LoadConfig(cfgs map[string]config.MCPServer) error
- func (m *Manager) ReadResource(ctx context.Context, serverID, uri string) (ResourceReadResult, error)
- func (m *Manager) ResolveToolName(name string, reserved []provider.ToolDefinition) (serverID, toolName string, ok bool)
- func (m *Manager) ToolDefinitions() []provider.ToolDefinition
- func (m *Manager) ToolDefinitionsWithReserved(reserved []provider.ToolDefinition) []provider.ToolDefinition
- type PromptArgumentDescriptor
- type PromptDescriptor
- type PromptMessage
- type PromptResult
- type ResourceDescriptor
- type ResourceReadResult
- type ResourceTemplateDescriptor
- type ServerState
- type ServerStatus
- type ToolDescriptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) Close ¶
Close disconnects every configured MCP server and releases persistent transports.
func (*Manager) ConnectServer ¶
func (*Manager) DisconnectServer ¶
func (*Manager) ExecuteTool ¶
func (*Manager) ExposedToolName ¶
func (m *Manager) ExposedToolName(serverID, toolName string, reserved []provider.ToolDefinition) (string, bool)
ExposedToolName returns the provider-facing name currently assigned to one MCP tool. It uses the same collision rules as ToolDefinitionsWithReserved so persisted MCP calls can be replayed under the name the model can call.
func (*Manager) ListPrompts ¶
func (m *Manager) ListPrompts(serverID string) []PromptDescriptor
func (*Manager) ListResourceTemplates ¶
func (m *Manager) ListResourceTemplates(serverID string) []ResourceTemplateDescriptor
func (*Manager) ListResources ¶
func (m *Manager) ListResources(serverID string) []ResourceDescriptor
func (*Manager) ListServers ¶
func (m *Manager) ListServers() []ServerState
func (*Manager) ListTools ¶
func (m *Manager) ListTools() []ToolDescriptor
func (*Manager) ReadResource ¶
func (*Manager) ResolveToolName ¶
func (*Manager) ToolDefinitions ¶
func (m *Manager) ToolDefinitions() []provider.ToolDefinition
func (*Manager) ToolDefinitionsWithReserved ¶
func (m *Manager) ToolDefinitionsWithReserved(reserved []provider.ToolDefinition) []provider.ToolDefinition
type PromptDescriptor ¶
type PromptMessage ¶
type PromptResult ¶
type PromptResult struct {
Description string
Messages []PromptMessage
}
type ResourceDescriptor ¶
type ResourceReadResult ¶
type ResourceReadResult struct {
Contents []tools.MCPStoredContentItem
}
type ServerState ¶
type ServerState struct {
ID string
Name string
URL string
Status ServerStatus
Disabled bool
LastError string
SessionID string
ServerInstructions string
ToolCount int
ResourceCount int
ResourceTemplateCount int
PromptCount int
Tools []ToolDescriptor
Resources []ResourceDescriptor
ResourceTemplates []ResourceTemplateDescriptor
Prompts []PromptDescriptor
}
type ServerStatus ¶
type ServerStatus string
const ( ServerStatusDisconnected ServerStatus = "disconnected" ServerStatusConnecting ServerStatus = "connecting" ServerStatusConnected ServerStatus = "connected" ServerStatusError ServerStatus = "error" ServerStatusDisabled ServerStatus = "disabled" )
Click to show internal directories.
Click to hide internal directories.