mcpruntime

package
v0.26041.1000-preview Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2026 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureBuiltinScripts

func EnsureBuiltinScripts(configDir string) error

EnsureBuiltinScripts copies bundled MCP scripts to <configDir>/mcp. This guarantees stdio MCP scripts are available at a stable path for runtime config.

func IsMCPToolName

func IsMCPToolName(name string) bool

IsMCPToolName checks whether a tool name is a normalized MCP tool.

func NormalizeToolName

func NormalizeToolName(sourceID, toolName string) string

NormalizeToolName converts source/tool pair to normalized tool name.

func ParseNormalizedToolName

func ParseNormalizedToolName(name string) (string, string, bool)

ParseNormalizedToolName parses normalized name and returns sourceID/toolName.

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) Close

func (r *Runtime) Close()

Close releases all MCP sessions.

func (*Runtime) ListOpenAITools

func (r *Runtime) ListOpenAITools(ctx context.Context) []openai.ChatCompletionToolUnionParam

ListOpenAITools returns all MCP tools in normalized OpenAI function-tool format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL