Skip to main content
Glama
yincongcyincong

VictoriaMetrics-mcp-server

vm_prometheus_write

Import Prometheus exposition format metrics data into VictoriaMetrics for monitoring and analysis.

Instructions

mport Prometheus exposition format data into VictoriaMetrics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesMetrics data in Prometheus exposition format

Implementation Reference

  • The core handler function that receives Prometheus exposition format data and POSTs it to the VictoriaMetrics /api/v1/import/prometheus endpoint as text/plain, returning success or error response.
    async function vmPrometheusWrite(data) {
      let urlStr = VM_URL
      if (urlStr === "") {
        urlStr = VM_INSERT_URL
      }
      const url = new URL(urlStr + "/api/v1/import/prometheus");
    
      const response = await fetch(url.toString(), {
        method: 'POST',
        headers: {
          'Content-Type': 'text/plain'
        },
        body: data
      });
      const status = response.status;
    
      if (status === 204) {
        return {
          content: [{
            type: "text",
            text: response.text(),
          }],
          isError: false
        };
      } else {
        return {
          content: [{
            type: "text",
            text: response.text(),
          }],
          isError: true
        };
      }
    }
  • Tool schema definition including name, description, and inputSchema requiring a 'data' string in Prometheus format.
    const VM_PROMETHEUS_WRITE_TOOL = {
      name: "vm_prometheus_write",
      description: "mport Prometheus exposition format data into VictoriaMetrics",
      inputSchema: {
        type: "object",
        properties: {
          data: {
            type: "string",
            description: "Metrics data in Prometheus exposition format",
          },
        },
        required: ["data"],
      }
    };
  • src/index.js:127-134 (registration)
    Registration of the tool in the VM_TOOLS array, which is returned by the ListTools 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:363-366 (registration)
    Dispatch case in the CallToolRequestSchema handler that extracts arguments and calls the vmPrometheusWrite handler.
    case "vm_prometheus_write": {
      const {data} = request.params.arguments;
      return await vmPrometheusWrite(data);
    }
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 imports data, implying a write/mutation operation, but fails to describe critical behaviors like error handling, rate limits, idempotency, or what happens on success/failure. This leaves significant gaps for an agent to understand how to invoke it safely.

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, efficient sentence that directly states the tool's function without any wasted words. It is front-loaded with the core action and resource, making it easy to parse and understand quickly.

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 tool's complexity as a data import/write operation with no annotations and no output schema, the description is incomplete. It lacks information on behavioral traits, error handling, and usage context, which are essential for an agent to operate this tool effectively in a real-world scenario.

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%, with the single parameter 'data' fully documented in the schema as 'Metrics data in Prometheus exposition format'. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline for high schema coverage without compensating with extra details.

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 ('import') and the resource ('Prometheus exposition format data into VictoriaMetrics'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like vm_data_write, which prevents a perfect score, but the specificity of 'Prometheus exposition format' provides useful context.

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?

The description provides no guidance on when to use this tool versus alternatives like vm_data_write or other sibling tools. It lacks context about prerequisites, such as whether data must be formatted in a specific way or if authentication is required, leaving the agent with minimal usage direction.

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