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)
| 2207 | // to ToolsForRegistration so any future strip added there is picked up |
| 2208 | // automatically. |
| 2209 | func 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 |
no test coverage detected