ToolsForRegistration returns AvailableTools(ctx) post-processed exactly as RegisterTools would expose them: with MCP Apps UI metadata stripped when the client cannot consume it. Useful for documentation generators and diagnostics that need the same view of the tool surface the server would register.
(ctx context.Context)
| 183 | // capability is unknown (e.g. stdio paths that do not populate the |
| 184 | // context flag) the feature-flag gate is the sole source of truth. |
| 185 | func (r *Inventory) ToolsForRegistration(ctx context.Context) []ServerTool { |
| 186 | tools := r.AvailableTools(ctx) |
| 187 | if shouldStripMCPAppsMetadata(ctx, r.checkFeatureFlag(ctx, mcpAppsFeatureFlag)) { |
| 188 | tools = stripMCPAppsMetadata(tools) |
| 189 | } |
| 190 | return tools |
| 191 | } |
| 192 | |
| 193 | // shouldStripMCPAppsMetadata centralises the strip decision so the same logic |
| 194 | // is exercised by tests and by RegisterTools. |