MCPcopy Create free account
hub / github.com/github/github-mcp-server / ResolveToolAliases

Method ResolveToolAliases

pkg/inventory/registry.go:266–279  ·  view source on GitHub ↗

ResolveToolAliases resolves deprecated tool aliases to their canonical names. It logs a warning to stderr for each deprecated alias that is resolved. Returns: - resolved: tool names with aliases replaced by canonical names - aliasesUsed: map of oldName → newName for each alias that was resolved

(toolNames []string)

Source from the content-addressed store, hash-verified

264// - resolved: tool names with aliases replaced by canonical names
265// - aliasesUsed: map of oldName → newName for each alias that was resolved
266func (r *Inventory) ResolveToolAliases(toolNames []string) (resolved []string, aliasesUsed map[string]string) {
267 resolved = make([]string, 0, len(toolNames))
268 aliasesUsed = make(map[string]string)
269 for _, toolName := range toolNames {
270 if canonicalName, isAlias := r.deprecatedAliases[toolName]; isAlias {
271 fmt.Fprintf(os.Stderr, "Warning: tool %q is deprecated, use %q instead\n", toolName, canonicalName)
272 aliasesUsed[toolName] = canonicalName
273 resolved = append(resolved, canonicalName)
274 } else {
275 resolved = append(resolved, toolName)
276 }
277 }
278 return resolved, aliasesUsed
279}
280
281// FindToolByName searches all tools for one matching the given name.
282// Returns the tool, its toolset ID, and an error if not found.

Callers 2

TestResolveToolAliasesFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestResolveToolAliasesFunction · 0.64