Skip to main content
Glama
idanfishman

prometheus-mcp

by idanfishman

prometheus_metric_metadata

Retrieve metadata for Prometheus metrics to understand their structure, labels, and monitoring context within your infrastructure.

Instructions

Get metadata for a specific Prometheus metric

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricYesmetric name to get metadata for

Implementation Reference

  • Core handler logic for retrieving Prometheus metric metadata by making an API request to the /api/v1/metadata endpoint with the specified metric parameter.
    async getMetricMetadata(metric: string): Promise<MetricMetadata> {
      const endpoint = "/api/v1/metadata";
      const params: Record<string, string> = { metric };
      return this.request<MetricMetadata>(endpoint, params);
    }
  • Zod schema defining the input for the tool: a required 'metric' string parameter.
    const PrometheusMetricMetadataSchema = z.object({
      metric: z.string().describe("metric name to get metadata for"),
    });
  • Tool definition and registration in the tools array, including name, capability, schema reference, and inline handler delegating to PrometheusClient.getMetricMetadata.
    defineTool<typeof PrometheusMetricMetadataSchema, MetricMetadata>({
      capability: "discovery",
      name: "prometheus_metric_metadata",
      title: "Get Metric Metadata",
      description: "Get metadata for a specific Prometheus metric",
      inputSchema: PrometheusMetricMetadataSchema,
      type: "readonly",
      handle: async (client: PrometheusClient, args) =>
        client.getMetricMetadata(args.metric),
    }),

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

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