get-metric-metadata
Retrieve metadata for a Datadog metric, including its type, unit, and description.
Instructions
Get metadata for a specific Datadog metric (type, unit, description)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| metricName | Yes | Full metric name. Example: system.cpu.user |
Implementation Reference
- src/tools/metrics.ts:58-73 (handler)The handler function for the 'get-metric-metadata' tool. Calls the Datadog metrics API to retrieve metadata (description, type, unit, etc.) for a specific metric name.
export async function getMetricMetadata(params: z.infer<typeof getMetricMetadataSchema>) { const response = await metricsApi.getMetricMetadata({ metricName: params.metricName, }); return { name: params.metricName, description: response.description, type: response.type, unit: response.unit, perUnit: response.perUnit, shortName: response.shortName, integration: response.integration, statsdInterval: response.statsdInterval, }; } - src/tools/metrics.ts:54-56 (schema)Zod schema for the 'get-metric-metadata' tool input: requires a 'metricName' string parameter.
export const getMetricMetadataSchema = z.object({ metricName: z.string().describe("Full metric name. Example: system.cpu.user"), }); - src/index.ts:186-191 (registration)Registration of the 'get-metric-metadata' tool with the MCP server, binding the schema and handler.
tool( "get-metric-metadata", "Get metadata for a specific Datadog metric (type, unit, description)", getMetricMetadataSchema.shape, wrapToolHandler(getMetricMetadata), ); - src/index.ts:18-19 (registration)Import of getMetricMetadataSchema and getMetricMetadata from the metrics module.
getMetricMetadataSchema, getMetricMetadata, listActiveMetricsSchema, listActiveMetrics,