(t *testing.T)
| 685 | } |
| 686 | |
| 687 | func TestForMCPRequest_Initialize(t *testing.T) { |
| 688 | tools := []ServerTool{ |
| 689 | mockTool("tool1", "repos", true), |
| 690 | mockTool("tool2", "issues", false), |
| 691 | } |
| 692 | resources := []ServerResourceTemplate{ |
| 693 | mockResource("res1", "repos", "repo://{owner}/{repo}"), |
| 694 | } |
| 695 | prompts := []ServerPrompt{ |
| 696 | mockPrompt("prompt1", "repos"), |
| 697 | } |
| 698 | |
| 699 | reg := mustBuild(t, NewBuilder().SetTools(tools).SetResources(resources).SetPrompts(prompts).WithToolsets([]string{"all"})) |
| 700 | filtered := reg.ForMCPRequest(MCPMethodInitialize, "") |
| 701 | |
| 702 | // Initialize should return empty - capabilities come from ServerOptions |
| 703 | if len(filtered.AvailableTools(context.Background())) != 0 { |
| 704 | t.Errorf("Expected 0 tools for initialize, got %d", len(filtered.AvailableTools(context.Background()))) |
| 705 | } |
| 706 | if len(filtered.AvailableResourceTemplates(context.Background())) != 0 { |
| 707 | t.Errorf("Expected 0 resources for initialize, got %d", len(filtered.AvailableResourceTemplates(context.Background()))) |
| 708 | } |
| 709 | if len(filtered.AvailablePrompts(context.Background())) != 0 { |
| 710 | t.Errorf("Expected 0 prompts for initialize, got %d", len(filtered.AvailablePrompts(context.Background()))) |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | func TestForMCPRequest_ToolsList(t *testing.T) { |
| 715 | tools := []ServerTool{ |
nothing calls this directly
no test coverage detected