Skip to main content
Glama

get-metric-metadata

Retrieve detailed metadata for Datadog metrics to understand their meaning, type, unit, and proper usage.

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 execute function implementing the core logic of the 'get-metric-metadata' tool by querying Datadog's Metrics API for the specified metric's 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 description, input schema validation, and delegation to 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) }]
        };
      }
    );
  • Zod input schema defining the required 'metricName' parameter as a string.
      metricName: z.string()
    },
  • Initialization helper that configures the Datadog API client with authentication and site settings.
    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
        });
      }
    },
  • TypeScript type for the input parameters used in the handler.
    type GetMetricMetadataParams = {
      metricName: string;
    };
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It describes a read-only operation ('Retrieve') and the type of data returned, but lacks behavioral details such as error handling (e.g., if metricName is invalid), authentication needs, rate limits, or response format. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 two sentences, front-loaded with the core action and purpose, and every sentence adds value (first defines the tool, second explains usage). It's efficient with zero waste, appropriately sized for a simple tool.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is minimally complete. It covers the basic purpose and usage but lacks details on parameters, behavioral traits, and output. Without annotations or output schema, more context on return values or errors would improve completeness, but it's adequate for a simple read operation.

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?

The input schema has 1 parameter (metricName) with 0% description coverage, so the schema provides no semantic information. The description adds no details about the parameter (e.g., format, examples, constraints). Since schema coverage is low (<50%), the description fails to compensate, resulting in minimal value beyond the schema. Baseline is 3 due to adequate but incomplete coverage.

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

Purpose4/5

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

The description clearly states the action ('Retrieve detailed metadata') and resource ('about a specific metric'), specifying what information is returned (type, description, unit, other attributes) and the purpose ('to understand a metric's meaning and proper usage'). It distinguishes from siblings like 'get-metrics' (likely listing metrics) by focusing on metadata for a single metric, though not explicitly named. This is specific but lacks explicit sibling differentiation.

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

Usage Guidelines3/5

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

The description implies usage ('Use this to understand a metric's meaning and proper usage'), suggesting it's for learning about metrics rather than operational tasks. However, it doesn't explicitly state when to use this vs. alternatives like 'get-metrics' (which might list metrics without details) or other tools, and provides no exclusions or prerequisites. The guidance is implied but not detailed.

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/GeLi2001/datadog-mcp-server'

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