MCPcopy
hub / github.com/github/github-mcp-server / cleanTools

Function cleanTools

pkg/inventory/builder.go:188–202  ·  view source on GitHub ↗

cleanTools trims whitespace and removes duplicates from tool names. Empty strings after trimming are excluded.

(tools []string)

Source from the content-addressed store, hash-verified

186// cleanTools trims whitespace and removes duplicates from tool names.
187// Empty strings after trimming are excluded.
188func cleanTools(tools []string) []string {
189 seen := make(map[string]bool)
190 var cleaned []string
191 for _, name := range tools {
192 trimmed := strings.TrimSpace(name)
193 if trimmed == "" {
194 continue
195 }
196 if !seen[trimmed] {
197 seen[trimmed] = true
198 cleaned = append(cleaned, trimmed)
199 }
200 }
201 return cleaned
202}
203
204// Build creates the final Inventory with all configuration applied.
205// This processes toolset filtering, tool name resolution, and sets up

Callers 2

WithExcludeToolsMethod · 0.85
BuildMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected