Skip to main content
Glama
yincongcyincong

VictoriaMetrics-mcp-server

vm_labels

Retrieve all unique label names from VictoriaMetrics to organize and filter time series data for monitoring and analysis.

Instructions

Get all unique label names

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the vm_labels tool by querying the VictoriaMetrics /api/v1/labels endpoint and returning the list of unique label names.
    async function vmLabels() {
      let urlStr = VM_URL
      if (urlStr === "") {
        urlStr = VM_SELECT_URL
      }
      const url = new URL(urlStr + "/api/v1/labels");
      const response = await fetch(url.toString());
      const data = await response.json();
    
      if (data.status === "success") {
        return {
          content: [{
            type: "text",
            text: JSON.stringify(data.data),
          }],
          isError: false
        };
      } else {
        return {
          content: [{
            type: "text",
            text: "range query fail:" + await response.text(),
          }],
          isError: true
        };
      }
    }
  • Tool schema definition for vm_labels, including name, description, and empty input schema (no parameters required).
    const VM_LABELS_TOOL = {
      name: "vm_labels",
      description: "Get all unique label names",
      inputSchema: {
        type: "object",
        properties: {},
        required: [],
      }
    };
  • src/index.js:127-134 (registration)
    Registration of the vm_labels tool (VM_LABELS_TOOL) in the VM_TOOLS array, which is provided to the listTools request handler.
    const VM_TOOLS = [
      VM_DATA_WRITE_TOOL,
      VM_QUERY_RANGE_TOOL,
      VM_QUERY_TOOL,
      VM_LABELS_TOOL,
      VM_LABEL_VALUES_TOOL,
      VM_PROMETHEUS_WRITE_TOOL
    ];
  • src/index.js:356-358 (registration)
    Dispatch/registration in the callTool request handler switch statement that maps 'vm_labels' to the vmLabels function.
    case "vm_labels": {
      return await vmLabels();
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves data ('Get'), implying a read-only operation, but doesn't mention any behavioral traits such as permissions needed, rate limits, or response format. This leaves significant gaps in understanding how the tool behaves.

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 a single, clear sentence with no wasted words, making it highly concise and front-loaded. It efficiently communicates the core purpose without any structural issues or redundancy.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a tool that likely returns data. It doesn't explain what 'all unique label names' entails (e.g., format, scope, or limitations), leaving the agent without enough context to understand the full tool behavior or output.

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?

The tool has 0 parameters, and the schema description coverage is 100%, so no parameter information is needed. The description appropriately doesn't add unnecessary details, aligning with the lack of inputs, which justifies a baseline score of 4 for this dimension.

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 action ('Get') and resource ('all unique label names'), making the tool's purpose understandable. However, it doesn't differentiate from sibling tools like 'vm_label_values', which might retrieve label values rather than names, leaving some ambiguity about sibling relationships.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'vm_label_values' or other sibling tools. The description lacks context about use cases, prerequisites, or exclusions, offering minimal help for an AI agent in selecting the right tool.

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/yincongcyincong/VictoriaMetrics-mcp-server'

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