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

Function formatToolsetName

cmd/github-mcp-server/helpers.go:7–29  ·  view source on GitHub ↗

formatToolsetName converts a toolset ID to a human-readable name. Used by both generate_docs.go and list_scopes.go for consistent formatting.

(name string)

Source from the content-addressed store, hash-verified

5// formatToolsetName converts a toolset ID to a human-readable name.
6// Used by both generate_docs.go and list_scopes.go for consistent formatting.
7func formatToolsetName(name string) string {
8 switch name {
9 case "pull_requests":
10 return "Pull Requests"
11 case "repos":
12 return "Repositories"
13 case "code_security":
14 return "Code Security"
15 case "secret_protection":
16 return "Secret Protection"
17 case "orgs":
18 return "Organizations"
19 default:
20 // Fallback: capitalize first letter and replace underscores with spaces
21 parts := strings.Split(name, "_")
22 for i, part := range parts {
23 if len(part) > 0 {
24 parts[i] = strings.ToUpper(string(part[0])) + part[1:]
25 }
26 }
27 return strings.Join(parts, " ")
28 }
29}

Callers 2

generateToolsDocFunction · 0.85
outputTextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected