Skip to main content
Glama

get-metric-metadata

Retrieve detailed metadata for a specific metric, including its type, description, unit, and attributes, to understand its meaning and proper usage within the Datadog MCP server for monitoring and tracing.

Instructions

Retrieve detailed metadata about a specific metric, including its type, description, unit, and other attributes. Use this to understand a metric's meaning and proper usage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricNameYes

Implementation Reference

  • The main handler function that executes the Datadog API call to retrieve metric metadata.
    execute: async (params: GetMetricMetadataParams) => { try { const { metricName } = params; const apiInstance = new v1.MetricsApi(configuration); const apiParams: v1.MetricsApiGetMetricMetadataRequest = { metricName: metricName }; const response = await apiInstance.getMetricMetadata(apiParams); return response; } catch (error) { console.error( `Error fetching metadata for metric ${params.metricName}:`, error ); throw error; } }
  • src/index.ts:162-174 (registration)
    Registers the 'get-metric-metadata' tool with the MCP server, including input schema and a thin wrapper around the handler.
    server.tool( "get-metric-metadata", "Retrieve detailed metadata about a specific metric, including its type, description, unit, and other attributes. Use this to understand a metric's meaning and proper usage.", { metricName: z.string() }, async (args) => { const result = await getMetricMetadata.execute(args); return { content: [{ type: "text", text: JSON.stringify(result) }] }; } );
  • TypeScript type definition for the input parameters used by the handler.
    type GetMetricMetadataParams = { metricName: string; };
  • Initialization function that sets up the Datadog API client configuration with auth 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 }); } },

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