Skip to main content
Glama
vmware-skills

io.github.zw008/vmware-log-insight

aggregate_logs

Read-onlyIdempotent

Aggregate matching log events into a time series and detect volume spikes. Find when log volume bursts without pulling raw events, then search the spike window.

Instructions

[READ] Aggregate matching events into a time series and detect spikes.

WHEN: to find when/whether log volume burst without pulling raw events. Follow up with search_logs on the spike window.

RETURNS: {aggregation, field, bin_width_ms, constraints, bins:[{timestamp_ms, end_ms, value}] oldest first, spikes:[{timestamp_ms, end_ms, value, zscore}]}, plus 'note' when an empty series has a likely cause. For SAMPLE each bin's value is one example event {timestamp_ms, text, fields}, and no spikes are computed. The appliance omits bins with no events; for COUNT and UCOUNT those are added back as 0 (filled_empty_bins: true) so a burst after a quiet stretch still stands out. On a sparse series (a few events in an hour) that makes most non-empty bins spikes — read them as "events happened here", not as bursts. A bin is flagged as a spike when it sits at least 2 standard deviations above the mean; a series of fewer than 3 bins, or a flat one, reports no spikes rather than calling everything a spike — so an empty 'spikes' list is not evidence of calm when the window is short. Read-only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lastNoRelative window ending now — "30m", "2h", "7d" (units s/m/h/d) or a bare number of seconds. Cannot be combined with begin_ms/end_ms. Omit all three and the window defaults to the last hour.
textNoWord(s) matched with CONTAINS (whole words, not substrings; `*` is a wildcard), exactly as in search_logs. Omit to aggregate every event in the window.
fieldNoThe field the function applies to, as listed by list_log_fields ('name') — e.g. aggregation="UCOUNT", field="hostname" counts distinct hosts per bin. Required for UCOUNT/AVG/MIN/MAX/SUM/STDDEV/VARIANCE, refused for COUNT/SAMPLE. AVG/MIN/MAX/SUM/STDDEV/VARIANCE need a NUMBER field (list_log_fields 'type'). An unknown name returns an empty series with a 'note', not an error. Pass 'name' exactly as list_log_fields gives it: for a content-pack field that is the qualified "com.vmware.vsphere:vmw_esxi_auth_failed_user" — the bare display name and 'internal_name' match nothing.
end_msNoAbsolute window end as epoch milliseconds. Usable on its own; cannot be combined with last.
targetNoLog Insight target name as spelled in ~/.vmware-log-insight/config.yaml. Omit to use that file's default_target — with no default configured, omitting it is an error that lists the configured names.
begin_msNoAbsolute window start as epoch milliseconds (seconds are refused). Usable on its own; must be before end_ms; cannot be combined with last.
aggregationNoThe function applied within each bin — exactly one of COUNT, UCOUNT, AVG, MIN, MAX, SUM, STDDEV, VARIANCE, SAMPLE (lower case is accepted and upper-cased). Anything else raises a ValueError listing the nine. Default COUNT, which answers "how many events per bin" and is what spike detection is normally run on. COUNT and SAMPLE take no field; the other seven require one.COUNT
bin_width_msNoWidth of each time bin in milliseconds, must be positive (default 60000 = one minute). It sets the resolution of both the series and the spike test: bins much wider than the burst average it away, bins much narrower make every quiet minute look like noise.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.4.1

TDQS

A4.6/5.0
Behavior5/5

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

Annotations cover safety (readOnly/idempotent/non-destructive), and the description goes well beyond them: empty-bin back-filling for COUNT/UCOUNT (filled_empty_bins), SAMPLE returning one example event and no spikes, the 2-sigma spike rule, the <3-bin/flat-series exception, and the warning that an empty 'spikes' list is not evidence of calm. These are exactly the behavioral traits annotations cannot convey.

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?

Front-loaded with the action, then labeled WHEN and RETURNS sections, so it is easy to scan. It is long, but with no output schema the return-shape detail and spike caveats earn their space; only mild trimming would be possible.

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

Completeness5/5

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

Despite no output schema, the RETURNS block fully describes the response shape (bins, spikes, note, SAMPLE variant), and window/field/aggregation semantics plus edge cases are covered. Nothing needed to invoke or interpret the result is missing.

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 description coverage is 100%, so every parameter is already documented in the schema. The description restates some of that (e.g., COUNT being the aggregation spike detection runs on, bin_width_ms resolution trade-offs), adding reinforcement rather than new meaning. Baseline 3 is appropriate since the schema carries the parameter load.

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

Purpose5/5

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

States a specific verb+resource ('Aggregate matching events into a time series and detect spikes') and immediately contrasts with the raw-event sibling via 'without pulling raw events' and 'Follow up with search_logs'. An agent can route between aggregate_logs and search_logs without opening either schema.

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

Usage Guidelines5/5

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

The WHEN block names the intended use case (find whether/where log volume burst) and explicitly names the alternative (search_logs on the spike window) with the condition that selects it. The boundary between aggregating and pulling raw events is spelled out rather than inferred.

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