(t *testing.T)
| 625 | } |
| 626 | |
| 627 | func TestAllTools(t *testing.T) { |
| 628 | tools := []ServerTool{ |
| 629 | mockTool("read_tool", "toolset1", true), |
| 630 | mockTool("write_tool", "toolset1", false), |
| 631 | } |
| 632 | |
| 633 | // Even with read-only filter, AllTools returns everything |
| 634 | readOnlyReg := mustBuild(t, NewBuilder().SetTools(tools).WithToolsets([]string{"all"}).WithReadOnly(true)) |
| 635 | |
| 636 | allTools := readOnlyReg.AllTools() |
| 637 | if len(allTools) != 2 { |
| 638 | t.Fatalf("Expected 2 tools from AllTools, got %d", len(allTools)) |
| 639 | } |
| 640 | |
| 641 | // But AvailableTools respects the filter |
| 642 | availableTools := readOnlyReg.AvailableTools(context.Background()) |
| 643 | if len(availableTools) != 1 { |
| 644 | t.Fatalf("Expected 1 tool from AvailableTools, got %d", len(availableTools)) |
| 645 | } |
| 646 | } |
| 647 | |
| 648 | func TestServerToolIsReadOnly(t *testing.T) { |
| 649 | readTool := mockTool("read_tool", "toolset1", true) |
nothing calls this directly
no test coverage detected