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

Function attachSearchRepositoriesIFCLabel

pkg/github/search.go:181–192  ·  view source on GitHub ↗

attachSearchRepositoriesIFCLabel joins per-repository IFC labels across every matched repository and attaches the result to callResult when IFC labels are enabled. Visibility is read directly from the search response — no extra API call. The join math is shared with search_issues via ifc.LabelSearch

(ctx context.Context, deps ToolDependencies, repos []*github.Repository, callResult *mcp.CallToolResult)

Source from the content-addressed store, hash-verified

179// feature-flag check is centralized here (mirroring the attach* helpers in
180// ifc_labels.go) so the handler can call this unconditionally.
181func attachSearchRepositoriesIFCLabel(ctx context.Context, deps ToolDependencies, repos []*github.Repository, callResult *mcp.CallToolResult) {
182 if callResult == nil || callResult.IsError || !deps.IsFeatureEnabled(ctx, FeatureFlagIFCLabels) {
183 return
184 }
185
186 visibilities := make([]bool, 0, len(repos))
187 for _, repo := range repos {
188 visibilities = append(visibilities, repo.GetPrivate())
189 }
190
191 setIFCLabel(callResult, ifc.LabelSearchIssues(visibilities))
192}
193
194// SearchCode creates a tool to search for code across GitHub repositories.
195func SearchCode(t translations.TranslationHelperFunc) inventory.ServerTool {

Callers 1

SearchRepositoriesFunction · 0.85

Calls 3

LabelSearchIssuesFunction · 0.92
setIFCLabelFunction · 0.85
IsFeatureEnabledMethod · 0.65

Tested by

no test coverage detected