@@ -140,10 +140,8 @@ export function useMcpServerTools(workspaceId: string, serverId?: string) {
140140export function useMcpToolsQuery ( workspaceId : string ) {
141141 const { data : servers , isLoading : serversLoading } = useMcpServers ( workspaceId )
142142
143- // Filter on (a) enabled (disabled servers would 404 in discover and pollute the
144- // negative cache), and (b) workspaceId match (useMcpServers keeps the previous
145- // workspace's data via keepPreviousData, so during a workspace switch we'd
146- // otherwise spawn discover calls for the wrong workspace's IDs).
143+ // Skip disabled rows (would 404 → negative-cache) and rows from a previous
144+ // workspace (keepPreviousData on useMcpServers).
147145 const serverIds = useMemo (
148146 ( ) =>
149147 servers
@@ -173,9 +171,7 @@ export function useMcpToolsQuery(workspaceId: string) {
173171 let anyServerLoading = false
174172 let firstError : Error | null = null
175173 for ( const result of results ) {
176- // Drop stale data when the latest refetch failed — otherwise React Query's
177- // stale-while-revalidate behavior would surface broken-server tools in the
178- // aggregate while the per-server card shows an error.
174+ // Drop stale data from servers whose latest refetch errored.
179175 if ( result . data && ! result . isError ) {
180176 tools . push ( ...result . data )
181177 hasData = true
@@ -185,12 +181,9 @@ export function useMcpToolsQuery(workspaceId: string) {
185181 }
186182 return {
187183 data : tools ,
188- // Stay loading until we have something to render; once any server
189- // returned, drop the spinner and let slow neighbors fill in.
190184 isLoading : ( serversLoading || anyServerLoading ) && ! hasData ,
191185 isFetching : serversLoading || results . some ( ( r ) => r . isFetching ) ,
192- // One dead server must not blank out the workspace — only surface the
193- // aggregate error when nothing rendered. Per-server errors live in `perServer`.
186+ // Suppress when any healthy server rendered; per-server errors live in `perServer`.
194187 error : hasData ? null : firstError ,
195188 perServer : results ,
196189 }
@@ -210,7 +203,6 @@ export function useForceRefreshMcpTools() {
210203 return tools
211204 } )
212205 )
213- // Failed servers: invalidate so React Query retries via the server-side negative cache.
214206 results . forEach ( ( result , index ) => {
215207 if ( result . status === 'rejected' ) {
216208 const failedServer = servers [ index ]
0 commit comments