Connect Datadog to Claude Code

Search logs, query metrics, and triage monitors, incidents, and hosts. Add Toolspoke to Claude Code once and it can use 14 Datadog actions. Your Datadog credential stays in Toolspoke, and you choose which actions Claude Code may call.

Set it up in Claude Code

Three steps, the first one once for every toolkit you will ever add.

  1. Add Toolspoke to Claude Code

    Run it in your project, then /mcp to sign in

    claude mcp add --transport http toolspoke https://toolspoke.com/mcp

    The sign-in opens in your browser, and Toolspoke asks you to approve it.

  2. Install Datadog and connect it

    Add Datadog to a project in your Toolspoke workspace.

    API and application keys. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.

    API key
    Datadog → Organization Settings → API Keys. Sent as the DD-API-KEY header.
    Application key
    Datadog → Organization Settings → Application Keys. Sent as DD-APPLICATION-KEY. Reads inherit the scopes of the key, so give it at least monitors_read, dashboards_read, incident_read and logs_read_data.
  3. Choose what Claude Code may do

    All 14 actions start on. Switch off any of the 2 actions that change something in Datadog, and Claude Code gets a refusal if it tries.

What you can ask Claude Code for

A few of the Datadog actions that only read, so they are safe to try first.

  • Return individual log events matching a Datadog log search query, newest first
  • Count or measure logs instead of listing them, optionally broken down by a facet
  • Evaluate a Datadog metric query over a time window and return the points
  • List monitors with their current alert state, which is the fastest way to see what is alerting right now

What Claude Code can do in Datadog

12 actions read, one writes and one deletes or permanently changes something.

Reads

  • Search logs

    Return individual log events matching a Datadog log search query, newest first. Use this when you need the actual lines around an incident; use aggregate_logs when you want counts, rates or a breakdown instead, because a raw search of a noisy service will fill a context window without answering the question. Time bounds accept Datadog's relative syntax (now-15m, now-1h) as well as ISO 8601.

  • Aggregate logs

    Count or measure logs instead of listing them, optionally broken down by a facet. This is the right first call for "how many errors, by service, in the last hour", it returns a handful of buckets rather than thousands of lines. Follow up with search_logs on the worst bucket to read the actual events.

  • Query timeseries

    Evaluate a Datadog metric query over a time window and return the points. The query uses Datadog's own syntax, e.g. "avg:system.cpu.user{env:prod} by {host}" or "sum:trace.http.request.errors{service:checkout}.as_rate()". Call list_metrics first if you do not know the exact metric name. Timestamps are epoch milliseconds.

  • List metrics

    List the metric names that have reported since a point in time, so query_timeseries can be given a name that actually exists. `from` is epoch SECONDS, not milliseconds, and is required by Datadog, pass the start of the period you care about.

  • List monitors

    List monitors with their current alert state, which is the fastest way to see what is alerting right now. Returns the numeric monitor ids that get_monitor, mute_monitor and unmute_monitor need. Filter with name for a substring of the monitor title, or tags for the scope a monitor watches.

  • Get monitor

    Fetch one monitor by its numeric id: its query, thresholds, notification message, current state and per-group states. Call list_monitors first to find the id. Use this before muting anything, so the mute is applied to the monitor you meant.

  • List events

    Search the Datadog event stream, deploys, monitor transitions, integration events and anything posted through the events intake. Use it to line an alert up against a deployment. Reverse it with a query like "source:github" or "tags:service:checkout". Time bounds accept Datadog's relative syntax.

  • List incidents

    List Datadog incidents newest first, with their state, severity and commander. Use it to see what is currently declared before deciding whether an alert is already being handled, then pass an id to get_incident. Requires the Incident Management product and an application key with incident_read.

  • Get incident

    Fetch one incident by its UUID: title, state, severity, timeline fields, and the users attached to it. Call list_incidents first for the id. Pass include to pull related records back in the same call rather than making a second one.

  • List dashboards

    List dashboards with their ids, titles and authors. Use it to find the dashboard id that get_dashboard needs; the widget definitions are not included here.

  • Get dashboard

    Fetch one dashboard by id, including its widget definitions and the metric queries behind them. This is the quickest way to learn which queries a team already trusts for a service, read the widgets, then re-run one through query_timeseries. Deeply nested widget groups are trimmed.

  • List hosts

    List hosts reporting to Datadog with their tags, apps and mute status. Hosts seen in the last three hours are returned by default; pass `from` as epoch seconds to widen that. Use it to confirm whether a host stopped reporting at all, which no metric query can tell you.

Writes

  • Unmute monitor

    Restore notifications for a monitor that mute_monitor silenced. Pass the same scope that was muted to lift one scope; omit it to clear the monitor's mute entirely.

Deletes or permanently changes

  • Mute monitor

    Silence a monitor so it stops notifying, optionally only for one scope and only until a given time. This changes what the on-call rota sees: while a monitor is muted nobody is paged for it, so always set `end` unless a human has asked for an open-ended mute. Reverse it with unmute_monitor.

Datadog in Claude Code: questions

Does Claude Code see my Datadog credential?

No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.

Can I stop Claude Code from changing things in Datadog?

Yes. Each of the 14 actions can be switched off for a project. Turn off the 2 that change something and Claude Code can only read.

Will 14 actions crowd Claude Code's context?

No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the Datadog action it needs when it needs it. Adding more toolkits does not add more tools to its list.

Can I add it once for every project?

Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.

What does it cost?

Tool calls are free on every plan, and a Datadog call does not run in a sandbox, so it bills nothing.

Try Datadog in Claude Code

Free to start, and tool calls cost nothing on any plan.