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

Function TestWithToolsResolvesAliases

pkg/inventory/registry_test.go:590–610  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

588}
589
590func TestWithToolsResolvesAliases(t *testing.T) {
591 tools := []ServerTool{
592 mockTool("issue_read", "toolset1", true),
593 }
594
595 // Using deprecated alias should resolve to canonical name
596 filtered := mustBuild(t, NewBuilder().SetTools(tools).
597 WithDeprecatedAliases(map[string]string{
598 "get_issue": "issue_read",
599 }).
600 WithToolsets([]string{}).
601 WithTools([]string{"get_issue"}))
602 available := filtered.AvailableTools(context.Background())
603
604 if len(available) != 1 {
605 t.Errorf("expected 1 tool, got %d", len(available))
606 }
607 if available[0].Tool.Name != "issue_read" {
608 t.Errorf("expected issue_read, got %s", available[0].Tool.Name)
609 }
610}
611
612func TestHasToolset(t *testing.T) {
613 tools := []ServerTool{

Callers

nothing calls this directly

Calls 8

mustBuildFunction · 0.85
NewBuilderFunction · 0.85
WithToolsMethod · 0.80
WithToolsetsMethod · 0.80
WithDeprecatedAliasesMethod · 0.80
SetToolsMethod · 0.80
AvailableToolsMethod · 0.80
mockToolFunction · 0.70

Tested by

no test coverage detected