guardduty_list_detectors
Retrieve all GuardDuty detector IDs in a specified AWS region as a JSON-formatted list. Use this tool to manage and monitor security detectors effectively.
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
| Name | Required | Description | Default |
|---|---|---|---|
| aws_region | Yes |
Input Schema (JSON Schema)
{
"properties": {
"aws_region": {
"title": "Aws Region",
"type": "string"
}
},
"required": [
"aws_region"
],
"title": "guardduty_list_detectorsArguments",
"type": "object"
}
Implementation Reference
- server.py:549-566 (handler)The main handler function for the 'guardduty_list_detectors' MCP tool. It is decorated with @mcp.tool() which likely handles both implementation and registration. Uses boto3 GuardDuty client to list detectors and returns JSON or 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)}"