Skip to main content
Glama

prometheus_runtime_info

Retrieve Prometheus runtime details to monitor and analyze system performance. Supports integration with AI assistants for efficient querying and metric discovery.

Instructions

Get Prometheus runtime information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration and definition of the prometheus_runtime_info MCP tool, including its name, description, empty input schema, and thin handler that delegates to PrometheusClient.getRuntimeInfo()
    defineTool<typeof EmptySchema, RuntimeInfo>({ capability: "info", name: "prometheus_runtime_info", title: "Get Runtime Info", description: "Get Prometheus runtime information", inputSchema: EmptySchema, type: "readonly", handle: async (client: PrometheusClient) => client.getRuntimeInfo(), }),
  • Empty input schema (z.object({})) used by the prometheus_runtime_info tool and others requiring no parameters
    const EmptySchema = z.object({});
  • Implementation of the getRuntimeInfo method called by the tool handler, which performs an HTTP GET request to the Prometheus /api/v1/status/runtimeinfo endpoint using the client's internal request method
    async getRuntimeInfo(): Promise<RuntimeInfo> { const endpoint = "/api/v1/status/runtimeinfo"; return this.request<RuntimeInfo>(endpoint); }
  • Internal request helper method used by getRuntimeInfo to make authenticated HTTP requests to Prometheus API with proper error handling and logging
    private async request<T>( endpoint: string, params?: Record<string, string>, ): Promise<T> { const url = new URL(endpoint, this.baseUrl); const queryParams = new URLSearchParams(params); if (queryParams) { url.search = queryParams.toString(); } logger.debug("making prometheus request", { endpoint, url }); try { const response = await fetch(url.toString(), { method: "GET", headers: this.headers, }); if (!response.ok) { const error = `http ${response.status}: ${response.statusText}`; logger.error(error, { endpoint, status: response.status }); throw new Error(error); } const result: Response<T> = await response.json(); if (result.status !== "success") { const errorMsg = result.error || "unknown error"; const error = `prometheus api error: ${errorMsg}`; logger.error(error, { endpoint, status: result.status }); throw new Error(error); } logger.debug("prometheus request successful", { endpoint }); return result.data; } catch (error) { logger.error("prometheus request failed", { endpoint, error: error instanceof Error ? error.message : String(error), }); throw error; }

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