MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / LoadDefault

Function LoadDefault

internal/tools/registry.go:82–92  ·  view source on GitHub ↗

LoadDefault returns a Registry from the user's tools.yaml when present, or the bundled defaults when not.

()

Source from the content-addressed store, hash-verified

80// LoadDefault returns a Registry from the user's tools.yaml when present, or
81// the bundled defaults when not.
82func LoadDefault() (*Registry, error) {
83 userPath := filepath.Join(pathutil.ConfigDir(), "tools.yaml")
84 if pathutil.Exists(userPath) {
85 data, err := os.ReadFile(userPath)
86 if err != nil {
87 return nil, fmt.Errorf("tools: read %s: %w", userPath, err)
88 }
89 return parseRegistry(data)
90 }
91 return parseRegistry(bundledYAML)
92}
93
94func parseRegistry(data []byte) (*Registry, error) {
95 var raw struct {

Callers 9

ListMethod · 0.92
loadToolFunction · 0.92
lifecycleCommandMethod · 0.92
applyCommandMethod · 0.92
launchCommandMethod · 0.92
loadToolFromRegistryFunction · 0.85

Calls 4

ConfigDirFunction · 0.92
ExistsFunction · 0.92
parseRegistryFunction · 0.85
ReadFileMethod · 0.80