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

Function mockToolWithMeta

pkg/inventory/registry_test.go:1808–1823  ·  view source on GitHub ↗

mockToolWithMeta creates a ServerTool with Meta for testing insiders mode

(name string, toolsetID string, meta map[string]any)

Source from the content-addressed store, hash-verified

1806
1807// mockToolWithMeta creates a ServerTool with Meta for testing insiders mode
1808func mockToolWithMeta(name string, toolsetID string, meta map[string]any) ServerTool {
1809 return NewServerTool(
1810 mcp.Tool{
1811 Name: name,
1812 Annotations: &mcp.ToolAnnotations{
1813 ReadOnlyHint: true,
1814 },
1815 InputSchema: json.RawMessage(`{"type":"object","properties":{}}`),
1816 Meta: meta,
1817 },
1818 testToolsetMetadata(toolsetID),
1819 func(_ context.Context, _ *mcp.CallToolRequest) (*mcp.CallToolResult, error) {
1820 return nil, nil
1821 },
1822 )
1823}
1824
1825func TestWithMCPApps_DisabledStripsUIMetadata(t *testing.T) {
1826 toolWithUI := mockToolWithMeta("tool_with_ui", "toolset1", map[string]any{

Calls 2

NewServerToolFunction · 0.85
testToolsetMetadataFunction · 0.85

Tested by

no test coverage detected