MCPcopy Index your code
hub / github.com/github/github-mcp-server / TestForMCPRequest_PromptsGet

Function TestForMCPRequest_PromptsGet

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

Source from the content-addressed store, hash-verified

879}
880
881func TestForMCPRequest_PromptsGet(t *testing.T) {
882 prompts := []ServerPrompt{
883 mockPrompt("prompt1", "repos"),
884 mockPrompt("prompt2", "issues"),
885 }
886
887 reg := mustBuild(t, NewBuilder().SetPrompts(prompts).WithToolsets([]string{"all"}))
888 filtered := reg.ForMCPRequest(MCPMethodPromptsGet, "prompt1")
889
890 available := filtered.AvailablePrompts(context.Background())
891 if len(available) != 1 {
892 t.Fatalf("Expected 1 prompt for prompts/get, got %d", len(available))
893 }
894 if available[0].Prompt.Name != "prompt1" {
895 t.Errorf("Expected prompt name 'prompt1', got %q", available[0].Prompt.Name)
896 }
897}
898
899func TestForMCPRequest_UnknownMethod(t *testing.T) {
900 tools := []ServerTool{

Callers

nothing calls this directly

Calls 7

mockPromptFunction · 0.85
mustBuildFunction · 0.85
NewBuilderFunction · 0.85
WithToolsetsMethod · 0.80
SetPromptsMethod · 0.80
ForMCPRequestMethod · 0.80
AvailablePromptsMethod · 0.80

Tested by

no test coverage detected