dd-mcp-server 1.0.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.
@@ -0,0 +1,8 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(npm install)",
5
+ "Bash(npm run build:*)"
6
+ ]
7
+ }
8
+ }
package/.env.example ADDED
@@ -0,0 +1,9 @@
1
+ # Datadog API credentials
2
+ DD_API_KEY=your-datadog-api-key
3
+ DD_APP_KEY=your-datadog-application-key
4
+
5
+ # Datadog site (optional, defaults to datadoghq.com)
6
+ # For EU: datadoghq.eu
7
+ # For US3: us3.datadoghq.com
8
+ # For US5: us5.datadoghq.com
9
+ DD_SITE=datadoghq.com
@@ -0,0 +1,19 @@
1
+ export interface DatadogConfig {
2
+ apiKey: string;
3
+ appKey: string;
4
+ site: string;
5
+ }
6
+ export declare class DatadogClient {
7
+ private config;
8
+ private baseUrl;
9
+ constructor(config: DatadogConfig);
10
+ private getHeaders;
11
+ request<T>(method: string, path: string, body?: unknown): Promise<T>;
12
+ get<T>(path: string): Promise<T>;
13
+ post<T>(path: string, body: unknown): Promise<T>;
14
+ put<T>(path: string, body: unknown): Promise<T>;
15
+ delete<T>(path: string): Promise<T>;
16
+ }
17
+ export declare function initializeClient(): DatadogClient;
18
+ export declare function getClient(): DatadogClient;
19
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/datadog/client.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,OAAO,CAAS;gBAEZ,MAAM,EAAE,aAAa;IAKjC,OAAO,CAAC,UAAU;IAQZ,OAAO,CAAC,CAAC,EACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,GACb,OAAO,CAAC,CAAC,CAAC;IAqBP,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAI/C,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAG1C;AAID,wBAAgB,gBAAgB,IAAI,aAAa,CAahD;AAED,wBAAgB,SAAS,IAAI,aAAa,CAKzC"}
@@ -0,0 +1,61 @@
1
+ export class DatadogClient {
2
+ config;
3
+ baseUrl;
4
+ constructor(config) {
5
+ this.config = config;
6
+ this.baseUrl = `https://api.${config.site}`;
7
+ }
8
+ getHeaders() {
9
+ return {
10
+ "Content-Type": "application/json",
11
+ "DD-API-KEY": this.config.apiKey,
12
+ "DD-APPLICATION-KEY": this.config.appKey,
13
+ };
14
+ }
15
+ async request(method, path, body) {
16
+ const url = `${this.baseUrl}${path}`;
17
+ const options = {
18
+ method,
19
+ headers: this.getHeaders(),
20
+ };
21
+ if (body) {
22
+ options.body = JSON.stringify(body);
23
+ }
24
+ const response = await fetch(url, options);
25
+ if (!response.ok) {
26
+ const errorText = await response.text();
27
+ throw new Error(`Datadog API error: ${response.status} - ${errorText}`);
28
+ }
29
+ return response.json();
30
+ }
31
+ async get(path) {
32
+ return this.request("GET", path);
33
+ }
34
+ async post(path, body) {
35
+ return this.request("POST", path, body);
36
+ }
37
+ async put(path, body) {
38
+ return this.request("PUT", path, body);
39
+ }
40
+ async delete(path) {
41
+ return this.request("DELETE", path);
42
+ }
43
+ }
44
+ let clientInstance = null;
45
+ export function initializeClient() {
46
+ const apiKey = process.env.DD_API_KEY;
47
+ const appKey = process.env.DD_APP_KEY;
48
+ const site = process.env.DD_SITE || "datadoghq.com";
49
+ if (!apiKey || !appKey) {
50
+ throw new Error("DD_API_KEY and DD_APP_KEY environment variables are required");
51
+ }
52
+ clientInstance = new DatadogClient({ apiKey, appKey, site });
53
+ return clientInstance;
54
+ }
55
+ export function getClient() {
56
+ if (!clientInstance) {
57
+ throw new Error("Datadog client not initialized. Call initializeClient() first.");
58
+ }
59
+ return clientInstance;
60
+ }
61
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/datadog/client.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,aAAa;IAChB,MAAM,CAAgB;IACtB,OAAO,CAAS;IAExB,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,eAAe,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9C,CAAC;IAEO,UAAU;QAChB,OAAO;YACL,cAAc,EAAE,kBAAkB;YAClC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAChC,oBAAoB,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;SACzC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CACX,MAAc,EACd,IAAY,EACZ,IAAc;QAEd,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC;QACrC,MAAM,OAAO,GAAgB;YAC3B,MAAM;YACN,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE;SAC3B,CAAC;QAEF,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACtC,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,OAAO,C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AI,EAAE,CAAC,CAAC;IAC7D,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,74 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { initializeClient } from "./datadog/client.js";
5
+ import { searchLogs, searchLogsSchema, getLog, getLogSchema, } from "./tools/logs.js";
6
+ import { listMonitors, listMonitorsSchema, getMonitor, getMonitorSchema, createMonitor, createMonitorSchema, updateMonitor, updateMonitorSchema, deleteMonitor, deleteMonitorSchema, muteMonitor, muteMonitorSchema, unmuteMonitor, unmuteMonitorSchema, } from "./tools/monitors.js";
7
+ import { listDashboards, listDashboardsSchema, getDashboard, getDashboardSchema, } from "./tools/dashboards.js";
8
+ const server = new McpServer({
9
+ name: "datadog-mcp",
10
+ version: "1.0.0",
11
+ });
12
+ // Logs tools
13
+ server.tool("search_logs", "Search and retrieve logs from Datadog", searchLogsSchema.shape, async (input) => {
14
+ const result = await searchLogs(input);
15
+ return { content: [{ type: "text", text: result }] };
16
+ });
17
+ server.tool("get_log", "Get details of a specific log by ID", getLogSchema.shape, async (input) => {
18
+ const result = await getLog(input);
19
+ return { content: [{ type: "text", text: result }] };
20
+ });
21
+ // Monitor tools
22
+ server.tool("list_monitors", "List all monitors with optional filtering", listMonitorsSchema.shape, async (input) => {
23
+ const result = await listMonitors(input);
24
+ return { content: [{ type: "text", text: result }] };
25
+ });
26
+ server.tool("get_monitor", "Get details of a specific monitor by ID", getMonitorSchema.shape, async (input) => {
27
+ const result = await getMonitor(input);
28
+ return { content: [{ type: "text", text: result }] };
29
+ });
30
+ server.tool("create_monitor", "Create a new Datadog monitor", createMonitorSchema.shape, async (input) => {
31
+ const result = await createMonitor(input);
32
+ return { content: [{ type: "text", text: result }] };
33
+ });
34
+ server.tool("update_monitor", "Update an existing monitor", updateMonitorSchema.shape, async (input) => {
35
+ const result = await updateMonitor(input);
36
+ return { content: [{ type: "text", text: result }] };
37
+ });
38
+ server.tool("delete_monitor", "Delete a monitor by ID", deleteMonitorSchema.shape, async (input) => {
39
+ const result = await deleteMonitor(input);
40
+ return { content: [{ type: "text", text: result }] };
41
+ });
42
+ server.tool("mute_monitor", "Mute a monitor to suppress notifications", muteMonitorSchema.shape, async (input) => {
43
+ const result = await muteMonitor(input);
44
+ return { content: [{ type: "text", text: result }] };
45
+ });
46
+ server.tool("unmute_monitor", "Unmute a previously muted monitor", unmuteMonitorSchema.shape, async (input) => {
47
+ const result = await unmuteMonitor(input);
48
+ return { content: [{ type: "text", text: result }] };
49
+ });
50
+ // Dashboard tools
51
+ server.tool("list_dashboards", "List all dashboards", listDashboardsSchema.shape, async (input) => {
52
+ const result = await listDashboards(input);
53
+ return { content: [{ type: "text", text: result }] };
54
+ });
55
+ server.tool("get_dashboard", "Get details of a specific dashboard", getDashboardSchema.shape, async (input) => {
56
+ const result = await getDashboard(input);
57
+ return { content: [{ type: "text", text: result }] };
58
+ });
59
+ async function main() {
60
+ try {
61
+ initializeClient();
62
+ }
63
+ catch (error) {
64
+ console.error("Failed to initialize Datadog client:", error);
65
+ process.exit(1);
66
+ }
67
+ const transport = new StdioServerTransport();
68
+ await server.connect(transport);
69
+ }
70
+ main().catch((error) => {
71
+ console.error("Server error:", error);
72
+ process.exit(1);
73
+ });
74
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index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E,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AACvD,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,IAAI,CACT,eAAe,EACf,qCAAqC,EACrC,kBAAkB,CAAC,KAAK,EACxB,KAAK,EAAE,KAAK,EAAE,EAAE;IACd,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,KAAK,CAAC,CAAC;IACzC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AACvD,CAAC,CACF,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,gBAAgB,EAAE,CAAC;IACrB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { z } from "zod";
2
+ export declare const listDashboardsSchema: z.ZodObject<{
3
+ filterShared: z.ZodOptional<z.ZodBoolean>;
4
+ filterDeleted: z.ZodOptional<z.ZodBoolean>;
5
+ count: z.ZodOptional<z.ZodNumber>;
6
+ start: z.ZodOptional<z.ZodNumber>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ filterShared?: boolean | undefined;
9
+ filterDeleted?: boolean | undefined;
10
+ count?: number | undefined;
11
+ start?: number | undefined;
12
+ }, {
13
+ filterShared?: boolean | undefined;
14
+ filterDeleted?: boolean | undefined;
15
+ count?: number | undefined;
16
+ start?: number | undefined;
17
+ }>;
18
+ export type ListDashboardsInput = z.infer<typeof listDashboardsSchema>;
19
+ export declare function listDashboards(input: ListDashboardsInput): Promise<string>;
20
+ export declare const getDashboardSchema: z.ZodObject<{
21
+ dashboardId: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ dashboardId: string;
24
+ }, {
25
+ dashboardId: string;
26
+ }>;
27
+ export type GetDashboardInput = z.infer<typeof getDashboardSchema>;
28
+ export declare function getDashboard(input: GetDashboardInput): Promise<string>;
29
+ //# sourceMappingURL=dashboards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboards.d.ts","sourceRoot":"","sources":["../../src/tools/dashboards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuCxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAK/B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvE,wBAAsB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CA0BhF;AAED,eAAO,MAAM,kBAAkB;;;;;;EAE7B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEnE,wBAAsB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqB5E"}
@@ -0,0 +1,58 @@
1
+ import { z } from "zod";
2
+ import { getClient } from "../datadog/client.js";
3
+ export const listDashboardsSchema = z.object({
4
+ filterShared: z.boolean().optional().describe("Filter to only shared dashboards"),
5
+ filterDeleted: z.boolean().optional().describe("Include deleted dashboards"),
6
+ count: z.number().optional().describe("Number of dashboards to return (default: 100)"),
7
+ start: z.number().optional().describe("Starting point for pagination"),
8
+ });
9
+ export async function listDashboards(input) {
10
+ const client = getClient();
11
+ const params = new URLSearchParams();
12
+ if (input.filterShared !== undefined)
13
+ params.append("filter[shared]", String(input.filterShared));
14
+ if (input.filterDeleted !== undefined)
15
+ params.append("filter[deleted]", String(input.filterDeleted));
16
+ if (input.count)
17
+ params.append("count", String(input.count));
18
+ if (input.start)
19
+ params.append("start", String(input.start));
20
+ const queryString = params.toString();
21
+ const path = `/api/v1/dashboard${queryString ? `?${queryString}` : ""}`;
22
+ const response = await client.get(path);
23
+ const dashboards = response.dashboards.map((d) => ({
24
+ id: d.id,
25
+ title: d.title,
26
+ description: d.description,
27
+ layoutType: d.layout_type,
28
+ url: d.url,
29
+ createdAt: d.created_at,
30
+ modifiedAt: d.modified_at,
31
+ author: d.author_handle,
32
+ }));
33
+ return JSON.stringify({ dashboards, count: dashboards.length }, null, 2);
34
+ }
35
+ export const getDashboardSchema = z.object({
36
+ dashboardId: z.string().describe("The ID of the dashboard to retrieve"),
37
+ });
38
+ export async function getDashboard(input) {
39
+ const client = getClient();
40
+ const response = await client.get(`/api/v1/dashboard/${input.dashboardId}`);
41
+ return JSON.stringify({
42
+ id: response.id,
43
+ title: response.title,
44
+ description: response.description,
45
+ layoutType: response.layout_type,
46
+ widgets: response.widgets.map((w) => ({
47
+ id: w.id,
48
+ type: w.definition.type,
49
+ title: w.definition.title,
50
+ })),
51
+ templateVariables: response.template_variables,
52
+ url: response.url,
53
+ createdAt: response.created_at,
54
+ modifiedAt: response.modified_at,
55
+ author: response.author_handle,
56
+ }, null, 2);
57
+ }
58
+ //# sourceMappingURL=dashboards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboards.js","sourceRoot":"","sources":["../../src/tools/dashboards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAsCj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AAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACpC,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,IAAI,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI;YACvB,KAAK,EAAE,CAAC,CAAC,UAAU,CAAC,KAAK;SAC1B,CAAC,CAAC;QACH,iBAAiB,EAAE,QAAQ,CAAC,kBAAkB;QAC9C,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,SAAS,EAAE,QAAQ,CAAC,UAAU;QAC9B,UAAU,EAAE,QAAQ,CAAC,WAAW;QAChC,MAAM,EAAE,QAAQ,CAAC,aAAa;KAC/B,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACd,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ export declare const searchLogsSchema: z.ZodObject<{
3
+ query: z.ZodString;
4
+ from: z.ZodString;
5
+ to: z.ZodString;
6
+ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7
+ sort: z.ZodDefault<z.ZodOptional<z.ZodEnum<["timestamp", "-timestamp"]>>>;
8
+ index: z.ZodOptional<z.ZodString>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ query: string;
11
+ from: string;
12
+ to: string;
13
+ limit: number;
14
+ sort: "timestamp" | "-timestamp";
15
+ index?: string | undefined;
16
+ }, {
17
+ query: string;
18
+ from: string;
19
+ to: string;
20
+ limit?: number | undefined;
21
+ sort?: "timestamp" | "-timestamp" | undefined;
22
+ index?: string | undefined;
23
+ }>;
24
+ export type SearchLogsInput = z.infer<typeof searchLogsSchema>;
25
+ export declare function searchLogs(input: SearchLogsInput): Promise<string>;
26
+ export declare const getLogSchema: z.ZodObject<{
27
+ logId: z.ZodString;
28
+ }, "strip", z.ZodTypeAny, {
29
+ logId: string;
30
+ }, {
31
+ logId: string;
32
+ }>;
33
+ export type GetLogInput = z.infer<typeof getLogSchema>;
34
+ export declare function getLog(input: GetLogInput): Promise<string>;
35
+ //# sourceMappingURL=logs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/tools/logs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;EAO3B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAuB/D,wBAAsB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAgCxE;AAED,eAAO,MAAM,YAAY;;;;;;EAEvB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAkBvD,wBAAsB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBhE"}
@@ -0,0 +1,55 @@
1
+ import { z } from "zod";
2
+ import { getClient } from "../datadog/client.js";
3
+ export const searchLogsSchema = z.object({
4
+ query: z.string().describe("Datadog logs query string (e.g., 'service:my-app status:error')"),
5
+ from: z.string().describe("Start time in ISO 8601 format or relative time (e.g., 'now-1h')"),
6
+ to: z.string().describe("End time in ISO 8601 format or relative time (e.g., 'now')"),
7
+ limit: z.number().optional().default(50).describe("Maximum number of logs to return (default: 50, max: 1000)"),
8
+ sort: z.enum(["timestamp", "-timestamp"]).optional().default("-timestamp").describe("Sort order: 'timestamp' (oldest first) or '-timestamp' (newest first)"),
9
+ index: z.string().optional().describe("Log index to search (optional)"),
10
+ });
11
+ export async function searchLogs(input) {
12
+ const client = getClient();
13
+ const body = {
14
+ filter: {
15
+ query: input.query,
16
+ from: input.from,
17
+ to: input.to,
18
+ ...(input.index && { indexes: [input.index] }),
19
+ },
20
+ sort: input.sort,
21
+ page: {
22
+ limit: Math.min(input.limit, 1000),
23
+ },
24
+ };
25
+ const response = await client.post("/api/v2/logs/events/search", body);
26
+ const logs = response.data.map((log) => ({
27
+ id: log.id,
28
+ timestamp: log.attributes.timestamp,
29
+ message: log.attributes.message,
30
+ status: log.attributes.status,
31
+ service: log.attributes.service,
32
+ host: log.attributes.host,
33
+ tags: log.attributes.tags,
34
+ }));
35
+ return JSON.stringify({ logs, count: logs.length }, null, 2);
36
+ }
37
+ export const getLogSchema = z.object({
38
+ logId: z.string().describe("The unique ID of the log to retrieve"),
39
+ });
40
+ export async function getLog(input) {
41
+ const client = getClient();
42
+ const response = await client.get(`/api/v2/logs/events/${input.logId}`);
43
+ const log = response.data;
44
+ return JSON.stringify({
45
+ id: log.id,
46
+ timestamp: log.attributes.timestamp,
47
+ message: log.attributes.message,
48
+ status: log.attributes.status,
49
+ service: log.attributes.service,
50
+ host: log.attributes.host,
51
+ tags: log.attributes.tags,
52
+ attributes: log.attributes.attributes,
53
+ }, null, 2);
54
+ }
55
+ //# sourceMappingURL=logs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs.js","sourceRoot":"","sources":["../../src/tools/logs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iEAAiE,CAAC;IAC7F,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iEAAiE,CAAC;IAC5F,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;IACrF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,2DAA2D,CAAC;IAC9G,IAAI,EAAE,CAAC,C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"strip", z.ZodTypeAny, {
7
+ name?: string | undefined;
8
+ tags?: string | undefined;
9
+ monitorTags?: string | undefined;
10
+ }, {
11
+ name?: string | undefined;
12
+ tags?: string | undefined;
13
+ monitorTags?: string | undefined;
14
+ }>;
15
+ export type ListMonitorsInput = z.infer<typeof listMonitorsSchema>;
16
+ export declare function listMonitors(input: ListMonitorsInput): Promise<string>;
17
+ export declare const getMonitorSchema: z.ZodObject<{
18
+ monitorId: z.ZodNumber;
19
+ }, "strip", z.ZodTypeAny, {
20
+ monitorId: number;
21
+ }, {
22
+ monitorId: number;
23
+ }>;
24
+ export type GetMonitorInput = z.infer<typeof getMonitorSchema>;
25
+ export declare function getMonitor(input: GetMonitorInput): Promise<string>;
26
+ export declare const createMonitorSchema: z.ZodObject<{
27
+ name: z.ZodString;
28
+ type: z.ZodEnum<["metric alert", "service check", "event alert", "query alert", "composite", "log alert", "process alert", "rum alert", "trace-analytics alert", "slo alert", "event-v2 alert", "audit alert", "ci-pipelines alert", "ci-tests alert", "error-tracking alert"]>;
29
+ query: z.ZodString;
30
+ message: z.ZodString;
31
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
32
+ priority: z.ZodOptional<z.ZodNumber>;
33
+ options: z.ZodOptional<z.ZodObject<{
34
+ thresholds: z.ZodOptional<z.ZodObject<{
35
+ critical: z.ZodOptional<z.ZodNumber>;
36
+ warning: z.ZodOptional<z.ZodNumber>;
37
+ ok: z.ZodOptional<z.ZodNumber>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ critical?: number | undefined;
40
+ warning?: number | undefined;
41
+ ok?: number | undefined;
42
+ }, {
43
+ critical?: number | undefined;
44
+ warning?: number | undefined;
45
+ ok?: number | undefined;
46
+ }>>;
47
+ notifyNoData: z.ZodOptional<z.ZodBoolean>;
48
+ noDataTimeframe: z.ZodOptional<z.ZodNumber>;
49
+ renotifyInterval: z.ZodOptional<z.ZodNumber>;
50
+ }, "strip", z.ZodTypeAny, {
51
+ thresholds?: {
52
+ critical?: number | undefined;
53
+ warning?: number | undefined;
54
+ ok?: number | undefined;
55
+ } | undefined;
56
+ notifyNoData?: boolean | undefined;
57
+ noDataTimeframe?: number | undefined;
58
+ renotifyInterval?: number | undefined;
59
+ }, {
60
+ thresholds?: {
61
+ critical?: number | undefined;
62
+ warning?: number | undefined;
63
+ ok?: number | undefined;
64
+ } | undefined;
65
+ notifyNoData?: boolean | undefined;
66
+ noDataTimeframe?: number | undefined;
67
+ renotifyInterval?: number | undefined;
68
+ }>>;
69
+ }, "strip", z.ZodTypeAny, {
70
+ query: string;
71
+ message: string;
72
+ type: "metric alert" | "service check" | "event alert" | "query alert" | "composite" | "log alert" | "process alert" | "rum alert" | "trace-analytics alert" | "slo alert" | "event-v2 alert" | "audit alert" | "ci-pipelines alert" | "ci-tests alert" | "error-tracking alert";
73
+ name: string;
74
+ options?: {
75
+ thresholds?: {
76
+ critical?: number | undefined;
77
+ warning?: number | undefined;
78
+ ok?: number | undefined;
79
+ } | undefined;
80
+ notifyNoData?: boolean | undefined;
81
+ noDataTimeframe?: number | undefined;
82
+ renotifyInterval?: number | undefined;
83
+ } | undefined;
84
+ tags?: string[] | undefined;
85
+ priority?: number | undefined;
86
+ }, {
87
+ query: string;
88
+ message: string;
89
+ type: "metric alert" | "service check" | "event alert" | "query alert" | "composite" | "log alert" | "process alert" | "rum alert" | "trace-analytics alert" | "slo alert" | "event-v2 alert" | "audit alert" | "ci-pipelines alert" | "ci-tests alert" | "error-tracking alert";
90
+ name: string;
91
+ options?: {
92
+ thresholds?: {
93
+ critical?: number | undefined;
94
+ warning?: number | undefined;
95
+ ok?: number | undefined;
96
+ } | undefined;
97
+ notifyNoData?: boolean | undefined;
98
+ noDataTimeframe?: number | undefined;
99
+ renotifyInterval?: number | undefined;
100
+ } | undefined;
101
+ tags?: string[] | undefined;
102
+ priority?: number | undefined;
103
+ }>;
104
+ export type CreateMonitorInput = z.infer<typeof createMonitorSchema>;
105
+ export declare function createMonitor(input: CreateMonitorInput): Promise<string>;
106
+ export declare const updateMonitorSchema: z.ZodObject<{
107
+ monitorId: z.ZodNumber;
108
+ name: z.ZodOptional<z.ZodString>;
109
+ query: z.ZodOptional<z.ZodString>;
110
+ message: z.ZodOptional<z.ZodString>;
111
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
112
+ priority: z.ZodOptional<z.ZodNumber>;
113
+ options: z.ZodOptional<z.ZodObject<{
114
+ thresholds: z.ZodOptional<z.ZodObject<{
115
+ critical: z.ZodOptional<z.ZodNumber>;
116
+ warning: z.ZodOptional<z.ZodNumber>;
117
+ ok: z.ZodOptional<z.ZodNumber>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ critical?: number | undefined;
120
+ warning?: number | undefined;
121
+ ok?: number | undefined;
122
+ }, {
123
+ critical?: number | undefined;
124
+ warning?: number | undefined;
125
+ ok?: number | undefined;
126
+ }>>;
127
+ notifyNoData: z.ZodOptional<z.ZodBoolean>;
128
+ noDataTimeframe: z.ZodOptional<z.ZodNumber>;
129
+ renotifyInterval: z.ZodOptional<z.ZodNumber>;
130
+ }, "strip", z.ZodTypeAny, {
131
+ thresholds?: {
132
+ critical?: number | undefined;
133
+ warning?: number | undefined;
134
+ ok?: number | undefined;
135
+ } | undefined;
136
+ notifyNoData?: boolean | undefined;
137
+ noDataTimeframe?: number | undefined;
138
+ renotifyInterval?: number | undefined;
139
+ }, {
140
+ thresholds?: {
141
+ critical?: number | undefined;
142
+ warning?: number | undefined;
143
+ ok?: number | undefined;
144
+ } | undefined;
145
+ notifyNoData?: boolean | undefined;
146
+ noDataTimeframe?: number | undefined;
147
+ renotifyInterval?: number | undefined;
148
+ }>>;
149
+ }, "strip", z.ZodTypeAny, {
150
+ monitorId: number;
151
+ query?: string | undefined;
152
+ message?: string | undefined;
153
+ options?: {
154
+ thresholds?: {
155
+ critical?: number | undefined;
156
+ warning?: number | undefined;
157
+ ok?: number | undefined;
158
+ } | undefined;
159
+ notifyNoData?: boolean | undefined;
160
+ noDataTimeframe?: number | undefined;
161
+ renotifyInterval?: number | undefined;
162
+ } | undefined;
163
+ name?: string | undefined;
164
+ tags?: string[] | undefined;
165
+ priority?: number | undefined;
166
+ }, {
167
+ monitorId: number;
168
+ query?: string | undefined;
169
+ message?: string | undefined;
170
+ options?: {
171
+ thresholds?: {
172
+ critical?: number | undefined;
173
+ warning?: number | undefined;
174
+ ok?: number | undefined;
175
+ } | undefined;
176
+ notifyNoData?: boolean | undefined;
177
+ noDataTimeframe?: number | undefined;
178
+ renotifyInterval?: number | undefined;
179
+ } | undefined;
180
+ name?: string | undefined;
181
+ tags?: string[] | undefined;
182
+ priority?: number | undefined;
183
+ }>;
184
+ export type UpdateMonitorInput = z.infer<typeof updateMonitorSchema>;
185
+ export declare function updateMonitor(input: UpdateMonitorInput): Promise<string>;
186
+ export declare const deleteMonitorSchema: z.ZodObject<{
187
+ monitorId: z.ZodNumber;
188
+ }, "strip", z.ZodTypeAny, {
189
+ monitorId: number;
190
+ }, {
191
+ monitorId: number;
192
+ }>;
193
+ export type DeleteMonitorInput = z.infer<typeof deleteMonitorSchema>;
194
+ export declare function deleteMonitor(input: DeleteMonitorInput): Promise<string>;
195
+ export declare const muteMonitorSchema: z.ZodObject<{
196
+ monitorId: z.ZodNumber;
197
+ scope: z.ZodOptional<z.ZodString>;
198
+ end: z.ZodOptional<z.ZodNumber>;
199
+ }, "strip", z.ZodTypeAny, {
200
+ monitorId: number;
201
+ scope?: string | undefined;
202
+ end?: number | undefined;
203
+ }, {
204
+ monitorId: number;
205
+ scope?: string | undefined;
206
+ end?: number | undefined;
207
+ }>;
208
+ export type MuteMonitorInput = z.infer<typeof muteMonitorSchema>;
209
+ export declare function muteMonitor(input: MuteMonitorInput): Promise<string>;
210
+ export declare const unmuteMonitorSchema: z.ZodObject<{
211
+ monitorId: z.ZodNumber;
212
+ scope: z.ZodOptional<z.ZodString>;
213
+ allScopes: z.ZodOptional<z.ZodBoolean>;
214
+ }, "strip", z.ZodTypeAny, {
215
+ monitorId: number;
216
+ scope?: string | undefined;
217
+ allScopes?: boolean | undefined;
218
+ }, {
219
+ monitorId: number;
220
+ scope?: string | undefined;
221
+ allScopes?: boolean | undefined;
222
+ }>;
223
+ export type UnmuteMonitorInput = z.infer<typeof unmuteMonitorSchema>;
224
+ export declare function unmuteMonitor(input: UnmuteMonitorInput): Promise<string>;
225
+ //# sourceMappingURL=monitors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monitors.d.ts","sourceRoot":"","sources":["../../src/tools/monitors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAI7B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEnE,wBAAsB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsB5E;AAED,eAAO,MAAM,gBAAgB;;;;;;EAE3B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE/D,wBAAsB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBxE;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiC9B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAErE,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CA0B9E;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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