datadog-mcp 5.3.4 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +20 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -303920,6 +303920,22 @@ function formatMonitor(m, site = "datadoghq.com") {
|
|
|
303920
303920
|
url: buildMonitorUrl(monitorId, site)
|
|
303921
303921
|
};
|
|
303922
303922
|
}
|
|
303923
|
+
function formatMonitorDetail(m, site = "datadoghq.com") {
|
|
303924
|
+
const detail = { ...formatMonitor(m, site) };
|
|
303925
|
+
if (m.options != null) {
|
|
303926
|
+
detail.options = m.options;
|
|
303927
|
+
}
|
|
303928
|
+
if (m.multi != null) {
|
|
303929
|
+
detail.multi = m.multi;
|
|
303930
|
+
}
|
|
303931
|
+
if (m.priority != null) {
|
|
303932
|
+
detail.priority = m.priority;
|
|
303933
|
+
}
|
|
303934
|
+
if (m.restrictedRoles != null) {
|
|
303935
|
+
detail.restrictedRoles = m.restrictedRoles;
|
|
303936
|
+
}
|
|
303937
|
+
return detail;
|
|
303938
|
+
}
|
|
303923
303939
|
async function listMonitors(api, params, limits, site) {
|
|
303924
303940
|
const effectiveLimit = params.limit ?? limits.defaultLimit;
|
|
303925
303941
|
const response = await api.listMonitors({
|
|
@@ -303951,7 +303967,7 @@ async function getMonitor(api, id, site) {
|
|
|
303951
303967
|
}
|
|
303952
303968
|
const monitor = await api.getMonitor({ monitorId });
|
|
303953
303969
|
return {
|
|
303954
|
-
monitor:
|
|
303970
|
+
monitor: formatMonitorDetail(monitor, site),
|
|
303955
303971
|
datadog_url: buildMonitorUrl(monitorId, site)
|
|
303956
303972
|
};
|
|
303957
303973
|
}
|
|
@@ -304031,7 +304047,7 @@ async function createMonitor(api, config2, site = "datadoghq.com") {
|
|
|
304031
304047
|
const monitor = await api.createMonitor({ body });
|
|
304032
304048
|
return {
|
|
304033
304049
|
success: true,
|
|
304034
|
-
monitor:
|
|
304050
|
+
monitor: formatMonitorDetail(monitor, site)
|
|
304035
304051
|
};
|
|
304036
304052
|
}
|
|
304037
304053
|
async function updateMonitor(api, id, config2, site = "datadoghq.com") {
|
|
@@ -304040,7 +304056,7 @@ async function updateMonitor(api, id, config2, site = "datadoghq.com") {
|
|
|
304040
304056
|
const monitor = await api.updateMonitor({ monitorId, body });
|
|
304041
304057
|
return {
|
|
304042
304058
|
success: true,
|
|
304043
|
-
monitor:
|
|
304059
|
+
monitor: formatMonitorDetail(monitor, site)
|
|
304044
304060
|
};
|
|
304045
304061
|
}
|
|
304046
304062
|
async function deleteMonitor(api, id) {
|
|
@@ -304196,6 +304212,7 @@ function registerMonitorsTool(server, api, eventsApi, limits, readOnly = false,
|
|
|
304196
304212
|
"monitors",
|
|
304197
304213
|
`Manage Datadog monitors. Actions: list, get, search, create, update, delete, mute, unmute, top.
|
|
304198
304214
|
Filters: name, tags, groupStates (alert/warn/ok/no data).
|
|
304215
|
+
get/create/update return the full options object (notify_no_data, renotify_interval, thresholds, etc.) so callers can safely read-then-patch.
|
|
304199
304216
|
|
|
304200
304217
|
top: Ranked monitors by alert frequency with real monitor names and context breakdown.
|
|
304201
304218
|
- Returns: {rank, monitor_id, name (with {{template.vars}}), message (template), total_count, by_context}
|