Datadog
- MCP servers: use Datadog tools from ChatGPT, Claude and other MCP clients.
- Tasks: call Datadog from Python in an automation.
About Datadog
Datadog combines infrastructure monitoring, logs, application traces and incident investigation. Connect an API key and scoped application key from the same Datadog site. Both keys are encrypted and selected explicitly for each Task. Available data depends on the account plan, retention and permissions. Use Python Tasks to investigate monitors, dashboards, logs, metrics, events, incidents, hosts, notebooks, spans and software catalog entities. This connector reads data through native REST APIs. Provider writes and hosted MCP access are not included.
Build a Datadog MCP server with qbash
Connect Datadog to qbash, pick tools such as validate credentials, list monitors and get monitor, and publish them on a hosted MCP server.
MCP clients such as ChatGPT, Claude, Claude Code, Codex, Cursor, Grok and Muse Code all connect to the same remote endpoint.
Build Tasks with Datadog
A qbash Task is a Python script that calls Datadog alongside model calls and other connectors. qbash deploys each Task to a managed runtime with version history, run logs and credentials shared across your organization.
Run it on a schedule, call it through an API or webhook, or start it from an MCP client.
Datadog Task SDK methods (20)
Call these from Python with qbash.integrations.datadog.
qbash.integrations.datadog.validate_credentials(...)
Validate the selected API key and application key for this site.
validate_credentials()
Returns
{"api_key_valid": bool, "application_key_valid": bool}Notes
Requires a valid API key and application key and a key pair from the selected site. Calls both documented validation endpoints and returns only boolean validation results. No automatic retries.
qbash.integrations.datadog.list_monitors(...)
List one page of monitors.
list_monitors(name: str | None = None, tags: str | None = None, monitor_tags: str | None = None, group_states: str | None = None, with_downtimes: bool | None = None, limit: int | None = None, cursor: str | None = None)
Parameters
name: str | None = NoneOptional Datadog filter.
tags: str | None = NoneOptional Datadog filter.
monitor_tags: str | None = NoneOptional Datadog filter.
group_states: str | None = NoneOptional Datadog filter.
with_downtimes: bool | None = Nonewith downtimes.
limit: int | None = NonePage size from 1 to 1000 (incidents: at most 100). Defaults to 50.
cursor: str | None = Nonenext_cursor from the previous call. Keep the site, filters, time range and limit unchanged.
Returns
{"items": list[dict], "next_cursor": str | None, "meta": dict}Notes
Requires monitors_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.
qbash.integrations.datadog.get_monitor(...)
Read a monitor definition and its current state.
get_monitor(monitor_id: str, group_states: str | None = None, with_downtimes: bool | None = None, with_assets: bool | None = None)
Parameters
monitor_id: strrequiredDatadog monitor id from the matching list operation.
group_states: str | None = NoneOptional Datadog filter.
with_downtimes: bool | None = Nonewith downtimes.
with_assets: bool | None = Nonewith assets.
Returns
dictNotes
Requires monitors_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries.
qbash.integrations.datadog.search_monitors(...)
Search monitors by status, type, tags or name.
search_monitors(query: str | None = None, sort: str | None = None, limit: int | None = None, cursor: str | None = None)
Parameters
query: str | None = NoneOptional Datadog filter.
sort: str | None = NoneSort field and direction, such as name,asc.
limit: int | None = NonePage size from 1 to 1000 (incidents: at most 100). Defaults to 50.
cursor: str | None = Nonenext_cursor from the previous call. Keep the site, filters, time range and limit unchanged.
Returns
{"items": list[dict], "next_cursor": str | None, "meta": dict}Notes
Requires monitors_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.
qbash.integrations.datadog.list_dashboards(...)
List custom-created or cloned dashboards, excluding preset dashboards.
list_dashboards(limit: int | None = None, cursor: str | None = None)
Parameters
limit: int | None = NonePage size from 1 to 1000 (incidents: at most 100). Defaults to 50.
cursor: str | None = Nonenext_cursor from the previous call. Keep the site, filters, time range and limit unchanged.
Returns
{"items": list[dict], "next_cursor": str | None, "meta": dict}Notes
Requires dashboards_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.
qbash.integrations.datadog.get_dashboard(...)
Read a dashboard definition and widgets.
get_dashboard(dashboard_id: str)
Parameters
dashboard_id: strrequiredDatadog dashboard id from the matching list operation.
Returns
dictNotes
Requires dashboards_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries.
qbash.integrations.datadog.search_logs(...)
Search one page of logs and retain provider warnings about partial results.
search_logs(query: str | None = None, from_: str | None = None, to: str | None = None, sort: str | None = None, indexes: list[str] | None = None, storage_tier: str | None = None, limit: int | None = None, cursor: str | None = None)
Parameters
query: str | None = NoneDatadog logs search syntax. Defaults to * at the provider.
from_: str | None = NoneStart time: ISO 8601, Unix milliseconds or date math such as now-15m.
to: str | None = NoneEnd time, such as now.
sort: str | None = Nonetimestamp or -timestamp.
indexes: list[str] | None = NoneIndexes to search. Omit for all indexes.
storage_tier: str | None = Noneindexes, online-archives or flex. Check the plan before querying another tier.
limit: int | None = NonePage size from 1 to 1000 (incidents: at most 100). Defaults to 50.
cursor: str | None = Nonenext_cursor from the previous call. Keep the site, filters, time range and limit unchanged.
Returns
{"items": list[dict], "next_cursor": str | None, "meta": dict}Notes
Requires logs_read_data and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.
qbash.integrations.datadog.aggregate_logs(...)
Compute log counts, statistics or grouped timeseries.
aggregate_logs(query: str | None = None, from_: str | None = None, to: str | None = None, indexes: list[str] | None = None, storage_tier: str | None = None, compute: list[dict], group_by: list[dict] | None = None, cursor: str | None = None)
Parameters
query: str | None = NoneDatadog logs search syntax. Defaults to * at the provider.
from_: str | None = NoneStart time: ISO 8601, Unix milliseconds or date math such as now-15m.
to: str | None = NoneEnd time, such as now.
indexes: list[str] | None = NoneIndexes to search. Omit for all indexes.
storage_tier: str | None = Noneindexes, online-archives or flex. Check the plan before querying another tier.
compute: list[dict]requiredAggregations to compute. Each entry requires aggregation.
aggregation: strrequiredcount, cardinality, pc75, pc90, pc95, pc98, pc99, sum, min, max, avg or median.
metric: str | None = NoneMeasure name, required by aggregations other than count.
type: str | None = Nonetotal or timeseries.
interval: str | None = NoneTimeseries interval, such as 5m.
group_by: list[dict] | None = NoneOptional facet grouping. Each entry requires facet. Combined bucket limits must not exceed 10000.
facet: strrequiredFacet to group by.
limit: int | None = NoneMaximum buckets for this facet.
sort: dict | None = NoneProvider grouping sort object.
aggregation: str | None = NoneOptional Datadog filter.
metric: str | None = NoneOptional Datadog filter.
order: str | None = Noneasc or desc.
type: str | None = Nonealphabetical or measure.
cursor: str | None = Nonenext_cursor from the previous aggregation. Keep the query and computes unchanged. Logs aggregation can page at most 1000 results.
Returns
{"data": dict | list[dict], "meta": dict | None, "next_cursor": str | None}Notes
Requires logs_read_data and a key pair from the selected site. Returns the provider aggregation object. next_cursor is copied from meta.page.after. Logs buckets are in data.buckets. Span buckets are in data[]. Retains provider meta, including timeout status and partial-result warnings. A successful response does not guarantee complete results. No automatic retries.
qbash.integrations.datadog.list_metrics(...)
List active metric names since a Unix timestamp in seconds.
list_metrics(from_: int, host: str | None = None, tag_filter: str | None = None)
Parameters
from_: intrequiredEarliest metric submission time, in Unix seconds.
host: str | None = NoneOptional Datadog filter.
tag_filter: str | None = NoneTag filter. Cannot be combined with host.
Returns
{"items": list[dict], "next_cursor": str | None, "meta": dict}Notes
Requires metrics_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.
qbash.integrations.datadog.query_metrics(...)
Query metric timeseries over a time range in Unix seconds.
query_metrics(from_: int, to: int, query: str)
Parameters
from_: intrequiredStart time in Unix seconds.
to: intrequiredEnd time in Unix seconds.
query: strrequiredDatadog metric query, such as avg:system.cpu.user{*}.
Returns
dictNotes
Requires timeseries_query and a key pair from the selected site. Provider query object, including series and pointlist. Point timestamps use milliseconds and may have null values. Datadog can choose the rollup interval. Inspect status and series before interpreting empty results. No automatic retries.
qbash.integrations.datadog.list_events(...)
Search one page of events using the v2 Events API.
list_events(query: str | None = None, from_: str | None = None, to: str | None = None, sort: str | None = None, limit: int | None = None, cursor: str | None = None)
Parameters
query: str | None = NoneDatadog events search query.
from_: str | None = NoneMinimum event timestamp in milliseconds.
to: str | None = NoneMaximum event timestamp in milliseconds.
sort: str | None = Nonetimestamp or -timestamp.
limit: int | None = NonePage size from 1 to 1000 (incidents: at most 100). Defaults to 50.
cursor: str | None = Nonenext_cursor from the previous call. Keep the site, filters, time range and limit unchanged.
Returns
{"items": list[dict], "next_cursor": str | None, "meta": dict}Notes
Requires events_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.
qbash.integrations.datadog.get_event(...)
Read one event using its v2 event UID.
get_event(event_id: str)
Parameters
event_id: strrequiredThe v2 UID at items[].attributes.attributes.evt.uid from list_events, not the top-level result id.
Returns
dictNotes
Requires events_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries.
qbash.integrations.datadog.list_incidents(...)
List one page of incidents.
list_incidents(limit: int | None = None, cursor: str | None = None)
Parameters
limit: int | None = NonePage size from 1 to 1000 (incidents: at most 100). Defaults to 50.
cursor: str | None = Nonenext_cursor from the previous call. Keep the site, filters, time range and limit unchanged.
Returns
{"items": list[dict], "next_cursor": str | None, "meta": dict}Notes
Requires incident_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.
qbash.integrations.datadog.get_incident(...)
Read an incident by UUID.
get_incident(incident_id: str)
Parameters
incident_id: strrequiredDatadog incident id from the matching list operation.
Returns
dictNotes
Requires incident_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries.
qbash.integrations.datadog.list_hosts(...)
List hosts matching a Datadog host filter.
list_hosts(filter: str | None = None, sort_field: str | None = None, sort_dir: str | None = None, from_: int | None = None, include_muted_hosts_data: bool | None = None, include_hosts_metadata: bool | None = None, limit: int | None = None, cursor: str | None = None)
Parameters
filter: str | None = NoneOptional Datadog filter.
sort_field: str | None = NoneOptional Datadog filter.
sort_dir: str | None = Noneasc or desc.
from_: int | None = NoneEarliest host activity, in Unix seconds.
include_muted_hosts_data: bool | None = Noneinclude muted hosts data.
include_hosts_metadata: bool | None = Noneinclude hosts metadata.
limit: int | None = NonePage size from 1 to 1000 (incidents: at most 100). Defaults to 50.
cursor: str | None = Nonenext_cursor from the previous call. Keep the site, filters, time range and limit unchanged.
Returns
{"items": list[dict], "next_cursor": str | None, "meta": dict}Notes
Requires hosts_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.
qbash.integrations.datadog.list_notebooks(...)
Find notebooks by name or author.
list_notebooks(query: str | None = None, author_handle: str | None = None, exclude_author_handle: str | None = None, sort_field: str | None = None, sort_dir: str | None = None, include_cells: bool | None = None, is_template: bool | None = None, limit: int | None = None, cursor: str | None = None)
Parameters
query: str | None = NoneOptional Datadog filter.
author_handle: str | None = NoneOptional Datadog filter.
exclude_author_handle: str | None = NoneOptional Datadog filter.
sort_field: str | None = Nonemodified, name or created.
sort_dir: str | None = Noneasc or desc.
include_cells: bool | None = Noneinclude cells.
is_template: bool | None = Noneis template.
limit: int | None = NonePage size from 1 to 1000 (incidents: at most 100). Defaults to 50.
cursor: str | None = Nonenext_cursor from the previous call. Keep the site, filters, time range and limit unchanged.
Returns
{"items": list[dict], "next_cursor": str | None, "meta": dict}Notes
Requires notebooks_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.
qbash.integrations.datadog.get_notebook(...)
Read a notebook and its cells.
get_notebook(notebook_id: str)
Parameters
notebook_id: strrequiredDatadog notebook id from the matching list operation.
Returns
dictNotes
Requires notebooks_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries.
qbash.integrations.datadog.search_spans(...)
Search retained APM spans and retain warnings about partial results.
search_spans(query: str | None = None, from_: str | None = None, to: str | None = None, sort: str | None = None, limit: int | None = None, cursor: str | None = None)
Parameters
query: str | None = NoneDatadog spans search syntax. Defaults to * at the provider.
from_: str | None = NoneStart time: ISO 8601, Unix milliseconds or date math such as now-15m.
to: str | None = NoneEnd time, such as now.
sort: str | None = Nonetimestamp or -timestamp.
limit: int | None = NonePage size from 1 to 1000 (incidents: at most 100). Defaults to 50.
cursor: str | None = Nonenext_cursor from the previous call. Keep the site, filters, time range and limit unchanged.
Returns
{"items": list[dict], "next_cursor": str | None, "meta": dict}Notes
Requires APM Read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.
qbash.integrations.datadog.aggregate_spans(...)
Compute counts, statistics or grouped timeseries over retained APM spans.
aggregate_spans(query: str | None = None, from_: str | None = None, to: str | None = None, compute: list[dict], group_by: list[dict] | None = None)
Parameters
query: str | None = NoneDatadog spans search syntax. Defaults to * at the provider.
from_: str | None = NoneStart time: ISO 8601, Unix milliseconds or date math such as now-15m.
to: str | None = NoneEnd time, such as now.
compute: list[dict]requiredAggregations to compute. Each entry requires aggregation.
aggregation: strrequiredcount, cardinality, pc75, pc90, pc95, pc98, pc99, sum, min, max, avg or median.
metric: str | None = NoneMeasure name, required by aggregations other than count.
type: str | None = Nonetotal or timeseries.
interval: str | None = NoneTimeseries interval, such as 5m.
group_by: list[dict] | None = NoneOptional facet grouping. Each entry requires facet. Combined bucket limits must not exceed 10000.
facet: strrequiredFacet to group by.
limit: int | None = NoneMaximum buckets for this facet.
sort: dict | None = NoneProvider grouping sort object.
aggregation: str | None = NoneOptional Datadog filter.
metric: str | None = NoneOptional Datadog filter.
order: str | None = Noneasc or desc.
type: str | None = Nonealphabetical or measure.
Returns
{"data": dict | list[dict], "meta": dict | None, "next_cursor": str | None}Notes
Requires apm_read and a key pair from the selected site. Returns the provider aggregation object. Span aggregation has no pagination. next_cursor is always None. Logs buckets are in data.buckets. Span buckets are in data[]. Retains provider meta, including timeout status and partial-result warnings. A successful response does not guarantee complete results. No automatic retries.
qbash.integrations.datadog.list_entities(...)
Find software catalog entities by name, kind, owner or reference.
list_entities(name: str | None = None, kind: str | None = None, owner: str | None = None, ref: str | None = None, include_discovered: bool | None = None, limit: int | None = None, cursor: str | None = None)
Parameters
name: str | None = NoneOptional Datadog filter.
kind: str | None = NoneOptional Datadog filter.
owner: str | None = NoneOptional Datadog filter.
ref: str | None = NoneOptional Datadog filter.
include_discovered: bool | None = Noneinclude discovered.
limit: int | None = NonePage size from 1 to 1000 (incidents: at most 100). Defaults to 50.
cursor: str | None = Nonenext_cursor from the previous call. Keep the site, filters, time range and limit unchanged.
Returns
{"items": list[dict], "next_cursor": str | None, "meta": dict}Notes
Requires Software Catalog Read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.
Related connectors
Connect Datadog to qbash
Sign up, connect your Datadog account, and use its tools across qbash.
Sign up free