---
title: "Summarise Datadog with Claude Code | EnConvert"
description: "Summarise Datadog dashboards and runbooks inside a Claude Code MCP tool using EnConvert Distill to return schema-defined fields in one synchronous API call"
canonical: "https://www.enconvert.com/solutions/summarise-datadog-with-claude-code-enconvert"
locale: "en"
---

# How to Summarise Datadog with Claude Code

A developer using Claude Code to triage or investigate infrastructure issues needs structured summaries of Datadog pages before the agent can reason over them. Datadog dashboards, runbooks, and incident pages mix alert panels, metric graphs, log streams, and navigation chrome that return no clean text when fetched directly, and the Datadog API needs API and application keys and a separate endpoint for each resource before a page can be read as structured content. EnConvert Distill accepts the publicly accessible Datadog page URL and a schema the developer defines, and returns structured fields in one synchronous call. Claude Code gets schema-defined page content through the MCP tool with no Datadog API credentials.

## Example

```python
import os

import requests
from mcp.server.fastmcp import FastMCP

mcp = FastMCP("datadog-pages")

BASE_URL = "https://api.enconvert.com/v2"
headers = {
    "X-API-Key": os.environ["ENCONVERT_API_KEY"],  # supplied to the server through the "env" setting of its MCP configuration
    "Content-Type": "application/json",
}

DATADOG_SCHEMA = {
    "title": "The page title, such as the dashboard or incident name",
    "summary": "A concise summary of what the page shows or describes",
    "alert_status": "The current alert or incident status shown on the page",
    "affected_services": "The services or infrastructure components named on the page, as a list",
    "key_metrics": "Notable metric names and values visible as text on the page, as a list",
    "recommended_actions": "Any runbook steps or remediation guidance shown, as a list",
}

def as_text(value) -> str:
    if isinstance(value, list):
        return "; ".join(str(item) for item in value) or "none stated"
    return str(value) if value else "none stated"

@mcp.tool()
def summarise_datadog_pages(urls: list[str]) -> str:
    """Reads publicly accessible Datadog pages and returns structured fields for each:
    title, summary, alert status, affected services, key metrics, and recommended actions."""
    if len(urls) > 50:
        return "Too many URLs. Distill accepts at most 50 per call."

    # One synchronous call: no job_id, no polling, no download step
    response = requests.post(
        f"{BASE_URL}/distill",
        headers=headers,
        json={"urls": urls, "schema": DATADOG_SCHEMA},
        timeout=300,
    )

    # Distill runs on paid plans only, and the free tier returns 402
    if response.status_code == 402:
        return "Distill requires a paid plan."
    response.raise_for_status()

    pages = []
    for result in response.json()["results"]:
        if result["status"] != "completed":
            pages.append(f"Source: {result['url']}\nCould not be read ({result['status']}).")
            continue

        # A render_quality below 0.5 may mean a login wall or challenge page
        render_quality = result.get("render_quality", 1.0)
        if render_quality < 0.5:
            pages.append(
                f"Source: {result['url']}\nLow render quality ({render_quality}), skipped."
            )
            continue

        data = result["data"]  # keys match DATADOG_SCHEMA exactly
        pages.append(
            f"Source: {result['url']}\n"
            f"Title: {data['title']}\n"
            f"Alert status: {as_text(data['alert_status'])}\n"
            f"Affected services: {as_text(data['affected_services'])}\n"
            f"Key metrics: {as_text(data['key_metrics'])}\n"
            f"Recommended actions: {as_text(data['recommended_actions'])}\n"
            f"Summary: {data['summary']}"
        )
    return "\n\n---\n\n".join(pages)

if __name__ == "__main__":
    mcp.run()
```

## Output

Distill returns schema-defined fields inline as structured JSON in the data object, with no polling and no job_id. The render_quality score lets the tool detect a login wall or challenge page before Claude Code reasons over incomplete content. The Datadog API requires API and application keys plus separate endpoint calls per resource type; Distill requires only the page URL and an API key.

## Get started

[Get free API key — 500 ops per month, no card required. Note: Distill runs on paid plans. Free tier returns 402.](https://www.enconvert.com/auth?mode=signup)

## Related solutions

- [How to Summarise GitHub with Pydantic AI](https://www.enconvert.com/solutions/summarise-github-with-pydantic-ai-enconvert.md)
- [How to Summarise Google Docs with LangGraph](https://www.enconvert.com/solutions/summarise-google-docs-with-langgraph-enconvert.md)
- [How to Summarise GitHub with LlamaIndex](https://www.enconvert.com/solutions/summarise-github-with-llamaindex-enconvert.md)
- [How to Summarise Google Docs with Pydantic AI](https://www.enconvert.com/solutions/summarise-google-docs-with-pydantic-ai-enconvert.md)
- [How to Summarise YouTube Transcripts with LlamaIndex](https://www.enconvert.com/solutions/summarise-youtube-transcripts-with-llamaindex-enconvert.md)
- [How to Summarise GitHub Issues with CrewAI](https://www.enconvert.com/solutions/summarise-github-issues-with-crewai-enconvert.md)
