Skip to main content
Glama

get-monitor

Retrieve detailed configuration, status, and information for a specific Datadog monitor by its ID. Use this to access and manage individual monitor data efficiently.

Instructions

Get detailed information about a specific Datadog monitor by its ID. Use this to retrieve the complete configuration, status, and other details of a single monitor.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
monitorIdYes

Implementation Reference

  • Core handler logic for the 'get-monitor' tool: destructures monitorId, creates MonitorsApi instance, calls getMonitor API, and returns the response or throws error.
    execute: async (params: GetMonitorParams) => { try { const { monitorId } = params; const apiInstance = new v1.MonitorsApi(configuration); const apiParams: v1.MonitorsApiGetMonitorRequest = { monitorId: monitorId }; const response = await apiInstance.getMonitor(apiParams); return response; } catch (error) { console.error(`Error fetching monitor ${params.monitorId}:`, error); throw error; } }
  • src/index.ts:105-117 (registration)
    Registers the 'get-monitor' MCP tool with name, description, input schema (monitorId: number), and thin wrapper that calls getMonitor.execute and formats response.
    server.tool( "get-monitor", "Get detailed information about a specific Datadog monitor by its ID. Use this to retrieve the complete configuration, status, and other details of a single monitor.", { monitorId: z.number() }, async (args) => { const result = await getMonitor.execute(args); return { content: [{ type: "text", text: JSON.stringify(result) }] }; } );
  • TypeScript type definition for input parameters used in the handler.
    type GetMonitorParams = { monitorId: number; };
  • Initialization function sets up Datadog client configuration with API keys and site.
    initialize: () => { const configOpts = { authMethods: { apiKeyAuth: process.env.DD_API_KEY, appKeyAuth: process.env.DD_APP_KEY } }; configuration = client.createConfiguration(configOpts); if (process.env.DD_METRICS_SITE) { configuration.setServerVariables({ site: process.env.DD_METRICS_SITE }); } },
  • src/index.ts:69-69 (registration)
    Calls initialize on getMonitor during server setup.
    getMonitor.initialize();

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GeLi2001/datadog-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server