Skip to main content
Glama

prometheus_metric_metadata

Retrieve detailed metadata for a specified Prometheus metric to enable precise monitoring and analysis within the Prometheus-MCP server environment.

Instructions

Get metadata for a specific Prometheus metric

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricYesmetric name to get metadata for

Implementation Reference

  • Zod schema defining the input parameters for the prometheus_metric_metadata tool (metric name).
    const PrometheusMetricMetadataSchema = z.object({ metric: z.string().describe("metric name to get metadata for"), });
  • Tool registration: defines and registers the prometheus_metric_metadata tool in the tools array, including its inline handler that delegates 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), }),
  • Core handler logic: executes HTTP GET request to Prometheus /api/v1/metadata endpoint with metric parameter to retrieve metric metadata.
    async getMetricMetadata(metric: string): Promise<MetricMetadata> { const endpoint = "/api/v1/metadata"; const params: Record<string, string> = { metric }; return this.request<MetricMetadata>(endpoint, params); }

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