MCPcopy
hub / github.com/github/github-mcp-server / mockTool

Function mockTool

pkg/inventory/registry_test.go:58–72  ·  view source on GitHub ↗

mockTool creates a minimal ServerTool for testing

(name string, toolsetID string, readOnly bool)

Source from the content-addressed store, hash-verified

56
57// mockTool creates a minimal ServerTool for testing
58func 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
74func TestNewRegistryEmpty(t *testing.T) {
75 reg := mustBuild(t, NewBuilder())

Callers 15

TestNewRegistryWithToolsFunction · 0.70
TestWithReadOnlyFunction · 0.70
TestWithToolsetsFunction · 0.70
TestUnrecognizedToolsetsFunction · 0.70
TestWithToolsFunction · 0.70
TestChainedFiltersFunction · 0.70
TestToolsetIDsFunction · 0.70

Calls 2

NewServerToolFunction · 0.85
testToolsetMetadataFunction · 0.85

Tested by

no test coverage detected