Skip to main content
Glama
mshegolev

mshegolev/prometheus-mcp

prometheus_get_cardinality

Read-onlyIdempotent

Identifies high series counts and label cardinality to troubleshoot Prometheus memory and query slowdowns.

Instructions

Get TSDB statistics and cardinality data from Prometheus.

Wraps GET /api/v1/status/tsdb. Returns head stats (total series, chunks, time range) and top-N lists: metrics by series count, labels by value count, and labels by memory usage.

Use this to investigate cardinality explosions — the #1 operational Prometheus problem. High series counts slow queries and increase memory.

Examples: - Use when: "Why is Prometheus using so much memory?" → check num_series and top_metrics_by_series. - Use when: "Which labels have the most values?" → check top_labels_by_value_count. - Don't use when: You want current metric values (call prometheus_query).

Returns: dict with num_series / chunk_count / min_time / max_time / top_metrics_by_series / top_labels_by_value_count / top_labels_by_memory_bytes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_timeYes
min_timeYes
num_seriesYes
chunk_countYes
num_label_pairsYes
top_metrics_by_seriesYes
top_labels_by_value_countYes
top_labels_by_memory_bytesYes
Behavior4/5

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

Annotations already declare readOnly, idempotent, and non-destructive. Description adds context about the underlying GET endpoint and operational significance. 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.

Conciseness5/5

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

Description is concise with clear structure: purpose, endpoint, examples, and return format. Every sentence adds value without redundancy.

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

Completeness4/5

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

Comprehensive except for missing explanation of the 'instance' parameter. Otherwise, purpose, usage, behavior, and return values are well covered.

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

Parameters2/5

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

Only one optional parameter 'instance' with 0% schema description coverage. Description does not explain what 'instance' refers to or how to use it, leaving a gap for the agent.

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?

Description clearly states it gets TSDB statistics and cardinality data, specifies the wrapped API endpoint, and lists returned fields. It distinguishes from sibling tools like prometheus_query by focusing on cardinality rather than current metric 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?

Explicitly states use case: investigate cardinality explosions. Provides example scenarios with specific queries and indicates when not to use (when wanting current metric values, pointing to prometheus_query).

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