diff --git a/cmd/rhobs/mcp_tools.go b/cmd/rhobs/mcp_tools.go index fcdeb943e..a66b03001 100644 --- a/cmd/rhobs/mcp_tools.go +++ b/cmd/rhobs/mcp_tools.go @@ -51,13 +51,13 @@ func registerMcpTools(s *mcp.Server) { Name: "rhobs_logs", Description: "Query RHOBS Loki logs for ROSA HCP infrastructure. " + "Covers HCP hosted clusters, Management Clusters (MC), and Service Clusters (SC). " + - "Requires an MC cluster ID since logs are collected at the MC level. " + + "Accepts any cluster ID; HCP IDs are automatically resolved to their parent MC. " + "The correct RHOBS cell is resolved automatically.", Annotations: readOnlyAnnotations, InputSchema: json.RawMessage(`{ "type": "object", "properties": { - "cluster_id": {"type": "string", "description": "MC cluster ID or name (logs are collected at the MC level for HCP)"}, + "cluster_id": {"type": "string", "description": "Cluster ID or name (HCP, MC, or SC). HCP IDs auto-resolve to their parent MC."}, "namespace": {"type": "string", "description": "Kubernetes namespace. Required unless query is set."}, "query": {"type": "string", "description": "Raw LogQL expression (overrides namespace)"}, "contain_regex": {"type": "string", "description": "Server-side regex filter (e.g., (?i)(error|timeout))"}, diff --git a/cmd/rhobs/requests.go b/cmd/rhobs/requests.go index eb1dfb37d..f028acf06 100644 --- a/cmd/rhobs/requests.go +++ b/cmd/rhobs/requests.go @@ -238,15 +238,12 @@ func CreateRhobsFetcher(clusterKey string, rhobsFetchUse RhobsFetchUsage, hiveOc isMC := false if isHcp { - if rhobsFetchUse == RhobsFetchForLogs { - return nil, fmt.Errorf("cluster '%s' is a HCP cluster - try with its parent MC cluster", cluster.ID()) - } managementCluster, err := ocmutils.GetManagementCluster(cluster.ID()) if err != nil { return nil, fmt.Errorf("failed to retrieve management cluster for cluster '%s': %v", cluster.ID(), err) } monitoredClusterId = managementCluster.ID() - log.Infof("Cluster %s is managed by MC cluster %s - using the MC cluster to retrieve the RHOBS cell for logs\n", cluster.ID(), monitoredClusterId) + log.Infof("Cluster %s is managed by MC cluster %s - using the MC cluster for RHOBS cell resolution\n", cluster.ID(), monitoredClusterId) } else { monitoredClusterId = cluster.ID() isMC, err = ocmutils.IsManagementCluster(cluster.ID())