Description
In server/scc/scc_mcp.py, when calling top_vulnerability_findings or get_finding_remediation with organization_id (and leaving project_id=None), any google.api_core.exceptions.NotFound exception formats the error message referencing project_id.
Root Cause
In server/scc/scc_mcp.py:
- In
top_vulnerability_findings:
except google_exceptions.NotFound as e:
logger.error(f"Project or resource not found for top findings on {parent}: {e}")
return {"error": "Not Found", "details": f"Could not find project '{project_id}' or relevant resources. {str(e)}"}
- In
get_finding_remediation:
except google_exceptions.NotFound as e:
logger.error(f"Resource not found during SCC operation for project {project_id} (finding_id: {finding_id}, resource: {resource_name}): {e}")
return {"error": "Not Found", "details": f"Could not find project '{project_id}' or related SCC resources. {str(e)}"}
When an organization-level query fails with NotFound, the returned details string outputs:
Could not find project 'None' or relevant resources.
Proposed Fix
Update exception handlers to dynamically format the scope label based on which identifier was provided:
target_scope = f"organization '{organization_id}'" if organization_id else f"project '{project_id}'"
return {"error": "Not Found", "details": f"Could not find {target_scope} or relevant resources. {str(e)}"}
Description
In
server/scc/scc_mcp.py, when callingtop_vulnerability_findingsorget_finding_remediationwithorganization_id(and leavingproject_id=None), anygoogle.api_core.exceptions.NotFoundexception formats the error message referencingproject_id.Root Cause
In
server/scc/scc_mcp.py:top_vulnerability_findings:get_finding_remediation:When an organization-level query fails with
NotFound, the returneddetailsstring outputs:Proposed Fix
Update exception handlers to dynamically format the scope label based on which identifier was provided: