Skip to main content
Glama

get-incidents

Retrieve and filter incidents from Datadog's incident management system to review current or past issues with status-based and query filtering capabilities.

Instructions

List incidents from Datadog's incident management system. Can filter by active/archived status and use query strings to find specific incidents. Helpful for reviewing current or past incidents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeArchivedNo
pageSizeNo
pageOffsetNo
queryNo
limitNo

Implementation Reference

  • The execute function implements the core logic for fetching incidents from Datadog's API using the IncidentsApi, handling parameters, making the API call, applying limits, and error handling.
      execute: async (params: GetIncidentsParams) => {
        try {
          const { includeArchived, pageSize, pageOffset, query, limit } = params;
    
          const apiInstance = new v2.IncidentsApi(configuration);
    
          const apiParams: any = {};
    
          if (includeArchived !== undefined) {
            apiParams.include_archived = includeArchived;
          }
    
          if (pageSize !== undefined) {
            apiParams.page_size = pageSize;
          }
    
          if (pageOffset !== undefined) {
            apiParams.page_offset = pageOffset;
          }
    
          if (query !== undefined) {
            apiParams.query = query;
          }
    
          const response = await apiInstance.listIncidents(apiParams);
    
          // Apply client-side limit if specified
          if (limit && response.data && response.data.length > limit) {
            response.data = response.data.slice(0, limit);
          }
    
          return response;
        } catch (error: any) {
          if (error.status === 403) {
            console.error(
              "Authorization failed (403 Forbidden): Check that your API key and Application key are valid and have sufficient permissions to access incidents."
            );
            throw new Error(
              "Datadog API authorization failed. Please verify your API and Application keys have the correct permissions."
            );
          } else {
            console.error("Error fetching incidents:", error);
            throw error;
          }
        }
      }
    };
  • src/index.ts:197-213 (registration)
    Registers the 'get-incidents' tool with the MCP server, defining its name, description, input schema using Zod, and a wrapper handler that calls the actual execute function.
    server.tool(
      "get-incidents",
      "List incidents from Datadog's incident management system. Can filter by active/archived status and use query strings to find specific incidents. Helpful for reviewing current or past incidents.",
      {
        includeArchived: z.boolean().optional(),
        pageSize: z.number().optional(),
        pageOffset: z.number().optional(),
        query: z.string().optional(),
        limit: z.number().default(100)
      },
      async (args) => {
        const result = await getIncidents.execute(args);
        return {
          content: [{ type: "text", text: JSON.stringify(result) }]
        };
      }
    );
  • TypeScript type definition for the input parameters of the getIncidents tool, matching the Zod schema used in registration.
    type GetIncidentsParams = {
      includeArchived?: boolean;
      pageSize?: number;
      pageOffset?: number;
      query?: string;
      limit?: number;
    };
  • Initialization function that sets up the Datadog API client configuration with auth keys, site, and enables the unstable listIncidents operation.
    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
        });
      }
    
      // Enable the unstable operation
      configuration.unstableOperations["v2.listIncidents"] = true;
    },
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 filtering and querying capabilities, but fails to describe critical behaviors such as pagination handling (implied by pageSize/pageOffset parameters), rate limits, authentication requirements, error conditions, or the format of returned data. For a list operation with 5 parameters, this leaves significant gaps in understanding how the tool behaves in practice.

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 concise with three sentences that efficiently convey the core functionality, filtering options, and a use case. It's front-loaded with the main purpose and avoids unnecessary details. However, the third sentence ('Helpful for reviewing current or past incidents') is somewhat redundant with the filtering mention, slightly reducing efficiency.

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 of a list operation with 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain the return format, pagination behavior, error handling, or the semantics of undocumented parameters like limit and pageOffset. For a tool in this context, more comprehensive guidance is needed to ensure the agent can 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?

The schema description coverage is 0%, meaning none of the 5 parameters are documented in the schema. The description only vaguely references 'filter by active/archived status' (likely related to includeArchived) and 'query strings' (likely related to query), but doesn't explain the purpose or usage of pageSize, pageOffset, or limit parameters. This insufficiently compensates for the lack of schema documentation, leaving most parameters semantically unclear.

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: 'List incidents from Datadog's incident management system.' It specifies the resource (incidents) and source (Datadog's incident management system), making it easy to understand what the tool does. However, it doesn't explicitly distinguish this tool from its siblings (e.g., get-events, get-monitors), which prevents a perfect score.

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 some implied usage guidance by mentioning filtering capabilities ('Can filter by active/archived status and use query strings to find specific incidents') and a use case ('Helpful for reviewing current or past incidents'). However, it lacks explicit instructions on when to use this tool versus alternatives (e.g., get-events for events, get-monitors for monitors), and doesn't specify prerequisites or exclusions, leaving room for ambiguity.

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