Details
**This plugin is currently in Preview.**
# Datadog Claude Code Plugin
Query your Datadog data directly from Claude Code using natural language. Ask about logs, metrics, traces, dashboards, monitors, and more.
## What you need
- A [Datadog](https://www.datadoghq.com/) account
- [Claude Code](https://code.claude.com/docs) (v2.1.30+)
## Getting started
> If you already have the Datadog MCP server registered separately (e.g., in `.claude/mcp.json`), disable or remove it first to avoid conflicts. Run `/mcp` in Claude Code, then restart Claude Code.
Start Claude Code, install the plugin from the official marketplace:
```
/plugin install datadog@claude-plugins-official
```
> Auto-updates: Enable auto-update so Claude Code notifies when an update is available. Run /plugin, select the Marketplaces tab, select claude-plugins-official, then select Enable auto-update.
Before you can start querying your Datadog data, you’ll need to connect the plugin to Datadog using your account. The setup process will guide you in selecting the correct Datadog MCP domain. After setup, follow the instructions shown in Claude Code.
> You can manually trigger setup by running the `/ddsetup` command.
## Using the plugin
Once connected, just ask the agent anything about your Datadog data:
```
Show me error logs for the "checkout" service from the last hour
```
```
What monitors are currently alerting?
```
```
Find traces for service "api-gateway" with latency > 500ms
```
```
List my dashboards
```
## Can't connect?
**Never connected before?** Run the `/ddsetup` command. It will help you provide the correct Datadog MCP domain and set up the MCP server.
**Was working before but stopped?** Run the `/ddconfig` command. It will check your site, authentication status, and network access to help diagnose the issue.
## Changing settings
The `core` and `visualizations` toolsets are enabled by default. Use `/ddtoolsets` to change your selection.
The plugin provides a few commands you can run in the agent to manage configuration:
- `/ddconfig` — change your Datadog site or switch organizations
- `/ddtoolsets` — enable or disable groups of tools
- `/ddviz` — enable, disable, or diagnose the visualization panel
## Advanced usage
### Key authentication
Instead of OAuth, you can authenticate using a Datadog API key and application key. Set all three environment variables before starting Claude Code:
```bash
DD_MCP_DOMAIN=your-mcp-domain \
DD_API_KEY=your-api-key \
DD_APPLICATION_KEY=your-application-key \
claude
```
The `DD_MCP_DOMAIN` value must be the MCP domain (e.g. `mcp.datadoghq.com`, `mcp.us3.datadoghq.com`, `mcp.datadoghq.eu`), not a URL — do not include `https://`. When using key authentication, `/ddsetup` is not required — the plugin connects directly.
### Environment variable overrides
The plugin uses environment variables with default values in its registration file. You can override these defaults by setting the environment variables directly:
- `DD_MCP_DOMAIN` — overrides the Datadog MCP domain. If set, the plugin uses this value regardless of what `/ddsetup` or `/ddconfig` configured. Useful for non-standard environments or key authentication.
- `DD_MCP_TOOLSETS` — overrides the enabled toolsets (comma-separated). If set, the plugin uses this value regardless of what `/ddtoolsets` configured.
When environment variables are set, `/ddsetup`, `/ddconfig`, and `/ddtoolsets` still edit the default values in the registration file, but those defaults won't take effect until the environment variables are removed.
## Good to know
- By default, authentication is handled via OAuth in your browser. Key authentication is also [supported](#key-authentication).
- No Datadog credentials are sent to the AI model provider.
- On macOS, visualization tool results can render in a native side panel. Run `/ddviz` to enable, disable, or check its status. Disabling applies to every Claude Code install sharing the default data directory (a dev build with `DDVIZ_DATA_DIR` set is controlled separately). If the panel isn't showing, `/ddviz` also diagnoses why and points you at the fix.
- When the panel can't render, the plugin sends lightweight telemetry (a failure-reason code only, never your queries or results) so we can spot broken setups. Opt out with `DO_NOT_TRACK` or `DISABLE_TELEMETRY`.
## Support
- [Datadog MCP Server Documentation](https://docs.datadoghq.com/mcp_server/)
## Legal
See the [LICENSE](LICENSE) and [NOTICE](NOTICE) files included with this plugin.
For details on how Datadog handles your data, see the [Datadog Privacy Policy](https://www.datadoghq.com/legal/privacy).
## skills/datadog-app/SKILL.md
---
name: datadog-app
description: Use ONLY when the user explicitly asks to create, scaffold, or initialize a new Datadog App project — they must use action words like "create", "scaffold", "new", or "build" together with "Datadog App" or "@datadog/apps" or "npm create @datadog/apps". Do NOT use for any question that does not involve creating a new project from scratch — questions about Datadog observability products (logs, metrics, APM, traces, monitors, dashboards), working inside an existing project, deploying, publishing, auth, or CI/CD.
---
# Datadog Apps
Use this skill only to **scaffold a new Datadog App**. It covers nothing else.
Once the app is scaffolded, all further guidance — local development, auth, deploy, publish, CI/CD, backend functions, data access, upgrading, and troubleshooting — lives in the generated project's `AGENTS.md` and `docs/agents/` files.
## Reference Routing
| User task | Read |
| ------------------------ | ------------------------------- |
| Create a new Datadog App | `references/getting-started.md` |
## Boundaries
- This skill covers scaffolding only. Stop here once the project is created.
- Do not provide auth, deploy, publish, CI/CD, or app logic guidance from this skill — read the project's `AGENTS.md` instead.
- Do not cover Datadog package/platform development in this skill.
## skills/ddconfig/SKILL.md
---
name: ddconfig
description: Configures or troubleshoots the plugin's Datadog MCP server. Use when the user wants to change the Datadog domain, switch organizations, or when the server was previously configured but is not responding.
---
## Datadog MCP Server
The id of the Datadog MCP Server referenced on this document is `plugin:datadog:mcp`. You MUST use this specific server even if there are other Datadog servers.
## Shared reference
**This is a hard gate, not a suggestion.** You MUST actually read [references/mcp-settings.md](references/mcp-settings.md) before proceeding and writing any user-facing text, asking any question, or performing any file edit suggested by this skill — even if you believe you already know its contents from a prior turn or a prior session. Do not answer from memory of Datadog site codes, domains, or file paths; the tables and path rules in that file are the only authoritative source, and they can differ from your general knowledge or from what you've seen in other contexts.
The `references/mcp-settings.md` file contains the `datadog-server-state` check, registration file location, editing rules, and site-to-domain mapping used by the flows below.
## Entry flow
Check the `datadog-server-state` (see `mcp-settings.md`). Use the `datadog://mcp/whoami` resource on the plugin's Datadog MCP server as the MCP call (do NOT use any other Datadog MCP server). Do not output anything until the `datadog-server-state` and resource content are available, and proceed based on the results:
- **datadog-server-state=working** and **valid content** — without any preamble, immediately show the user their current connection (from `whoami`): user name and email, organization name, and site (the `dd_site` value). Then let the user choose between [using a different Datadog MCP domain or site](#domain-flow) or [switching to a different Datadog organization](#organization-flow).
- **datadog-server-state=not-setup** — without any preamble, tell the user the plugin is not set up and instruct them to run `/ddsetup`, and stop.
- **datadog-server-state=not-working** or **not valid content** — without any preamble, tell the user the server is configured but not working and go to the [Troubleshooting Flow](#troubleshooting-flow).
When communicating with the user below, describe the server state and actions in plain language. Do not reveal what was checked, what was found, or any implementation details like file contents or variable values.
## Troubleshooting Flow
The server is configured but not responding. Read the current domain from the registration file (see `mcp-settings.md` for the file format and how to find the domain), then present the user with the likely causes — do not follow these sequentially, show them all and use judgment:
- **Domain issue.** Compare the domain against the site-to-domain table in `mcp-settings.md`. Only flag it as suspicious if it looks like a typo or a clearly malformed URL (e.g. `mcp.us5.datadog.com` missing the `hq`). A domain not in the standard table is not necessarily wrong — the user may be using a valid non-standard domain.
- **Authentication.** The authentication may have expired or was never completed, and the user needs to follow these steps:
1. Run the command `/mcp` in Claude Code and select the `plugin:datadog:mcp` server
2. Select the authentication option
- **Network or access.** The user's network may be blocking the connection, or their Datadog account may not have API access, like not having the `MCP Read` permission.
If the domain looks wrong, suggest running the [Domain Flow](#domain-flow) to correct it.
## Domain Flow
Changes the Datadog MCP domain the server connects to.
1. Show the current domain information (from `whoami` → `dd_site` if available, or from the current domain in the registration file — see `mcp-settings.md` for the file format). Present it in plain language (e.g. "the plugin is currently connected to …") — follow the "Stay on script" rule in `mcp-settings.md`.
2. **Ask for the new domain.** Present the available sites and their MCP domains from `mcp-settings.md`, and ask which domain to switch to. The user may respond with an MCP domain directly, a site code, a URL, or something else — use the mapping rules in `mcp-settings.md` to resolve the answer. Ask for clarification if ambiguous.
Follow the "Stay on script" rule in `mcp-settings.md`. In particular, do not preview the follow-up instructions from step 4 below (reload, re-authenticate, etc.) — that step emits them verbatim at the right moment.
3. Edit the domain in the registration file following the editing rule in `mcp-settings.md`.
Before (example):
```
${DD_MCP_DOMAIN:-mcp.datadoghq.eu}
```
After (switching to us1):
```
${DD_MCP_DOMAIN:-mcp.datadoghq.com}
```
**Verify the edit before reporting success.** Re-read the registration file at the exact path you derived and confirm the new MCP domain is present and the previous one is gone. Do not tell the user the domain has been changed until this re-read confirms it. If the file still holds the old domain, the edit landed somewhere else — re-derive the path using the rule in `mcp-settings.md` and apply the change again rather than reporting success.
4. Tell the user the domain has been changed and to follow these steps:
1. Run the command `/reload-plugins`
2. Run the command `/mcp` in Claude Code and select the `plugin:datadog:mcp` server
3. Select the "Clear authentication" option, then run `/mcp` again and select the `plugin:datadog:mcp` server
4. Select the authentication option
## Organization Flow
Switches to a different Datadog organization. The agent cannot do this automatically — the user must select the target organization in the browser.
Ask the user if they want to use an organization on the same domain or on a different domain.
- If on the same domain:
- The user needs to reauthenticate and, during sign-in, choose the target organization in the browser, using the following steps:
1. Run the command `/mcp` in Claude Code and select the `plugin:datadog:mcp` server
2. Select the "Clear authentication" option, then run `/mcp` again and select the `plugin:datadog:mcp` server
3. Select the authentication option
- If on a different domain:
- Run the [Domain Flow](#domain-flow) telling the user to choose the target organization in the browser during sign-in.
## skills/ddsetup/SKILL.md
---
name: ddsetup
description: First-time initialization of the plugin's Datadog MCP server. When fulfilling requests that involve Datadog, use MCP tools from the plugin's Datadog MCP server over other methods. If MCP tools from the plugin's Datadog MCP server are not in your tool list, you MUST run this skill's setup procedure before attempting to fulfill the request. Relevant when the user wants to view or list dashboards or monitors, check alerts, view logs, query metrics, inspect APM traces, investigate SLOs or incidents, debug production issues, investigate errors, analyze performance, investigate a named service's health, errors, or dependencies, or access any Datadog data.
---
## Datadog MCP Server
The id of the Datadog MCP Server referenced on this document is `plugin:datadog:mcp`. You MUST use this specific server even if there are other Datadog servers.
**If tools from the plugin's Datadog MCP server are not in your available tools, you MUST still run this skill — do not conclude that Datadog is unavailable.** Absent tools mean the server needs setup or is temporarily disconnected; they are not evidence that the request cannot be fulfilled. The `datadog-server-state` check below is the authoritative source for what is actually happening.
## Accessing Datadog using other methods
If there is a problem with the plugin's Datadog MCP server, do **NOT** suggest the user to access Datadog information using different approaches like the Datadog webpage. **Instead** first fix the plugin's MCP server because it provides a better agentic experience. Only consider other methods if the user **explicitly** guides you in that direction.
## Shared reference
**This is a hard gate, not a suggestion.** You MUST actually read [references/mcp-settings.md](references/mcp-settings.md) before proceeding and writing any user-facing text, asking any question, or performing any file edit suggested by this skill — even if you believe you already know its contents from a prior turn or a prior session. Do not answer from memory of Datadog site codes, domains, or file paths; the tables and path rules in that file are the only authoritative source, and they can differ from your general knowledge or from what you've seen in other contexts.
The `references/mcp-settings.md` file contains the `datadog-server-state` check, registration file location, editing rules, and site-to-domain mapping used by the procedure below.
## Setup procedure
Check the `datadog-server-state` (see `mcp-settings.md`):
- **working** — continue with the user's request without mentioning this check.
- **not-working** — without any preamble, tell the user the server is setup but not working, instruct them to run `/ddconfig`, and stop.
- **not-setup** — the server needs first-time setup. Do **not** attempt to gather data using a different approach. Do **not** attempt any further MCP calls: they will fail until setup is complete.
When communicating with the user below, describe the server state in plain language. Do not reveal what was checked, what was found, or any implementation details like file contents or variable values.
### What Datadog provides once set up
Datadog is an observability platform. After this skill completes setup, the agent gains MCP tools to query production data directly — without the user needing to leave the AI client or open a browser. Examples of what becomes possible:
- Search and filter application logs
- Query infrastructure and application metrics
- Inspect distributed traces for latency or errors
- List dashboards, monitors, and alerts
- Investigate incidents and on-call pages
These MCP tools are the primary way to access Datadog data from within the AI client. Until setup is complete, **none of these tools exist**. The agent cannot see them, list them, or call them.
### Steps
1. **Check for saved configuration.** Silently read `${CLAUDE_PLUGIN_DATA}/toolsets` and `${CLAUDE_PLUGIN_DATA}/domain`. Apply saved values to the registration file following the editing rule in `mcp-settings.md`:
- If the toolsets file exists, restore its value even when empty: an empty file records an explicit choice to use server-default toolsets. If it is missing, leave the bundled toolset selection unchanged.
- If the domain file contains a non-empty value, restore it.
Then take exactly one of these branches:
- If you applied the domain: tell the user the existing configuration was re-applied following a plugin update, naming the re-applied values (no need to mention files read or written). Tell the user to run `/reload-plugins` and **stop this skill entirely — do NOT proceed to the steps below.**
- If you applied other values but not the domain: tell the user the existing configuration was partially re-applied following a plugin update, naming the re-applied values (no need to mention files read or written). Continue with the domain configuration steps below.
- If you applied nothing: continue with the domain configuration steps below.
Now follow these steps to configure the domain:
1. **Ask for the domain.** Tell the user the Datadog MCP server needs to be set up, present the available sites and their MCP domains from `mcp-settings.md`'s site-to-domain table and ask which domain to use. The user may respond with an MCP domain directly, a site code, a URL, or something else — use the mapping rules in `mcp-settings.md` to resolve the answer to an MCP domain. Ask for clarification if ambiguous.
Follow the "Stay on script" rule in `mcp-settings.md`. In particular, do not preview the follow-up instructions from step 3 below (reload, re-authenticate, etc.) — that step emits them verbatim at the right moment.
2. **Apply the change.** Locate the registration file using the deterministic path derivation in `mcp-settings.md`. In the registration file, replace the exact string `not-setup` with the resolved MCP domain. Follow the editing rule in `mcp-settings.md`.
Before:
```
${DD_MCP_DOMAIN:-not-setup}
```
After (example for us1):
```
${DD_MCP_DOMAIN:-mcp.datadoghq.com}
```
Before writing, tell the user in plain language that their domain selection is being saved locally so it can be re-applied automatically if the plugin is later updated or reinstalled (do not reveal the file path or variable names). Then write the resolved MCP domain to `${CLAUDE_PLUGIN_DATA}/domain` (plain text, one line).
**Verify the edit before reporting success.** Re-read the registration file at the exact path you derived and confirm that `not-setup` is gone and the resolved MCP domain is present. Do not tell the user anything was initialized until this re-read confirms it. If `not-setup` is still there, the edit landed somewhere else — re-derive the path using the rule in `mcp-settings.md` and apply the change again rather than reporting success.
3. **Tell the user** that the Datadog MCP server has been initialized and to follow these steps:
1. Run the command `/reload-plugins`
2. Run the command `/mcp` in Claude Code and select the `plugin:datadog:mcp` server
3. Select the authentication option
## skills/ddtoolsets/SKILL.md
---
name: ddtoolsets
description: Manages toolsets for the plugin's Datadog MCP server. Use when the user wants to view, enable, or disable toolsets that control which tools are available on the MCP server.
---
## Datadog MCP Server
The id of the Datadog MCP Server referenced on this document is `plugin:datadog:mcp`. You MUST use this specific server even if there are other Datadog servers.
## Shared reference
**This is a hard gate, not a suggestion.** You MUST actually read [references/mcp-settings.md](references/mcp-settings.md) before proceeding and writing any user-facing text, asking any question, or performing any file edit suggested by this skill — even if you believe you already know its contents from a prior turn or a prior session. Do not answer from memory of Datadog site codes, domains, or file paths; the tables and path rules in that file are the only authoritative source, and they can differ from your general knowledge or from what you've seen in other contexts.
The `references/mcp-settings.md` file contains the `datadog-server-state` check, registration file location, and editing rules used by the flows below.
## Entry flow
Check the `datadog-server-state` (see `mcp-settings.md`). Use the `datadog://mcp/toolsets` resource on the plugin's Datadog MCP server as the MCP call (do NOT use any other Datadog MCP server). Do not output anything until the `datadog-server-state` and resource content are available, and proceed based on the results:
- **datadog-server-state=working** AND **valid content** — without any preamble, go to the [Toolsets Flow](#toolsets-flow).
- **datadog-server-state=not-setup** — without any preamble, tell the user the plugin is not set up and instruct them to run `/ddsetup`, and stop.
- **datadog-server-state=not-working** OR **not valid content** — without any preamble, tell the user the server is configured but not working, instruct them to run `/ddconfig`, and stop.
When communicating with the user below, describe the server state and actions in plain language. Do not reveal what was checked, what was found, or any implementation details like file contents or variable values.
## Toolsets Flow
A toolset is a named group of related tools for a specific Datadog feature. Enabling a toolset makes its tools available; disabling it removes them.
### Toolset aliases
A toolset alias is a name that stands in for a fixed set of toolsets (its `expandsTo` list) — e.g. a toolset alias might expand to `logs,metrics,traces`. Toolset aliases come from the same `datadog://mcp/toolsets` resource as individual toolsets, each carrying its own `expandsTo` set of toolset names.
The server accepts a toolset alias name anywhere it accepts a toolset name — enabling a toolset alias enables every toolset in its `expandsTo` set, exactly as if they had been listed individually. This works in both directions:
- **Expand** — the user names a toolset alias to enable/disable/replace with; treat it as shorthand for every toolset in its `expandsTo` set.
- **Collapse** — if the resulting explicit list happens to contain every toolset in a toolset alias's `expandsTo` set, write the toolset alias name in place of those toolsets instead of listing them individually.
Toolset aliases are a convenience, not a separate capability — a toolset alias never grants a tool that isn't already covered by the toolsets it expands to.
### How toolset defaults work
The `DD_MCP_TOOLSETS` default value in the registration file controls which toolsets are active. It has two states:
- **Empty** (`${DD_MCP_TOOLSETS:-}`) — the server decides which toolsets to enable. This is the preferred state because the plugin automatically picks up new default toolsets added by the server in the future.
- **Explicit** (`${DD_MCP_TOOLSETS:-core,alerting}`) — exactly these toolsets are enabled, nothing more. The server's defaults are ignored. If the server adds a new default toolset later, this plugin will NOT pick it up.
The order of toolsets in the comma-separated list is not meaningful. `core,alerting` and `alerting,core` are equivalent. When comparing lists (e.g. to check if the result matches the defaults), compare as sets, not strings.
When computing changes, always prefer empty over an explicit list that happens to match the current defaults. See the editing rule in `mcp-settings.md` for how to set an empty default value.
### 1. Gather toolset information
Use the content of the `datadog://mcp/toolsets` resource from the plugin's Datadog MCP server. This tells you which toolsets exist, which are currently enabled, which are defaults, what each one does, and which toolset aliases are available (each with its `expandsTo` set of toolset names). Present all toolsets **and** toolset aliases that are available to the user — **do not** summarize and **do** choose the best format for the client (selectable list, table, grouped summary, etc.). Make it easy for the user to identify which toolsets are currently enabled and which toolsets and toolset aliases are available to them.
A toolset alias shows as currently enabled when every toolset in its `expandsTo` set is currently enabled.
Also read the current `DD_MCP_TOOLSETS` default value from the registration file. If it is empty, the user is currently using server defaults. If it has an explicit list, those are the manually selected toolsets.
Any toolset name in the registration file that does not appear in the `datadog://mcp/toolsets` resource is unknown — ignore it when presenting to the user and silently drop it when writing the updated list.
### 2. Understand the user's intent
The user may want to:
- **Add** more toolsets to the currently enabled list
- **Remove** toolsets from the currently enabled list
- **Replace** the entire list with a specific set of toolsets
Understand the user's intent from their response. Ask for clarification if ambiguous.
The user may refer to a toolset by its individual name or by a toolset alias name. Treat a toolset alias reference as shorthand for every toolset in its `expandsTo` set.
**Important:** If the current default value is empty (server defaults) and the user wants to add a toolset, you need to know what the defaults ARE so you can build the full list. Use the default information from the `datadog://mcp/toolsets` resource.
### 3. Compute the new toolset list
Apply the user's changes to produce a new comma-separated value for `DD_MCP_TOOLSETS`:
- First, expand any toolset alias names found in the current toolset list (from the registration file) and any toolset alias the user named (to add, remove, or as part of a replacement list) into their `expandsTo` sets of toolset names, then apply the add/remove/replace against that expanded set.
- If the resulting list matches the default toolsets exactly → use an empty string (revert to server defaults).
- If the user wants to revert to defaults (e.g. "reset", "use defaults") → use an empty string.
- If the resulting list contains every item in a toolset alias's `expandsTo` set → replace those items with the toolset alias name. If more than one toolset alias is fully covered, prefer the toolset alias that covers the most toolsets first, then repeat for whatever toolsets remain.
- If all toolsets would be removed → use an empty string and warn the user that the server's default toolsets will be used instead.
- If the resulting explicit list does not include `core` → warn the user before applying. The `core` toolset provides essential Datadog functionality and most workflows depend on it. Only proceed without `core` if the user explicitly confirms.
- Otherwise → use the explicit comma-separated list.
### 4. Apply the change
Edit `DD_MCP_TOOLSETS` in the registration file following the editing rule in `mcp-settings.md`.
Example — adding `alerting` when currently using server defaults (assuming `core` and `synthetics` are defaults):
```
${DD_MCP_TOOLSETS:-} → ${DD_MCP_TOOLSETS:-core,synthetics,alerting}
```
Example — reverting to server defaults:
```
${DD_MCP_TOOLSETS:-core,alerting} → ${DD_MCP_TOOLSETS:-}
```
Before writing, tell the user in plain language that their toolset selection is being saved locally so it can be re-applied automatically if the plugin is later updated or reinstalled (do not reveal the file path or variable names). Then write the new toolset value to `${CLAUDE_PLUGIN_DATA}/toolsets` (plain text, one line — write an empty file if reverting to server defaults).
### 5. Confirm
Tell the user the toolsets have been updated including which toolsets are now enabled, and that they need to follow these steps:
1. Run the command `/reload-plugins`
2. Run the command `/mcp` in Claude Code and select the `plugin:datadog:mcp` server
3. Select the authentication option
## skills/ddviz/SKILL.md
---
name: ddviz
description: Enables, disables, checks whether it's on, or diagnoses why the ddviz visualization panel isn't showing. macOS only. Use for anything involving turning ddviz on or off, or "ddviz isn't working"/"why is there no chart panel" style questions.
---
## What this controls
ddviz renders Datadog charts in a floating macOS panel, backed by a background daemon. The forwarding hook reads an opt-out marker file at `$DDVIZ_DATA_DIR` (defaults to `$HOME/.ddviz`).
### The explainer sentence
When — and only when — you run the status procedure below, open your reply with exactly this sentence, verbatim and on its own line:
> ddviz shows Datadog charts in a floating panel next to your terminal (macOS only), backed by a background process that starts on demand.
Do not paraphrase it, expand it, or add a second sentence of your own about what ddviz is or what you are about to do. The wording is fixed so every status reply opens identically.
It does **not** belong anywhere else:
- **Enable and disable replies never include it.** Someone who just asked to turn ddviz on or off already knows what it is; explaining the feature back to them is noise. Those replies are only the confirmation described under that intent.
- **The non-macOS case never includes it.** There the one-line reply from the status procedure replaces this sentence rather than following it. Never print both — a machine that can't run ddviz doesn't need a description of the panel it will never see.
## Determine the user's intent
Enable and disable are confirmations, not reports: reply with the confirmation alone — no explainer sentence, no status output, no live check.
- **Enable** ("enable", "turn ddviz on", "/ddviz on"): run `bash "${CLAUDE_PLUGIN_ROOT}/skills/ddviz/scripts/enable.sh"`.
Confirm that ddviz is enabled again. A chart-producing tool call is needed to bring the panel back up, since disabling shuts the daemon down.
- **Disable** ("disable", "turn ddviz off", "/ddviz off"): run `bash "${CLAUDE_PLUGIN_ROOT}/skills/ddviz/scripts/disable.sh"`.
Confirm that ddviz is now disabled on this machine, the panel closed if one was open, and future chart calls fall back to the sandbox-URL link.
- **Everything else** ("is ddviz on?", "check ddviz", "ddviz isn't working", "why is there no chart panel?", or a bare `/ddviz` with no stated intent): run the status procedure below.
## Status procedure
1. Run `bash "${CLAUDE_PLUGIN_ROOT}/skills/ddviz/scripts/status.sh" "${CLAUDE_PLUGIN_ROOT}"`. Its first line is the plain enabled/disabled state (with a re-enable hint already included when disabled — being disabled is a deliberate, valid user choice, not something to treat as a problem); the rest is a set of local checks (platform, Swift toolchain, the plugin's own install path, and daemon liveness). It never touches anything on screen. Pass `${CLAUDE_PLUGIN_ROOT}` a second time exactly as shown — Claude Code resolves the placeholder in this instruction before you see it, but does not export it as an environment variable to your Bash tool call, so the script needs it as an explicit argument.
2. **If its entire output is `ddviz is only supported on macOS`, stop there.** Reply with just that one sentence and nothing else — no opening sentence, no code block, no live check, no suggestions, no offer to help further. Nothing else in this procedure applies: the machine can't run ddviz, so there is nothing to diagnose or fix.
3. Do the live check below — it is the reliable source for whether the visualization tools are actually reachable; the script itself does not check MCP setup or toolsets.
4. Present **one** result, following the rules at the end of this section. Apart from the fixed opening sentence, say nothing before it: no progress narration, no announcement of what you are about to run ("I'll run the status script and check tool availability." is exactly the preamble to omit), and no interim commentary on what you found. The script's own first line already answers "is ddviz on?", so that verdict reaches the user as soon as the output does.
5. Never name the script, its filename, or the word "doctor" anywhere in your reply — which script ran is an implementation detail. If you have to refer to it at all, call it the status check.
### Live check (internal — never shown to the user)
This check is diagnostic plumbing. Run it silently and report only its conclusion, in the wording given under Presentation.
The tool names below are internal identifiers. They — along with the toolset resource URI and the hook matcher — must never appear in any text the user sees, and that includes the running commentary you emit _while_ checking ("Both `get_widget` and `visualize_tabular_data` are present…" is exactly the leak to avoid). Users think in terms of "Datadog charts work / don't work". Do this check without announcing it, then produce the single result.
On the plugin's Datadog MCP server (`plugin:datadog:mcp` — use this specific server even if others are present):
1. **Are the visualization tools actually there?** Look at the currently available tool names on that server for `get_widget` and `visualize_tabular_data`. This is the ground truth: the forwarding hook only fires for exactly these two tool names, so if they are absent from the session, no hook can ever run and no panel can ever appear.
2. **Why are they missing?** Only when step 1 finds neither tool, read the `datadog://mcp/toolsets` resource from that server and look at the `visualizations` entry's enabled state:
- the resource read succeeds and `visualizations` is disabled → a toolset problem.
- the resource read succeeds and `visualizations` is enabled but the tools are still absent → the server itself is misbehaving.
- the resource read fails or returns nothing → the server is not responding at all.
### Routing
- The server is not responding (live check's third outcome above) → tell the user to run `/ddconfig`. It determines on its own whether the server was never set up or is configured but broken, and guides accordingly — ddviz does not need to make that distinction itself.
- `visualizations` confirmed disabled → tell the user to run `/ddtoolsets`.
- Opt-out marker present → offer to run `/ddviz enable`.
### Presentation
1. Open with the script's full output verbatim, exactly as printed (e.g. in a code block) — every line, not a filtered or summarized subset, and nothing above it but the fixed opening sentence. Its first line is already the plain enabled/disabled verdict, so do **not** restate that verdict separately: printing `ddviz: enabled` above a block that starts with `ddviz: enabled` reads as a bug. The `plugin-root` line's path is useful for spotting a dual or stale plugin installation, so don't trim it either.
2. Add the live check's conclusion underneath, in plain product terms and at most one line — say that Datadog visualizations are reachable (or that they are not, and route per the rules above). Never name the MCP tools, the toolset resource, or the hook matcher: those are internal implementation details. On the healthy path, "Datadog visualizations are available." is enough.
3. If anything is blocking (from either the script or the live check), name the fix. When everything passes, say so plainly, and note that the panel simply hasn't been triggered yet if the `daemon` line reports not running — it starts on the first chart-producing tool call.
## skills/visualizations/SKILL.md
---
name: visualizations
description: Use ONLY when the user explicitly asks to see, show, graph, visualize, chart, or plot data, or when another loaded Datadog data-domain skill directs you to visualization guidance. This is the plugin's local copy of the `datadog/visualizations` server skill; prefer it over fetching the server version.
---
# Visualization Guide
Use this guide when the user asks to see, show, graph, visualize, or chart data.
## When the Visualization Tools Are Unavailable
Check this first. The tools below come from the Datadog MCP server's `visualizations` toolset, which is not enabled by default on every client. If neither `get_widget` nor `visualize_tabular_data` is available, do not call them and do not guess other tool names:
- If other Datadog MCP tools are available, the `visualizations` toolset is disabled. Tell the user that Datadog charts are not enabled and suggest running `/ddtoolsets` to enable visualizations.
- If no Datadog MCP tools are available, the server is not set up or not working. Suggest running `/ddsetup`.
Then answer with the data you can retrieve, as text or a table. In this case only, the visualization rules below do not apply.
## Tool Selection
| User intent | Tool | When to use |
| ------------------------------ | ------------------------ | ------------------------------------------------------------------------------------------------------- |
| Show a chart of Datadog data | `get_widget` | Timeseries, toplists, query tables, query values, heatmaps, distributions — any standard Datadog widget |
| Render tabular data as a chart | `visualize_tabular_data` | When you have rows/columns that aren't directly queryable via a Datadog widget definition |
**Key rule**: If the user says "show me", "graph", "visualize", "chart", or "plot" — always use `get_widget` or `visualize_tabular_data`. Do NOT only return a markdown table or text summary for these requests.
## Chart Type Selection
| Data shape | Recommended chart type |
| ------------------------------------------------- | --------------------------------------------------------------------------------- |
| Metric over time | `timeseries` via get_widget |
| Grouped data / proportional breakdown / pie chart | `sunburst` via visualize_tabular_data |
| Ranked list / bar chart (top N by value) | `toplist` via get_widget or visualize_tabular_data |
| Nested / hierarchical breakdown | `treemap` via visualize_tabular_data |
| Single number / KPI | `query_value` via get_widget (supports background timeseries and delta indicator) |
| Change over time across groups | `change` via get_widget |
| Distribution of values | `distribution` via get_widget |
## Common Patterns
**Metrics visualization**: Call `get_widget` with a widget_definition containing the metric query:
```json
{
"type": "timeseries",
"requests": [
{
"response_format": "timeseries",
"queries": [{ "name": "query1", "data_source": "metrics", "query": "avg:system.cpu.user{*}" }]
}
]
}
```
**Log/span analytics as chart**: Build the query directly in a `get_widget` call (`data_source: "logs"`, `"spans"`, etc.) — this keeps the widget exportable to Datadog. Use `visualize_tabular_data` only as a last resort when the query isn't representable