guardduty_list_detectors
Retrieve all GuardDuty detector IDs from a specified AWS region to monitor security threats and manage detection configurations.
Instructions
List all GuardDuty detector IDs in the specified AWS region.
Parameters:
aws_region (str): The AWS region - use 'us-east-1' if not specified.
Returns:
str: JSON-formatted list of detector IDs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aws_region | Yes |
Implementation Reference
- server.py:549-567 (handler)The handler function for the 'guardduty_list_detectors' tool. It uses the AWS GuardDuty boto3 client to list detector IDs in the specified region and returns them as JSON or an error message.@mcp.tool() async def guardduty_list_detectors(aws_region: str) -> str: """ List all GuardDuty detector IDs in the specified AWS region. Parameters: aws_region (str): The AWS region - use 'us-east-1' if not specified. Returns: str: JSON-formatted list of detector IDs. """ try: client = boto3.client('guardduty', region_name=aws_region) response = client.list_detectors() detectors = response.get("DetectorIds", []) return json.dumps(detectors, indent=2) except Exception as e: return f"Error listing GuardDuty detectors: {str(e)}"