(t *testing.T)
| 853 | } |
| 854 | } |
| 855 | func TestForMCPRequest_PromptsList(t *testing.T) { |
| 856 | tools := []ServerTool{ |
| 857 | mockTool("tool1", "repos", true), |
| 858 | } |
| 859 | resources := []ServerResourceTemplate{ |
| 860 | mockResource("res1", "repos", "repo://{owner}/{repo}"), |
| 861 | } |
| 862 | prompts := []ServerPrompt{ |
| 863 | mockPrompt("prompt1", "repos"), |
| 864 | mockPrompt("prompt2", "issues"), |
| 865 | } |
| 866 | |
| 867 | reg := mustBuild(t, NewBuilder().SetTools(tools).SetResources(resources).SetPrompts(prompts).WithToolsets([]string{"all"})) |
| 868 | filtered := reg.ForMCPRequest(MCPMethodPromptsList, "") |
| 869 | |
| 870 | if len(filtered.AvailableTools(context.Background())) != 0 { |
| 871 | t.Errorf("Expected 0 tools for prompts/list, got %d", len(filtered.AvailableTools(context.Background()))) |
| 872 | } |
| 873 | if len(filtered.AvailableResourceTemplates(context.Background())) != 0 { |
| 874 | t.Errorf("Expected 0 resources for prompts/list, got %d", len(filtered.AvailableResourceTemplates(context.Background()))) |
| 875 | } |
| 876 | if len(filtered.AvailablePrompts(context.Background())) != 2 { |
| 877 | t.Errorf("Expected 2 prompts for prompts/list, got %d", len(filtered.AvailablePrompts(context.Background()))) |
| 878 | } |
| 879 | } |
| 880 | |
| 881 | func TestForMCPRequest_PromptsGet(t *testing.T) { |
| 882 | prompts := []ServerPrompt{ |
nothing calls this directly
no test coverage detected