networkinsights_get_findings
Retrieve findings for specified AWS network analysis, providing insights into access scope data. Input includes AWS region, analysis ID, and max results to return relevant JSON output.
Instructions
Retrieve all findings for a given analysis.
Parameters:
aws_region (str): The AWS region - use 'us-east-1' if not specified.
analysis_id (str): The ID of the analysis to retrieve findings for.
max_results (int): Maximum number of findings to return.
Returns:
JSON list of NetworkInsightsAccessScopeAnalysisFinding objects.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| analysis_id | Yes | ||
| aws_region | Yes | ||
| max_results | No |
Implementation Reference
- server.py:857-890 (handler)The handler function for the 'networkinsights_get_findings' tool. It is decorated with @mcp.tool(), which also serves as the registration. The function retrieves Network Insights Access Scope Analysis findings using the AWS EC2 client, paginating through results if necessary, and returns them as JSON.@mcp.tool() async def networkinsights_get_findings( aws_region: str, analysis_id: str, max_results: int = 1 ) -> str: """ Retrieve all findings for a given analysis. Parameters: aws_region (str): The AWS region - use 'us-east-1' if not specified. analysis_id (str): The ID of the analysis to retrieve findings for. max_results (int): Maximum number of findings to return. Returns: JSON list of NetworkInsightsAccessScopeAnalysisFinding objects. """ client = boto3.client('ec2', region_name=aws_region) findings = [] next_token = None while True: kwargs = { 'NetworkInsightsAccessScopeAnalysisId': analysis_id, 'MaxResults': max_results } if next_token: kwargs['NextToken'] = next_token resp = client.get_network_insights_access_scope_analysis_findings(**kwargs) findings.extend(resp.get('AnalysisFindings', [])) next_token = resp.get('NextToken') if not next_token: break return json.dumps(findings, indent=2, cls=DateTimeEncoder)