Documentation
¶
Index ¶
- func EnsureBuiltinScripts(configDir string) error
- func IsMCPToolName(name string) bool
- func NormalizeToolName(sourceID, toolName string) string
- func ParseNormalizedToolName(name string) (string, string, bool)
- type Runtime
- func (r *Runtime) CallTool(ctx context.Context, normalizedName string, arguments string) (string, error)
- func (r *Runtime) Close()
- func (r *Runtime) GetConfig() *typ.MCPRuntimeConfig
- func (r *Runtime) ListOpenAITools(ctx context.Context) []openai.ChatCompletionToolUnionParam
- func (r *Runtime) ListSourceTools(ctx context.Context) (map[string][]SourceTool, error)
- type SourceTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureBuiltinScripts ¶
EnsureBuiltinScripts copies bundled MCP scripts to <configDir>/mcp. This guarantees stdio MCP scripts are available at a stable path for runtime config.
func IsMCPToolName ¶
IsMCPToolName checks whether a tool name is a normalized MCP tool.
func NormalizeToolName ¶
NormalizeToolName converts source/tool pair to normalized tool name.
Types ¶
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime handles MCP tool source discovery and tool execution.
func NewRuntime ¶
func NewRuntime(getConfig configProvider) *Runtime
NewRuntime creates a new MCP runtime.
func (*Runtime) CallTool ¶
func (r *Runtime) CallTool(ctx context.Context, normalizedName string, arguments string) (string, error)
CallTool executes a normalized MCP tool call and returns serialized result.
func (*Runtime) GetConfig ¶ added in v0.260414.2000
func (r *Runtime) GetConfig() *typ.MCPRuntimeConfig
GetConfig returns the current MCP runtime configuration.
func (*Runtime) ListOpenAITools ¶
func (r *Runtime) ListOpenAITools(ctx context.Context) []openai.ChatCompletionToolUnionParam
ListOpenAITools returns all MCP tools in normalized OpenAI function-tool format.
func (*Runtime) ListSourceTools ¶ added in v0.260414.2000
ListSourceTools returns all MCP tools grouped by source with their original names. This is used by local mode to expose tools to external MCP clients.
type SourceTool ¶ added in v0.260414.2000
type SourceTool struct {
SourceID string
SourceName string
Name string
Description string
InputSchema json.RawMessage
}
SourceTool represents a tool from a specific MCP source with its original name.