Skip to main content
Glama
mshegolev

mshegolev/prometheus-mcp

prometheus_query

Read-onlyIdempotent

Execute an instant PromQL query to retrieve current metric values, such as service up status or request rate, from a Prometheus instance.

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
timeNoEvaluation timestamp (optional). RFC3339 (e.g. '2024-01-15T10:00:00Z') or Unix timestamp (e.g. '1705312800'). Defaults to now.
queryYesPromQL expression to evaluate. Examples: 'up', 'rate(http_requests_total[5m])', 'sum(rate(http_requests_total[5m])) by (job)'.
instanceNoTarget instance name (omit for default instance)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
timeYes
queryYes
result_typeYes
result_countYes
Behavior4/5

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

Annotations already indicate readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description adds detail about the return format (result type, samples with labels/timestamp/value) and response structure. No contradictions.

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

Conciseness4/5

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

Well-structured with clear sections and examples. Every sentence adds value, but it is somewhat lengthy. Front-loads the core purpose and provides structured examples.

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 complexity of PromQL queries and the presence of an output schema describing the return structure, the description covers everything needed: purpose, usage, parameters, return format, and examples. No gaps.

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 description coverage is 100% and already documents parameters well. The description adds value with usage examples that illustrate parameter values (e.g., time format, query examples) and clarifies the 'instance' parameter's purpose.

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 clearly states it executes an instant PromQL query against Prometheus, wrapping the GET /api/v1/query endpoint. It distinguishes from sibling tools like prometheus_query_range and prometheus_list_metrics with specific usage examples.

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, pointing to alternative tools for range queries and metric discovery. This gives clear decision guidance.

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