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

Method AvailableToolsets

pkg/inventory/registry.go:317–340  ·  view source on GitHub ↗

AvailableToolsets returns the unique toolsets that have tools, in sorted order. This is the ordered intersection of toolsets with reality - only toolsets that actually contain tools are returned, sorted by toolset ID. Optional exclude parameter filters out specific toolset IDs from the result.

(exclude ...ToolsetID)

Source from the content-addressed store, hash-verified

315// actually contain tools are returned, sorted by toolset ID.
316// Optional exclude parameter filters out specific toolset IDs from the result.
317func (r *Inventory) AvailableToolsets(exclude ...ToolsetID) []ToolsetMetadata {
318 tools := r.AllTools()
319 if len(tools) == 0 {
320 return nil
321 }
322
323 // Build exclude set for O(1) lookup
324 excludeSet := make(map[ToolsetID]bool, len(exclude))
325 for _, id := range exclude {
326 excludeSet[id] = true
327 }
328
329 var result []ToolsetMetadata
330 var lastID ToolsetID
331 for _, tool := range tools {
332 if tool.Toolset.ID != lastID {
333 lastID = tool.Toolset.ID
334 if !excludeSet[lastID] {
335 result = append(result, tool.Toolset)
336 }
337 }
338 }
339 return result
340}
341
342// EnabledToolsets returns the unique toolsets that are enabled based on current filters.
343// This is similar to AvailableToolsets but respects the enabledToolsets filter.

Callers 6

EnabledToolsetsMethod · 0.95
GenerateToolsetsHelpFunction · 0.80
TestAllToolsetIconsExistFunction · 0.80
generateToolsetsDocFunction · 0.80

Calls 1

AllToolsMethod · 0.95

Tested by 2

TestAllToolsetIconsExistFunction · 0.64