Skip to main content
Glama
abuzo

victorialogs-mcp

by abuzo

victorialogs.query_stats

Read-onlyIdempotent

Run LogsQL aggregation pipelines to group and count log events in VictoriaLogs, returning raw JSON rows with time-range and row limits.

Instructions

Execute a LogsQL aggregation pipeline, e.g. * | stats by (service) count() as errors. Returns original JSON rows without log normalization. Uses /select/logsql/query, not the Prometheus stats API. Default last hour, max 500 rows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNo
limitNo
queryYes
startNo
filterNo
offsetNo
rangeSecNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already establish readOnly/idempotent/non-destructive, so the description adds real behavioral value beyond them: it returns 'original JSON rows without log normalization', names the backing endpoint, and discloses the default window (last hour) and row cap (max 500). It doesn't cover pagination interaction with offset or truncation signaling, which would push this higher.

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?

Four short sentences, front-loaded with the core purpose and an inline example. Each sentence carries distinct information (purpose, return shape, endpoint, defaults), though the endpoint/API clarification is the least essential for invocation.

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?

With no output schema, the description must carry return-value context, and it does so briefly ('original JSON rows without log normalization'). Combined with the stated defaults and row cap it is reasonably complete, but the seven undocumented parameters and the missing behavior for offset-based pagination leave meaningful gaps for an aggregation tool.

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?

Schema coverage is 0% across 7 parameters, so the description must compensate, and it only partially does: it confirms the 500-row limit and the one-hour default, matching the schema's limit and rangeSec defaults. It says nothing about start/end formats, offset semantics, or the relationship between the query and filter properties, leaving most parameters undocumented.

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?

States a specific verb and resource: 'Execute a LogsQL aggregation pipeline' with a concrete example ('* | stats by (service) count() as errors'). It also clarifies the execution path ('/select/logsql/query, not the Prometheus stats API'), which separates it from an adjacent-but-different API, though it does not name a sibling tool like search_logs or hits directly.

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 aggregation framing implies this is for stats/summary queries rather than raw log retrieval, and the Prometheus-API note clarifies a boundary. However, it never states when to prefer this over search_logs, search_stream, or hits, nor any prerequisites for the LogsQL pipeline. Usage is implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.