Skip to main content
Glama

get-events

Search Datadog events like deployments, alerts, and comments within a specified time range to correlate system behaviors with specific activities.

Instructions

Search for events in Datadog within a specified time range. Events include deployments, alerts, comments, and other activities. Useful for correlating system behaviors with specific events.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startYes
endYes
priorityNo
sourcesNo
tagsNo
unaggregatedNo
excludeAggregationNo
limitNo

Implementation Reference

  • The main handler function that performs the Datadog API call to list events using the provided parameters.
    execute: async (params: GetEventsParams) => {
      try {
        const {
          start,
          end,
          priority,
          sources,
          tags,
          unaggregated,
          excludeAggregation,
          limit
        } = params;
    
        const apiInstance = new v1.EventsApi(configuration);
    
        const apiParams: v1.EventsApiListEventsRequest = {
          start: start,
          end: end,
          priority: priority,
          sources: sources,
          tags: tags,
          unaggregated: unaggregated,
          excludeAggregate: excludeAggregation
        };
    
        const response = await apiInstance.listEvents(apiParams);
    
        // Apply client-side limit if specified
        if (limit && response.events && response.events.length > limit) {
          response.events = response.events.slice(0, limit);
        }
    
        return response;
      } catch (error) {
        console.error("Error fetching events:", error);
        throw error;
      }
    }
  • Zod input schema defining parameters for the get-events tool: time range (start/end), filters (priority, sources, tags), aggregation options, and limit.
    {
      start: z.number(),
      end: z.number(),
      priority: z.enum(["normal", "low"]).optional(),
      sources: z.string().optional(),
      tags: z.string().optional(),
      unaggregated: z.boolean().optional(),
      excludeAggregation: z.boolean().optional(),
      limit: z.number().default(100)
    },
  • src/index.ts:176-195 (registration)
    Registers the 'get-events' tool with the MCP server, providing name, description, input schema, and execution wrapper.
    server.tool(
      "get-events",
      "Search for events in Datadog within a specified time range. Events include deployments, alerts, comments, and other activities. Useful for correlating system behaviors with specific events.",
      {
        start: z.number(),
        end: z.number(),
        priority: z.enum(["normal", "low"]).optional(),
        sources: z.string().optional(),
        tags: z.string().optional(),
        unaggregated: z.boolean().optional(),
        excludeAggregation: z.boolean().optional(),
        limit: z.number().default(100)
      },
      async (args) => {
        const result = await getEvents.execute(args);
        return {
          content: [{ type: "text", text: JSON.stringify(result) }]
        };
      }
    );
  • TypeScript type definition for GetEventsParams matching the tool input schema.
    type GetEventsParams = {
      start: number;
      end: number;
      priority?: "normal" | "low";
      sources?: string;
      tags?: string;
      unaggregated?: boolean;
      excludeAggregation?: boolean;
      limit?: number;
    };
  • Initialization function sets up Datadog client configuration with API keys and site.
    initialize: () => {
      const configOpts = {
        authMethods: {
          apiKeyAuth: process.env.DD_API_KEY,
          appKeyAuth: process.env.DD_APP_KEY
        }
      };
    
      configuration = client.createConfiguration(configOpts);
    
      if (process.env.DD_SITE) {
        configuration.setServerVariables({
          site: process.env.DD_SITE
        });
      }
    },
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 mentions the tool searches for events but doesn't describe key behaviors: whether it's read-only or mutative, what permissions are required, rate limits, pagination (though 'limit' parameter hints at it), or error handling. For a tool with 8 parameters and no annotation coverage, this is a significant gap in transparency.

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 appropriately sized with two sentences: the first states the core purpose, and the second adds usage context. It's front-loaded with the main action. There's minimal waste, though the second sentence could be more specific. Overall, it's efficient and well-structured.

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

Completeness2/5

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

Given the complexity (8 parameters, no output schema, no annotations), the description is incomplete. It covers the basic purpose but lacks details on parameter meanings, behavioral traits (e.g., read-only status, error handling), and output format. For a search tool with many filtering options and no structured output documentation, this leaves the agent with significant gaps in understanding how to use it effectively.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It only mentions 'specified time range' (mapping to 'start' and 'end' parameters) and 'events include deployments, alerts, comments, and other activities' (hinting at event types but not directly mapping to parameters like 'sources' or 'tags'). Most parameters (priority, sources, tags, unaggregated, excludeAggregation, limit) remain unexplained, failing to add sufficient meaning beyond the bare schema.

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: 'Search for events in Datadog within a specified time range' with specific examples of event types (deployments, alerts, comments). It distinguishes from sibling tools like 'get-incidents' or 'search-logs' by focusing on events rather than logs, incidents, or metrics. However, it doesn't explicitly contrast with all siblings, keeping it at 4 rather than 5.

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 provides implied usage context: 'Useful for correlating system behaviors with specific events,' suggesting when this tool might be appropriate. However, it lacks explicit guidance on when to use this tool versus alternatives like 'get-incidents' or 'search-logs,' and doesn't mention prerequisites or exclusions. This leaves some ambiguity for the agent.

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/GeLi2001/datadog-mcp-server'

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