diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/connectors/route.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/connectors/route.ts index 79134b9fef8d0..24d63d3f7fa06 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/connectors/route.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/connectors/route.ts @@ -20,9 +20,24 @@ const listConnectorsRoute = createObservabilityAIAssistantServerRoute({ await plugins.actions.start() ).getActionsClientWithRequest(request); - const connectors = await actionsClient.getAll(); + const [availableTypes, connectors] = await Promise.all([ + actionsClient + .listTypes({ + includeSystemActionTypes: false, + }) + .then((types) => + types + .filter((type) => type.enabled && type.enabledInLicense && type.enabledInConfig) + .map((type) => type.id) + ), + actionsClient.getAll(), + ]); - return connectors.filter((connector) => isSupportedConnectorType(connector.actionTypeId)); + return connectors.filter( + (connector) => + availableTypes.includes(connector.actionTypeId) && + isSupportedConnectorType(connector.actionTypeId) + ); }, });