stripMCPAppsMetadata removes MCP Apps UI metadata from tools when the remote_mcp_ui_apps feature flag is not enabled.
(tools []ServerTool)
| 395 | // stripMCPAppsMetadata removes MCP Apps UI metadata from tools when the |
| 396 | // remote_mcp_ui_apps feature flag is not enabled. |
| 397 | func stripMCPAppsMetadata(tools []ServerTool) []ServerTool { |
| 398 | result := make([]ServerTool, 0, len(tools)) |
| 399 | for _, tool := range tools { |
| 400 | if stripped := stripMetaKeys(tool, mcpAppsMetaKeys); stripped != nil { |
| 401 | result = append(result, *stripped) |
| 402 | } else { |
| 403 | result = append(result, tool) |
| 404 | } |
| 405 | } |
| 406 | return result |
| 407 | } |
| 408 | |
| 409 | // stripMetaKeys removes the specified Meta keys from a single tool. |
| 410 | // Returns a modified copy if changes were made, nil otherwise. |