MCPcopy Index your code
hub / github.com/github/github-mcp-server / CleanTools

Function CleanTools

pkg/github/tools.go:464–481  ·  view source on GitHub ↗

CleanTools cleans tool names by removing duplicates and trimming whitespace. Validation of tool existence is done during registration.

(toolNames []string)

Source from the content-addressed store, hash-verified

462// CleanTools cleans tool names by removing duplicates and trimming whitespace.
463// Validation of tool existence is done during registration.
464func CleanTools(toolNames []string) []string {
465 seen := make(map[string]bool)
466 result := make([]string, 0, len(toolNames))
467
468 // Remove duplicates and trim whitespace
469 for _, tool := range toolNames {
470 trimmed := strings.TrimSpace(tool)
471 if trimmed == "" {
472 continue
473 }
474 if !seen[trimmed] {
475 seen[trimmed] = true
476 result = append(result, trimmed)
477 }
478 }
479
480 return result
481}
482
483// GetDefaultToolsetIDs returns the IDs of toolsets marked as Default.
484// This is a convenience function that builds an inventory to determine defaults.

Callers 3

buildStaticInventoryFunction · 0.92

Calls

no outgoing calls

Tested by 1