Skip to main content
Glama
Brucedh

AWS‑IReveal‑MCP

cloudwatch_describe_log_groups

Retrieve and filter CloudWatch log groups in a specified AWS region using name patterns to identify relevant logging resources.

Instructions

Describes available CloudWatch log groups in the specified region.

Parameters:
  aws_region (str): The AWS region - use 'us-east-1' if not specified.
  log_group_name_pattern (str): The pattern to filter log group names.
    Pattern: [\.\-_/#A-Za-z0-9]*
    If you specify a string for this parameter, the operation returns only log groups that have names that match the string based on a case-sensitive substring search. 
    For example, if you specify Foo, log groups named FooBar, aws/Foo, and GroupFoo would match, but foo, F/o/o and Froo would not match.
    Thus, if you don't find any results with uppercase letters, try using lowercase letters.

Returns:
  str: JSON-formatted list of log groups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aws_regionYes
log_group_name_patternYes
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The async handler function implementing the cloudwatch_describe_log_groups tool logic using boto3 CloudWatch Logs client to describe log groups matching the pattern.
    async def cloudwatch_describe_log_groups(
        aws_region: str, 
        log_group_name_pattern: str, 
        limit: int = 50
    ) -> str:
        """
        Describes available CloudWatch log groups in the specified region.
    
        Parameters:
          aws_region (str): The AWS region - use 'us-east-1' if not specified.
          log_group_name_pattern (str): The pattern to filter log group names.
            Pattern: [\.\-_/#A-Za-z0-9]*
            If you specify a string for this parameter, the operation returns only log groups that have names that match the string based on a case-sensitive substring search. 
            For example, if you specify Foo, log groups named FooBar, aws/Foo, and GroupFoo would match, but foo, F/o/o and Froo would not match.
            Thus, if you don't find any results with uppercase letters, try using lowercase letters.
    
        Returns:
          str: JSON-formatted list of log groups.
        """
        try:
            cw_client = boto3.client('logs', region_name=aws_region)
            # Describe log groups (you can add pagination if necessary)
            response = cw_client.describe_log_groups(logGroupNamePattern=log_group_name_pattern, limit=limit)
            log_groups = response.get('logGroups', [])
    
            if not log_groups:
                return "No log groups found."
            return json.dumps(log_groups, indent=2)
        except Exception as e:
            return f"Error describing log groups: {str(e)}"
  • server.py:392-392 (registration)
    The @mcp.tool() decorator that registers the cloudwatch_describe_log_groups function as an MCP tool.
    @mcp.tool()
  • The docstring provides the input schema description (parameters and return type), used by MCP for tool schema generation.
    """
    Describes available CloudWatch log groups in the specified region.
    
    Parameters:
      aws_region (str): The AWS region - use 'us-east-1' if not specified.
      log_group_name_pattern (str): The pattern to filter log group names.
        Pattern: [\.\-_/#A-Za-z0-9]*
        If you specify a string for this parameter, the operation returns only log groups that have names that match the string based on a case-sensitive substring search. 
        For example, if you specify Foo, log groups named FooBar, aws/Foo, and GroupFoo would match, but foo, F/o/o and Froo would not match.
        Thus, if you don't find any results with uppercase letters, try using lowercase letters.
    
    Returns:
      str: JSON-formatted list of log groups.
    """
Behavior4/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 effectively describes key behaviors: it's a read operation (implied by 'describes'), includes filtering capabilities via pattern matching with case-sensitive substring search, provides a default region, and notes the JSON-formatted return. However, it doesn't mention rate limits, authentication needs, or pagination (though the 'limit' parameter in the schema hints at this).

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

Conciseness4/5

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

The description is well-structured with clear sections (purpose, parameters, returns), uses bullet-like formatting for readability, and avoids unnecessary fluff. Every sentence adds value, such as the pattern matching explanation. It could be slightly more concise by integrating the pattern details more tightly, but overall it's efficient and front-loaded.

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 (3 parameters, no annotations, but with an output schema), the description is reasonably complete. It covers the tool's purpose, parameter semantics, and return format. The presence of an output schema means it doesn't need to detail return values extensively. However, it could improve by addressing the undocumented 'limit' parameter and providing more context on when to use this tool versus siblings.

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

Parameters5/5

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

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains the purpose of 'aws_region' with a default value, details 'log_group_name_pattern' with pattern syntax and matching behavior (including examples and case-sensitivity notes), and implies filtering functionality. Although it doesn't mention the 'limit' parameter from the schema, it compensates well for the low schema coverage by enriching the documented parameters.

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 tool's purpose: 'Describes available CloudWatch log groups in the specified region.' It specifies the verb ('describes') and resource ('CloudWatch log groups'), and while it doesn't explicitly differentiate from sibling tools, the specificity of 'log groups' distinguishes it from other CloudWatch tools like 'cloudwatch_filter_log_events' or 'cloudwatch_list_log_streams'.

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

Usage Guidelines3/5

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

The description implies usage through parameter explanations (e.g., default region, pattern matching behavior), but it doesn't explicitly state when to use this tool versus alternatives like 'cloudwatch_list_log_streams' or other AWS monitoring tools. It provides some context for parameter usage but lacks clear guidance on tool selection among siblings.

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