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
| Name | Required | Description | Default |
|---|---|---|---|
| metric | Yes | metric name to get metadata for |
Implementation Reference
- src/prometheus/client.ts:182-186 (handler)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); }
- src/server/tools.ts:64-66 (schema)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"), });
- src/server/tools.ts:104-113 (registration)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), }),