Skip to main content
Glama
yanmxa

Prometheus MCP Server

by yanmxa

prom_metadata

Retrieve detailed metadata for Prometheus metrics to understand available data, analyze system performance, and streamline monitoring workflows.

Instructions

Get metric metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricNoMetric name (optional)

Implementation Reference

  • Handler logic for the prom_metadata tool: validates arguments and delegates to PrometheusClient.metadata method.
    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)
    Registration of the prom_metadata tool in the tools array, including name, description, and input schema.
    { name: 'prom_metadata', description: 'Get metric metadata', inputSchema: { type: 'object', properties: { metric: { type: 'string', description: 'Metric name (optional)' }, }, }, }, {
  • TypeScript interface defining the input arguments for prom_metadata tool.
    export interface PromMetadataArgs { metric?: string; }
  • Core implementation of metadata query in PrometheusClient, which makes the API call to /api/v1/metadata.
    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; }
  • Type guard function to validate arguments for prom_metadata tool.
    function isPromMetadataArgs(args: unknown): args is PromMetadataArgs { return typeof args === 'object' && args !== null; }

Other Tools

Related 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