accessanalyzer_list_findings
Retrieve and filter security findings from AWS IAM Access Analyzer to identify resource access risks and compliance issues.
Instructions
List findings for an analyzer, with optional filter.
filter: {'resourceType': {'eq': ['AWS::S3::Bucket']}, ...}
Parameters:
aws_region (str): The AWS region - use 'us-east-1' if not specified.
analyzer_arn (str): The ARN of the analyzer to list findings for.
filter (dict, optional): Filter criteria for findings.
max_results (int): Maximum number of findings to return.
Returns:
str: JSON-formatted list of findings.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aws_region | Yes | ||
| analyzer_arn | Yes | ||
| filter | No | ||
| max_results | No |
Implementation Reference
- server.py:968-1003 (handler)The main handler function for the 'accessanalyzer_list_findings' MCP tool. It uses the AWS Access Analyzer client to list findings with pagination support, applies optional filters, and returns JSON-formatted results using a custom DateTimeEncoder.@mcp.tool() async def accessanalyzer_list_findings( aws_region: str, analyzer_arn: str, filter: dict = None, max_results: int = 50 ) -> str: """ List findings for an analyzer, with optional filter. filter: {'resourceType': {'eq': ['AWS::S3::Bucket']}, ...} Parameters: aws_region (str): The AWS region - use 'us-east-1' if not specified. analyzer_arn (str): The ARN of the analyzer to list findings for. filter (dict, optional): Filter criteria for findings. max_results (int): Maximum number of findings to return. Returns: str: JSON-formatted list of findings. """ client = boto3.client('accessanalyzer', region_name=aws_region) params = {'analyzerArn': analyzer_arn, 'maxResults': max_results} if filter: params['filter'] = filter findings = [] next_token = None while True: if next_token: params['nextToken'] = next_token response = client.list_findings(**params) summaries = response.get('findingSummaries', []) findings.extend(summaries) next_token = response.get('nextToken') if not next_token: break return json.dumps(findings, indent=2, cls=DateTimeEncoder)
- server.py:616-620 (helper)Custom JSON encoder used in the tool to serialize datetime objects to ISO format strings.class DateTimeEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, datetime.datetime): return o.isoformat() # Convert datetime to ISO-format string. return super().default(o)
- server.py:968-968 (registration)The @mcp.tool() decorator registers the function as an MCP tool with the name matching the function name 'accessanalyzer_list_findings'.@mcp.tool()