Skip to main content
Glama
Brucedh

AWS‑IReveal‑MCP

guardduty_get_finding_statistics

Retrieve summary statistics for AWS GuardDuty findings to analyze security threats and monitor detection patterns.

Instructions

Get summary statistics for GuardDuty findings for a given detector.

Parameters:
  aws_region (str): The AWS region - use 'us-east-1' if not specified.
  detector_id (str): The GuardDuty detector ID.

Returns:
  str: JSON-formatted statistics about the findings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aws_regionYes
detector_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The @mcp.tool()-decorated handler function implementing the tool logic. It uses boto3 to call GuardDuty's get_findings_statistics API with COUNT_BY_SEVERITY, returns JSON-formatted statistics, or an error message.
    @mcp.tool()
    async def guardduty_get_finding_statistics(aws_region: str, detector_id: str) -> str:
        """
        Get summary statistics for GuardDuty findings for a given detector.
        
        Parameters:
          aws_region (str): The AWS region - use 'us-east-1' if not specified.
          detector_id (str): The GuardDuty detector ID.
        
        Returns:
          str: JSON-formatted statistics about the findings.
        """
        try:
            client = boto3.client('guardduty', region_name=aws_region)
            response = client.get_findings_statistics(
                DetectorId=detector_id,
                FindingStatisticTypes=['COUNT_BY_SEVERITY'],
                FindingCriteria={}
            )
            statistics = response.get("FindingStatistics", {})
            return json.dumps(statistics, indent=2)
        except Exception as e:
            return f"Error getting GuardDuty finding statistics: {str(e)}"
  • server.py:659-659 (registration)
    The @mcp.tool() decorator registers the function as an MCP tool, inferring schema from type hints and docstring.
    @mcp.tool()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves statistics but doesn't cover aspects like authentication requirements, rate limits, error handling, or whether it's a read-only operation. This leaves significant gaps for an agent to understand its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and concise, with clear sections for parameters and returns. Each sentence adds value without redundancy, making it easy to scan and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters), no annotations, and the presence of an output schema (which handles return values), the description is reasonably complete. It covers the purpose, parameters, and return format, though it could improve by adding more behavioral context or usage guidelines.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context for parameters: it specifies that 'aws_region' defaults to 'us-east-1' if not provided and clarifies that 'detector_id' is for a GuardDuty detector. Since schema description coverage is 0%, this compensates somewhat, but it doesn't fully detail parameter constraints or examples beyond the defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get summary statistics') and resource ('GuardDuty findings for a given detector'), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'guardduty_get_findings' or 'guardduty_list_findings', which might retrieve detailed findings rather than statistics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as the sibling tools 'guardduty_get_findings' or 'guardduty_list_findings'. It mentions the detector context but lacks explicit usage scenarios or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Brucedh/aws-ireveal-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server