Skip to main content
Glama
brukhabtu

Datadog MCP Server

by brukhabtu

ListIncidents

Retrieve all incidents for your organization, including related objects like users and attachments. Manage pagination with size and offset parameters for precise control over the response data.

Instructions

Get all incidents for the user's organization.

Query Parameters:

  • include: Specifies which types of related objects should be included in the response.

  • page[size]: Size for a given page. The maximum allowed value is 100.

  • page[offset]: Specific offset to use as the beginning of the returned page.

Responses:

  • 200 (Success): OK

    • Content-Type: application/json

    • Response Properties:

      • data: An array of incidents.

      • included: Included related resources that the user requested.

    • Example:

{
  "data": [
    {
      "attributes": {
        "created": "2020-04-21T15:34:08.627205+00:00",
        "creation_idempotency_key": null,
        "customer_impact_duration": 0,
        "customer_impact_end": null,
        "customer_impact_scope": null,
        "customer_impact_start": null,
        "customer_impacted": false,
        "detected": "2020-04-14T00:00:00+00:00",
        "incident_type_uuid": "00000000-0000-0000-0000-000000000001",
        "modified": "2020-09-17T14:16:58.696424+00:00",
        "public_id": 1,
        "resolved": null,
        "severity": "SEV-1",
        "time_to_detect": 0,
        "time_to_internal_response": 0,
        "time_to_repair": 0,
        "time_to_resolve": 0,
        "title": "Example Incident"
      },
      "id": "00000000-aaaa-0000-0000-000000000000",
      "relationships": {
        "attachments": {
          "data": [
            {
              "id": "00000000-9999-0000-0000-000000000000",
              "type": "incident_attachments"
            },
            {
              "id": "00000000-1234-0000-0000-000000000000",
              "type": "incident_attachments"
            }
          ]
        },
        "commander_user": {
          "data": {
            "id": "00000000-0000-0000-cccc-000000000000",
            "type": "users"
          }
        },
        "created_by_user": {
          "data": {
            "id": "00000000-0000-0000-cccc-000000000000",
            "type": "users"
          }
        },
        "integrations": {
          "data": [
            {
              "id": "00000000-0000-0000-4444-000000000000",
              "type": "incident_integrations"
            },
            {
              "id": "00000000-0000-0000-5555-000000000000",
              "type": "incident_integrations"
            }
          ]
        },
        "last_modified_by_user": {
          "data": {
            "id": "00000000-0000-0000-cccc-000000000000",
            "type": "users"
          }
        }
      },
      "type": "incidents"
    },
    {
      "attributes": {
        "created": "2020-04-21T15:34:08.627205+00:00",
        "creation_idempotency_key": null,
        "customer_impact_duration": 0,
        "customer_impact_end": null,
        "customer_impact_scope": null,
        "customer_impact_start": null,
        "customer_impacted": false,
        "detected": "2020-04-14T00:00:00+00:00",
        "incident_type_uuid": "00000000-0000-0000-0000-000000000002",
        "modified": "2020-09-17T14:16:58.696424+00:00",
        "public_id": 2,
        "resolved": null,
        "severity": "SEV-5",
        "time_to_detect": 0,
        "time_to_internal_response": 0,
        "time_to_repair": 0,
        "time_to_resolve": 0,
        "title": "Example Incident 2"
      },
      "id": "00000000-1111-0000-0000-000000000000",
      "relationships": {
        "attachments": {
          "data": [
            {
              "id": "00000000-9999-0000-0000-000000000000",
              "type": "incident_attachments"
            }
          ]
        },
        "commander_user": {
          "data": {
            "id": "00000000-aaaa-0000-0000-000000000000",
            "type": "users"
          }
        },
        "created_by_user": {
          "data": {
            "id": "00000000-aaaa-0000-0000-000000000000",
            "type": "users"
          }
        },
        "integrations": {
          "data": [
            {
              "id": "00000000-0000-0000-0001-000000000000",
              "type": "incident_integrations"
            },
            {
              "id": "00000000-0000-0000-0002-000000000000",
              "type": "incident_integrations"
            }
          ]
        },
        "last_modified_by_user": {
          "data": {
            "id": "00000000-aaaa-0000-0000-000000000000",
            "type": "users"
          }
        }
      },
      "type": "incidents"
    }
  ],
  "included": [
    "unknown_type"
  ],
  "meta": "unknown_type"
}
  • 400: Bad Request

    • Content-Type: application/json

    • Response Properties:

      • errors: A list of errors.

    • Example:

{
  "errors": [
    "Bad Request"
  ]
}
  • 401: Unauthorized

    • Content-Type: application/json

    • Response Properties:

      • errors: A list of errors.

    • Example:

{
  "errors": [
    "Bad Request"
  ]
}
  • 403: Forbidden

    • Content-Type: application/json

    • Response Properties:

      • errors: A list of errors.

    • Example:

{
  "errors": [
    "Bad Request"
  ]
}
  • 404: Not Found

    • Content-Type: application/json

    • Response Properties:

      • errors: A list of errors.

    • Example:

{
  "errors": [
    "Bad Request"
  ]
}
  • 429: Too many requests

    • Content-Type: application/json

    • Response Properties:

      • errors: A list of errors.

    • Example:

{
  "errors": [
    "Bad Request"
  ]
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeNoSpecifies which types of related objects should be included in the response.
page[offset]NoSpecific offset to use as the beginning of the returned page.
page[size]NoSize for a given page. The maximum allowed value is 100.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesAn array of incidents.
metaNo
includedNoIncluded related resources that the user requested.

Implementation Reference

  • Whitelists the Datadog /api/v2/incidents endpoint (line 113) as a safe read-only MCP tool via RouteMap with MCPType.TOOL. This registers the 'ListIncidents' tool (derived from OpenAPI operationId) for proxying GET requests to Datadog incidents API.
    def _get_route_filters(self) -> list[RouteMap]:
        """Get route filtering rules for safe observability-focused tools.
    
        Security Model:
        1. DENY ALL destructive operations (POST, PUT, PATCH, DELETE)
        2. ALLOW ONLY specific read-only GET endpoints
        3. DEFAULT DENY everything else
    
        This whitelist approach ensures only safe, read-only operations
        are exposed through the MCP interface.
        """
        # Define safe read-only endpoints for observability workflows
        safe_endpoints = [
            # Metrics and time-series data
            r"^/api/v2/metrics.*",  # Query metrics data
            r"^/api/v2/query/.*",  # Time-series queries
            # Dashboards and visualizations
            r"^/api/v2/dashboards.*",  # Dashboard configurations
            r"^/api/v2/notebooks.*",  # Notebook data
            # Monitoring and alerts
            r"^/api/v2/monitors.*",  # Monitor configurations
            r"^/api/v2/downtime.*",  # Scheduled downtimes
            r"^/api/v2/synthetics.*",  # Synthetic tests
            # Logs and events
            r"^/api/v2/logs/events/search$",  # Search logs
            r"^/api/v2/logs/events$",  # List log events
            r"^/api/v2/logs/config.*",  # Log pipeline configs
            # APM and traces
            r"^/api/v2/apm/.*",  # APM data
            r"^/api/v2/traces/.*",  # Trace data
            r"^/api/v2/spans/.*",  # Span data
            # Infrastructure
            r"^/api/v2/hosts.*",  # Host information
            r"^/api/v2/tags.*",  # Tag management (read)
            r"^/api/v2/usage.*",  # Usage statistics
            # Service management
            r"^/api/v2/services.*",  # Service catalog
            r"^/api/v2/slos.*",  # Service level objectives
            r"^/api/v2/incidents.*",  # Incident management
            # Security and compliance
            r"^/api/v2/security_monitoring.*",  # Security signals
            r"^/api/v2/cloud_workload_security.*",  # CWS data
            # Teams and organization (read-only)
            r"^/api/v2/users.*",  # User information
            r"^/api/v2/roles.*",  # Role information
            r"^/api/v2/teams.*",  # Team structure
            # API metadata
            r"^/api/v2/api_keys$",  # List API keys (no create/delete)
            r"^/api/v2/application_keys$",  # List app keys (no create/delete)
        ]
    
        filters = [
            # SECURITY: Block ALL destructive operations first
            RouteMap(
                methods=["POST", "PUT", "PATCH", "DELETE"], mcp_type=MCPType.EXCLUDE
            ),
        ]
    
        # Add whitelisted read-only endpoints
        filters.extend(
            RouteMap(
                pattern=pattern,
                methods=["GET"],
                mcp_type=MCPType.TOOL,
            )
            for pattern in safe_endpoints
        )
    
        # SECURITY: Default deny everything else
        filters.append(RouteMap(pattern=r".*", mcp_type=MCPType.EXCLUDE))
    
        return filters
  • Creates the FastMCP server instance using the OpenAPI spec and route maps, generating handlers for all whitelisted endpoints including incidents. The handler proxies authenticated requests to Datadog API.
    self.mcp_server = FastMCP.from_openapi(
        openapi_spec=openapi_spec,
        client=auth_client,
        route_maps=route_maps,
    )
  • Creates the authenticated httpx client passed to FastMCP, used by all tool handlers including ListIncidents for API calls.
    async def _create_authenticated_client(self) -> httpx.AsyncClient:
        """Create an authenticated HTTP client for Datadog API calls."""
        headers = self.datadog_client.get_auth_headers()
    
        return httpx.AsyncClient(
            base_url=self.config.datadog.base_url,
            headers=headers,
            timeout=self.config.datadog.timeout,
        )
  • Loads the Datadog OpenAPI specification containing input/output schemas for the incidents endpoints, used to generate MCP tool schemas including ListIncidents.
    def _load_openapi_spec(self) -> dict[str, Any]:
        """Load the OpenAPI specification from file or use bundled version."""
        import logging
    
        logger = logging.getLogger("datadog_mcp")
    
        # Use custom path if provided, otherwise use bundled spec
        if self.config.datadog.openapi_spec_path:
            spec_path = Path(self.config.datadog.openapi_spec_path)
            logger.info(f"Using custom OpenAPI spec: {spec_path}")
        else:
            spec_path = self._get_bundled_spec_path()
            logger.info("Using bundled OpenAPI spec")
    
        try:
            with open(spec_path, encoding="utf-8") as f:
                if spec_path.suffix in [".yaml", ".yml"]:
                    import yaml
                    spec: dict[str, Any] = yaml.safe_load(f)
                else:
                    spec = json.load(f)
                return spec
        except FileNotFoundError as e:
            msg = f"OpenAPI spec file not found: {spec_path}"
            raise FileNotFoundError(msg) from e
        except (json.JSONDecodeError, yaml.YAMLError) as e:
            msg = f"Invalid specification in file {spec_path}: {e}"
            raise ValueError(msg) from e
Behavior3/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 implies a read-only operation ('Get') and includes details like pagination parameters and response formats, which adds context. However, it misses critical behavioral traits such as authentication requirements, rate limits, or whether the operation is idempotent, leaving gaps for a tool with organizational scope.

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

Conciseness2/5

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

The description is overly verbose and poorly structured, with extensive HTTP response details (including full JSON examples for multiple status codes) that belong in an output schema or API documentation, not a tool description. The core purpose is buried under redundant information, making it inefficient for an AI agent to parse 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 (list operation with pagination and inclusions), the description covers key aspects like parameters and response structure, and an output schema exists (implied by the detailed responses). However, the lack of behavioral context (e.g., auth, limits) and usage guidelines reduces completeness, though the output schema mitigates some gaps.

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 schema description coverage is 100%, so the input schema already documents all three parameters thoroughly. The description repeats the parameter explanations verbatim from the schema (e.g., 'Specifies which types of related objects should be included in the response'), adding no additional semantic value beyond what is already structured. This meets the baseline for high schema coverage.

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: 'Get all incidents for the user's organization.' It specifies the verb ('Get'), resource ('incidents'), and scope ('user's organization'), which is specific and actionable. However, it does not explicitly distinguish this tool from its sibling 'SearchIncidents', which might offer filtering capabilities, so it falls short of 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 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 'SearchIncidents' or 'GetIncident'. It lacks any mention of prerequisites, exclusions, or contextual cues for selection, leaving the agent to infer usage based on the tool name alone.

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

Related 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/brukhabtu/datadog-mcp'

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