Files
github--github-mcp-server/pkg/github/inventory.go
copilot-swe-agent[bot] db6cb9da1f feat: support standalone toolset metadata in inventory builder
- Added `toolsetMetadata` field to Builder for registering standalone toolset metadata
- Added `SetToolsetMetadata()` method to Builder for setting standalone metadata
- Updated `processToolsets()` to include standalone metadata in default toolsets
- Updated `NewInventory()` to register remote-only toolset metadata
- Updated test expectations to include `copilot` in defaults

This change enables toolset metadata with `Default: true` to control whether
tools in that toolset are included by default, even if no tools in the OSS
repo use that toolset. The remote server can now register tools in the
`copilot` toolset and they will automatically be included in defaults.

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-16 17:44:43 +01:00

20 lines
802 B
Go

package github
import (
"github.com/github/github-mcp-server/pkg/inventory"
"github.com/github/github-mcp-server/pkg/translations"
)
// NewInventory creates an Inventory with all available tools, resources, and prompts.
// Tools, resources, and prompts are self-describing with their toolset metadata embedded.
// This function is stateless - no dependencies are captured.
// Handlers are generated on-demand during registration via RegisterAll(ctx, server, deps).
// The "default" keyword in WithToolsets will expand to toolsets marked with Default: true.
func NewInventory(t translations.TranslationHelperFunc) *inventory.Builder {
return inventory.NewBuilder().
SetTools(AllTools(t)).
SetResources(AllResources(t)).
SetPrompts(AllPrompts(t)).
SetToolsetMetadata(RemoteOnlyToolsets())
}