Skip to main content
Glama
us-all

datadog-mcp-server

by us-all

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

TableJSON Schema
NameRequiredDescriptionDefault
metricNameYesFull metric name. Example: system.cpu.user

Implementation Reference

  • 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,
      };
    }
  • 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,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description does not disclose behavioral traits such as authentication needs, error handling, rate limits, or side effects. Since it's a read operation, additional context (e.g., what happens if the metric doesn't exist) would be valuable.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with no unnecessary words. It front-loads the core action and resource efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the low complexity (one parameter, no output schema, no annotations), the description is nearly complete. It clearly states the return content (type, unit, description). Minor gap: no mention of error conditions or role requirements, but acceptable for a simple tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the schema already provides clear documentation for the single parameter (metricName) with an example. The tool description adds no additional parameter semantics, so baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'metadata for a specific Datadog metric', and specifies the information retrieved (type, unit, description). It effectively distinguishes from sibling tools like get-metrics or list-active-metrics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like get-metrics or list-active-metrics. No exclusions or context for selection are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/us-all/datadog-mcp-server'

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