Skip to main content
Glama
mshegolev

mshegolev/prometheus-mcp

prometheus_get_metric_metadata

Read-onlyIdempotent

Retrieve HELP, TYPE, and UNIT metadata from Prometheus to understand metric definitions and write correct PromQL queries.

Instructions

Get metric metadata (HELP text, TYPE, UNIT) from Prometheus.

Wraps GET /api/v1/metadata. Returns the metadata that Prometheus scraped from HELP, TYPE, and UNIT lines in the exposition format. Each metric may have multiple metadata entries if different scrape targets expose different help strings.

Use this to understand what a metric measures, its type (counter, gauge, histogram, summary), and unit — essential for writing correct PromQL. For example, knowing a metric is a counter means you should use rate() or increase(); a gauge can be used directly.

Examples: - Use when: "What does http_requests_total measure?" → metric='http_requests_total'; read help and type. - Use when: "Show me all histogram metrics" → call with no filter; filter results where type='histogram'. - Use when: Starting an investigation — check metric types before writing PromQL to avoid using rate() on a gauge. - Don't use when: You already know the metric type and want to query values (call prometheus_query directly).

Returns: dict with metric / total_count / returned_count / truncated / metadata (dict of metric name → list of {type, help, unit}).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricNoOptional metric name to filter metadata. Example: 'http_requests_total' returns metadata only for that metric. Leave empty to list metadata for all metrics (capped at 500).
instanceNoTarget instance name (omit for default instance)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricYes
metadataYes
truncatedYes
total_countYes
returned_countYes
Behavior4/5

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

Annotations already declare readOnly, idempotent, and openWorld hints. The description adds detail beyond this, such as wrapping the GET /api/v1/metadata endpoint, the possibility of multiple metadata entries per metric, and the return structure.

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-organized: a one-line summary, a technical detail paragraph, usage guidance, and examples. Every sentence provides value, and it is not overly verbose.

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 schema covers all parameters and the description details the output format and edge cases (multiple entries), the tool is fully explained. The presence of an output schema description in the text further completes understanding.

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 coverage is 100%, but the description adds meaningful context for the 'metric' parameter with examples and default behavior (capped at 500). The 'instance' parameter is only described in the schema, but overall the description enhances understanding.

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 the tool retrieves metric metadata (HELP, TYPE, UNIT) from Prometheus. It distinguishes itself from sibling tools like prometheus_query by explicitly noting it is for understanding metric types, not for querying values.

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?

It provides explicit when-to-use and when-not-to-use examples, such as using it to check metric types before writing PromQL, and warns against using it when the metric type is already known, directing to prometheus_query instead.

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