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

Function captureRegisteredTools

pkg/inventory/registry_test.go:2209–2218  ·  view source on GitHub ↗

captureRegisteredTools mirrors RegisterTools' per-request strip behavior so tests can verify what the wire sees, without requiring tools to have real handlers (RegisterTools panics on tools without HandlerFunc). It delegates to ToolsForRegistration so any future strip added there is picked up automa

(ctx context.Context, t *testing.T, reg *Inventory)

Source from the content-addressed store, hash-verified

2207// to ToolsForRegistration so any future strip added there is picked up
2208// automatically.
2209func captureRegisteredTools(ctx context.Context, t *testing.T, reg *Inventory) []*mcp.Tool {
2210 t.Helper()
2211 forReg := reg.ToolsForRegistration(ctx)
2212 out := make([]*mcp.Tool, 0, len(forReg))
2213 for i := range forReg {
2214 toolCopy := forReg[i].Tool
2215 out = append(out, &toolCopy)
2216 }
2217 return out
2218}
2219
2220// TestShouldStripMCPAppsMetadata verifies the spec-conformant strip decision:
2221// strip when the feature flag is off, OR when the client explicitly does not

Calls 1

ToolsForRegistrationMethod · 0.80

Tested by

no test coverage detected