Skip to main content
Glama
mshegolev

mshegolev/prometheus-mcp

prometheus_query

Read-onlyIdempotent

Execute an instant PromQL query to get current metric values from Prometheus. Returns labels, timestamp, and value for time series at a single point in time.

Instructions

Execute an instant PromQL query against Prometheus.

Wraps GET /api/v1/query. Returns the result type (vector, scalar, matrix, string) and a list of samples each carrying labels, timestamp, and value. For vector results each element is one time series at the evaluation instant.

Examples: - Use when: "Is the payment service up right now?" → query='up{job="payment-service"}'. - Use when: "What is the current HTTP request rate?" → query='sum(rate(http_requests_total[5m])) by (job)'. - Use when: "Show me all metrics for a specific instance" → query='{instance="localhost:9090"}'. - Don't use when: You want to see how a metric changed over time (call prometheus_query_range with start/end/step). - Don't use when: You don't know the metric name yet (call prometheus_list_metrics first to discover names).

Returns: dict with query / time / result_type / result_count / data (list of samples with labels, timestamp, value).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesPromQL expression to evaluate. Examples: 'up', 'rate(http_requests_total[5m])', 'sum(rate(http_requests_total[5m])) by (job)'.
timeNoEvaluation timestamp (optional). RFC3339 (e.g. '2024-01-15T10:00:00Z') or Unix timestamp (e.g. '1705312800'). Defaults to now.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
timeYes
result_typeYes
result_countYes
dataYes
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate read-only, non-destructive, idempotent behavior. The description adds further context: wraps a specific API endpoint, describes return type and structure (vector, scalar, matrix, string with samples), and includes examples. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: purpose summary, API reference, result format, then a bulleted list of examples. Each sentence adds value, no fluff. Front-loaded with the core action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of annotations (readOnlyHint, destructiveHint=false, idempotentHint=true) and output schema (mentioned), the description is complete: it explains the instant query nature, result format, and provides actionable examples. No gaps for a query tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema already provides 100% coverage with descriptions and constraints. The description adds meaning by including usage examples and clarifying the time parameter's format, but the schema covers the core semantics well. Extra examples elevate it above baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description starts with a clear, specific verb+resource: 'Execute an instant PromQL query against Prometheus.' It distinguishes from siblings by explicitly stating when not to use it (e.g., for time ranges use prometheus_query_range, for metric discovery use prometheus_list_metrics).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit 'Use when' and 'Don't use when' examples with concrete PromQL queries and alternative tool names. This gives clear context for when to invoke this tool vs its siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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