(t *testing.T)
| 739 | } |
| 740 | |
| 741 | func TestForMCPRequest_ToolsCall(t *testing.T) { |
| 742 | tools := []ServerTool{ |
| 743 | mockTool("get_me", "context", true), |
| 744 | mockTool("create_issue", "issues", false), |
| 745 | mockTool("list_repos", "repos", true), |
| 746 | } |
| 747 | |
| 748 | reg := mustBuild(t, NewBuilder().SetTools(tools).WithToolsets([]string{"all"})) |
| 749 | filtered := reg.ForMCPRequest(MCPMethodToolsCall, "get_me") |
| 750 | |
| 751 | available := filtered.AvailableTools(context.Background()) |
| 752 | if len(available) != 1 { |
| 753 | t.Fatalf("Expected 1 tool for tools/call with name, got %d", len(available)) |
| 754 | } |
| 755 | if available[0].Tool.Name != "get_me" { |
| 756 | t.Errorf("Expected tool name 'get_me', got %q", available[0].Tool.Name) |
| 757 | } |
| 758 | } |
| 759 | |
| 760 | func TestForMCPRequest_ToolsCall_NotFound(t *testing.T) { |
| 761 | tools := []ServerTool{ |
nothing calls this directly
no test coverage detected