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

Function mockToolWithDefault

pkg/inventory/registry_test.go:41–55  ·  view source on GitHub ↗

mockToolWithDefault creates a mock tool with a default toolset flag

(name string, toolsetID string, readOnly bool, isDefault bool)

Source from the content-addressed store, hash-verified

39
40// mockToolWithDefault creates a mock tool with a default toolset flag
41func mockToolWithDefault(name string, toolsetID string, readOnly bool, isDefault bool) ServerTool {
42 return NewServerTool(
43 mcp.Tool{
44 Name: name,
45 Annotations: &mcp.ToolAnnotations{
46 ReadOnlyHint: readOnly,
47 },
48 InputSchema: json.RawMessage(`{"type":"object","properties":{}}`),
49 },
50 testToolsetMetadataWithDefault(toolsetID, isDefault),
51 func(_ context.Context, _ *mcp.CallToolRequest) (*mcp.CallToolResult, error) {
52 return nil, nil
53 },
54 )
55}
56
57// mockTool creates a minimal ServerTool for testing
58func mockTool(name string, toolsetID string, readOnly bool) ServerTool {

Calls 2

NewServerToolFunction · 0.85

Tested by

no test coverage detected