mockTool creates a minimal ServerTool for testing
(name string, toolsetID string, readOnly bool)
| 56 | |
| 57 | // mockTool creates a minimal ServerTool for testing |
| 58 | func mockTool(name string, toolsetID string, readOnly bool) ServerTool { |
| 59 | return NewServerTool( |
| 60 | mcp.Tool{ |
| 61 | Name: name, |
| 62 | Annotations: &mcp.ToolAnnotations{ |
| 63 | ReadOnlyHint: readOnly, |
| 64 | }, |
| 65 | InputSchema: json.RawMessage(`{"type":"object","properties":{}}`), |
| 66 | }, |
| 67 | testToolsetMetadata(toolsetID), |
| 68 | func(_ context.Context, _ *mcp.CallToolRequest) (*mcp.CallToolResult, error) { |
| 69 | return nil, nil |
| 70 | }, |
| 71 | ) |
| 72 | } |
| 73 | |
| 74 | func TestNewRegistryEmpty(t *testing.T) { |
| 75 | reg := mustBuild(t, NewBuilder()) |
no test coverage detected