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(); }

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