Skip to main content
Glama
agarwalvivek29

OpenTelemetry MCP Server

list_label_values

Retrieve all values for a specific label like 'service' or 'namespace' to discover monitored services and namespaces in your OpenTelemetry environment.

Instructions

Get all values for a specific label. Common labels: 'service', 'job', 'namespace', 'instance'. Use this to discover what services/namespaces are monitored.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelYesLabel name to get values for (e.g., 'service', 'job', 'namespace')
metricNoOptional metric name to filter label values

Implementation Reference

  • The core implementation of the list_label_values tool handler in prometheus_tools.py.
    async def list_label_values(
        client: PrometheusClient,
        label: str,
        metric: Optional[str] = None
    ) -> Dict[str, Any]:
        """
        Get all values for a specific label.
        
        Args:
            client: Prometheus client
            label: Label name (e.g., 'service', 'job', 'namespace')
            metric: Optional metric to filter label values
            
        Returns:
            List of label values
        """
        try:
            match = [f"{{{metric}}}"] if metric else None
            result = await client.label_values(label, match)
            
            if result.get("status") == "success":
                values = result.get("data", [])
                return {
                    "success": True,
                    "label": label,
                    "count": len(values),
                    "values": values
                }
            else:
                return {
                    "success": False,
                    "error": "Failed to fetch label values"
                }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool retrieves values for discovery purposes, but fails to detail critical behaviors such as whether it's read-only, if there are rate limits, authentication requirements, or how results are returned (e.g., pagination, format). This omission is significant for a tool with no annotation coverage.

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?

The description is concise and front-loaded, with two sentences that efficiently convey the tool's purpose and usage context. Every sentence adds value: the first defines the action and examples, and the second explains the use case. There's no wasted text, making it easy to scan and understand quickly.

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

Completeness3/5

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

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is somewhat complete but has gaps. It covers the basic purpose and usage context but lacks behavioral details and output information, which are crucial for effective tool invocation. Without annotations or an output schema, more guidance on behavior and results would improve completeness.

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

Parameters3/5

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

The schema description coverage is 100%, so the input schema already documents both parameters ('label' and 'metric') thoroughly. The description adds minimal value by listing example labels ('service', 'job', 'namespace', 'instance') and hinting at the 'metric' parameter's filtering role, but doesn't provide additional syntax or format details beyond what the schema offers. This meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Get all values for a specific label' with examples like 'service', 'job', 'namespace', 'instance'. It specifies the verb ('Get') and resource ('values for a specific label'), making it easy to understand. However, it doesn't explicitly distinguish this tool from its sibling 'list_log_label_values', which might handle similar data but for logs, leaving some ambiguity.

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

Usage Guidelines3/5

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

The description provides implied usage guidance by stating 'Use this to discover what services/namespaces are monitored' and listing common labels, which suggests it's for exploration and monitoring contexts. However, it lacks explicit when-to-use vs. when-not-to-use instructions or direct alternatives among siblings like 'list_labels' or 'list_log_label_values', leaving room for confusion in tool selection.

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/agarwalvivek29/opentelemetry-mcp'

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