fix: align fetchTools early-return guard with canFetchTools auth_type check for non-OpenAPI transports

This commit is contained in:
Ishaan Jaffer 2026-03-10 14:40:41 -07:00
parent e707a99c1a
commit 5584c92eff

View file

@ -79,6 +79,11 @@ export const useTestMCPConnection = ({
return;
}
// For non-OpenAPI transports, auth_type must be selected (mirrors the canFetchTools check).
if (!isOpenAPITransport && !formValues.auth_type) {
return;
}
// For OpenAPI transport, tools are derived from the spec — no OAuth token needed.
if (requiresOAuthToken && !oauthAccessToken && !isOpenAPITransport) {
return;