MCPcopy Create free account
hub / github.com/github/gh-aw / getGitHubToolsets

Function getGitHubToolsets

pkg/workflow/mcp_github_config.go:194–208  ·  view source on GitHub ↗

getGitHubToolsets extracts the toolsets configuration from GitHub tool Expands "default" to individual toolsets for action-friendly compatibility

(githubTool map[string]any)

Source from the content-addressed store, hash-verified

192// getGitHubToolsets extracts the toolsets configuration from GitHub tool
193// Expands "default" to individual toolsets for action-friendly compatibility
194func getGitHubToolsets(githubTool map[string]any) string {
195 if toolsetsSetting, exists := githubTool["toolsets"]; exists {
196 // Handle array format only
197 if toolsets := parseStringSliceAny(toolsetsSetting, githubConfigLog); toolsets != nil {
198 toolsetsStr := strings.Join(toolsets, ",")
199 // Expand "default" to individual toolsets for action-friendly compatibility
200 resolved := expandDefaultToolset(toolsetsStr)
201 githubConfigLog.Printf("GitHub MCP toolsets resolved: %s", resolved)
202 return resolved
203 }
204 }
205 // default to action-friendly toolsets (excludes "users" which GitHub Actions tokens don't support)
206 githubConfigLog.Print("GitHub MCP toolsets: using default action-friendly toolsets")
207 return strings.Join(ActionFriendlyGitHubToolsets, ",")
208}
209
210// expandDefaultToolset expands "default" and "action-friendly" keywords to individual toolsets.
211// This ensures that "default" and "action-friendly" in the source expand to action-friendly toolsets

Callers 4

TestGetGitHubToolsetsFunction · 0.85
RenderGitHubMCPMethod · 0.85
renderGitHubTOMLMethod · 0.85

Calls 4

parseStringSliceAnyFunction · 0.85
expandDefaultToolsetFunction · 0.85
PrintMethod · 0.80
PrintfMethod · 0.45

Tested by 2

TestGetGitHubToolsetsFunction · 0.68