(t *testing.T)
| 837 | } |
| 838 | |
| 839 | func TestForMCPRequest_ResourcesRead(t *testing.T) { |
| 840 | resources := []ServerResourceTemplate{ |
| 841 | mockResource("res1", "repos", "repo://{owner}/{repo}"), |
| 842 | mockResource("res2", "repos", "branch://{owner}/{repo}/{branch}"), |
| 843 | } |
| 844 | |
| 845 | reg := mustBuild(t, NewBuilder().SetResources(resources).WithToolsets([]string{"all"})) |
| 846 | // Pass a concrete URI - all resources remain registered, SDK handles matching |
| 847 | filtered := reg.ForMCPRequest(MCPMethodResourcesRead, "repo://owner/repo") |
| 848 | |
| 849 | // All resources should be available - SDK handles URI template matching internally |
| 850 | available := filtered.AvailableResourceTemplates(context.Background()) |
| 851 | if len(available) != 2 { |
| 852 | t.Fatalf("Expected 2 resources for resources/read (SDK handles matching), got %d", len(available)) |
| 853 | } |
| 854 | } |
| 855 | func TestForMCPRequest_PromptsList(t *testing.T) { |
| 856 | tools := []ServerTool{ |
| 857 | mockTool("tool1", "repos", true), |
nothing calls this directly
no test coverage detected