Skip to main content
Glama

list_recent_cloudtrail_events

Retrieve recent AWS CloudTrail events to monitor console access and configuration changes for security auditing and compliance tracking.

Instructions

Lists recent CloudTrail events to track console access and changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of events to return (default: 10).
lookup_attribute_keyNoAttribute key to filter by (e.g., 'EventName', 'Username').
lookup_attribute_valueNoValue for the lookup attribute.

Implementation Reference

  • Handler function that executes the tool logic: fetches recent CloudTrail events using LookupEventsCommand with optional limit and lookup attributes, formats and returns the events.
    if (name === "list_recent_cloudtrail_events") {
        const limit = (args as any)?.limit || 10;
        const lookupKey = (args as any)?.lookup_attribute_key;
        const lookupValue = (args as any)?.lookup_attribute_value;
    
        const commandInput: any = { MaxResults: limit };
        if (lookupKey && lookupValue) {
            commandInput.LookupAttributes = [{ AttributeKey: lookupKey, AttributeValue: lookupValue }];
        }
    
        const command = new LookupEventsCommand(commandInput);
        const response = await cloudTrailClient.send(command);
    
        const events = response.Events?.map(e => ({
            EventId: e.EventId,
            EventName: e.EventName,
            EventTime: e.EventTime,
            Username: e.Username,
            Resources: e.Resources,
            CloudTrailEvent: e.CloudTrailEvent ? JSON.parse(e.CloudTrailEvent).userAgent : undefined // Extract user agent if available
        })) || [];
    
        return {
            content: [{ type: "text", text: JSON.stringify(events, null, 2) }]
        };
    }
  • src/index.ts:140-159 (registration)
    Tool registration in the ListTools response, including name, description, and input schema definition.
        name: "list_recent_cloudtrail_events",
        description: "Lists recent CloudTrail events to track console access and changes.",
        inputSchema: {
            type: "object",
            properties: {
                limit: {
                    type: "number",
                    description: "Number of events to return (default: 10).",
                },
                lookup_attribute_key: {
                    type: "string",
                    description: "Attribute key to filter by (e.g., 'EventName', 'Username')."
                },
                lookup_attribute_value: {
                    type: "string",
                    description: "Value for the lookup attribute."
                }
            }
        }
    },
  • Input schema for the tool parameters: limit, lookup_attribute_key, lookup_attribute_value.
        inputSchema: {
            type: "object",
            properties: {
                limit: {
                    type: "number",
                    description: "Number of events to return (default: 10).",
                },
                lookup_attribute_key: {
                    type: "string",
                    description: "Attribute key to filter by (e.g., 'EventName', 'Username')."
                },
                lookup_attribute_value: {
                    type: "string",
                    description: "Value for the lookup attribute."
                }
            }
        }
    },
  • Initialization of the CloudTrailClient used by the handler.
    const cloudTrailClient = new CloudTrailClient({});
  • Import of CloudTrailClient and LookupEventsCommand used in the handler.
    import { CloudTrailClient, LookupEventsCommand } from "@aws-sdk/client-cloudtrail";
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Lists' implies a read operation, it doesn't specify authentication requirements, rate limits, pagination behavior, or what 'recent' means temporally. The description adds minimal behavioral context beyond the basic operation.

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 a single, efficient sentence that states the purpose clearly without unnecessary words. It's appropriately sized for a listing tool and front-loads the essential information.

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

Completeness3/5

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

For a read-only listing tool with no output schema and no annotations, the description provides basic purpose but lacks important context about authentication, temporal scope of 'recent', response format, or error handling. It's minimally viable but has clear gaps in completeness.

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?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema, maintaining the baseline score of 3 for adequate but not enhanced parameter semantics.

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 verb ('Lists') and resource ('recent CloudTrail events'), and provides specific purpose context ('to track console access and changes'). However, it doesn't explicitly differentiate from sibling tools like 'list_cloudtrail_changes' or 'list_access_denied_events', which might have overlapping domains.

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. There are multiple sibling tools that might overlap (e.g., 'list_cloudtrail_changes', 'list_access_denied_events', 'get_recent_logs'), but the description offers no comparison or context for selection.

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/bhaveshopss/MCP-server'

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