Skip to main content
Glama
yanmxa

Prometheus MCP Server

by yanmxa

prom_metadata

Retrieve metadata for Prometheus metrics to understand available data types, descriptions, and labels for system monitoring.

Instructions

Get metric metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricNoMetric name (optional)

Implementation Reference

  • Core handler implementation for prom_metadata tool: queries Prometheus /api/v1/metadata API endpoint with optional 'metric' parameter and returns the response data.
    async metadata(metric?: string): Promise<PrometheusResponse<Record<string, MetricMetadata[]>>> {
      const params: Record<string, string> = {};
      if (metric) params.metric = metric;
      const response = await this.client.get<PrometheusResponse<Record<string, MetricMetadata[]>>>('/api/v1/metadata', { params });
      return response.data;
    }
  • Tool dispatch handler in handleToolCall: validates input arguments and delegates to PrometheusClient.metadata().
    case 'prom_metadata': {
      if (!isPromMetadataArgs(args)) {
        throw new Error('Invalid arguments for prom_metadata');
      }
      const { metric } = args as PromMetadataArgs;
      result = await prometheusClient.metadata(metric);
      break;
  • src/tools.ts:44-54 (registration)
    Registers the prom_metadata tool in the tools array with name, description, and input schema for MCP.
    {
      name: 'prom_metadata',
      description: 'Get metric metadata',
      inputSchema: {
        type: 'object',
        properties: {
          metric: { type: 'string', description: 'Metric name (optional)' },
        },
      },
    },
    {
  • TypeScript interface defining the expected input arguments for prom_metadata tool.
    export interface PromMetadataArgs {
      metric?: string;
    }
  • Type guard helper function to validate if arguments match PromMetadataArgs shape.
    function isPromMetadataArgs(args: unknown): args is PromMetadataArgs {
      return typeof args === 'object' && args !== null;
    }
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 of behavioral disclosure. 'Get metric metadata' implies a read-only operation, but it doesn't specify whether this requires authentication, has rate limits, returns structured data, or involves any side effects. 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 extremely concise at three words, with no wasted language. It's front-loaded and to the point, making it easy to parse quickly, though this conciseness comes at the cost of detail.

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

Completeness2/5

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

Given no annotations, no output schema, and a simple parameter, the description is incomplete. It doesn't explain what 'metric metadata' entails, how results are returned, or any behavioral traits. For a tool in a set with siblings like prom_query, more context is needed to guide proper use.

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 100% description coverage, with the 'metric' parameter documented as 'Metric name (optional)'. The description doesn't add any meaning beyond this, such as examples or format details. With high schema coverage, the baseline score of 3 is appropriate, as the schema does the heavy lifting.

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

Purpose3/5

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

The description 'Get metric metadata' clearly states the action (get) and resource (metric metadata), which is better than a tautology. However, it doesn't specify what 'metric metadata' includes (labels, types, help text) or differentiate it from sibling tools like prom_discover or prom_query, making it somewhat vague.

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 prom_discover or prom_query. It lacks any context about use cases, prerequisites, or exclusions, leaving the agent to infer usage from the tool name alone.

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/yanmxa/prometheus-mcp-server'

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