MCPcopy Index your code
hub / github.com/docker/docker-agent / nameFor

Function nameFor

pkg/runtime/runtime.go:1098–1103  ·  view source on GitHub ↗

nameFor picks a stable, user-visible name for a toolset. We look for any inner toolset that implements tools.Named (walked via tools.As so wrappers like StartableToolSet are transparent). The registry adds a WithName wrapper for every built-in toolset so this is reachable for almost every toolset; f

(ts tools.ToolSet, fallback string)

Source from the content-addressed store, hash-verified

1096// almost every toolset; fallback uses the description ("mcp(stdio cmd=...)"),
1097// which is still better than the Go type name.
1098func nameFor(ts tools.ToolSet, fallback string) string {
1099 if name := tools.GetName(ts); name != "" {
1100 return name
1101 }
1102 return fallback
1103}
1104
1105// CurrentMCPPrompts returns the available MCP prompts from all active MCP toolsets
1106// for the current agent. It discovers prompts by calling ListPrompts on each MCP toolset

Callers 3

nameForTestFunction · 0.85
RestartToolsetMethod · 0.85
toolsetStatusForFunction · 0.85

Calls 1

GetNameFunction · 0.92

Tested by 1

nameForTestFunction · 0.68