Skip to main content
Glama
io.github.ryanmat/logicmonitor

io.github.ryanmat/logicmonitor

by ryanmat

analyze_alerts

Read-onlyIdempotent

Analyze an alert window to see how many alerts fired, when, which belong together, how noisy alerting is, which datasources burst, and which portal changes preceded a spike.

Instructions

Analyze one alert window: call this for how many alerts fired and when, which alerts belong together, how noisy alerting is, which datasources burst, or which portal changes preceded a spike over the last hours. One read of the window's active and cleared alerts, under the severity, device, group and datasource filters, feeds every section; 'statistics' gives active and cleared totals, counts by severity, the ten busiest devices and datasources, and the volume of each hour, cleared alerts included; 'clusters' groups two or more alerts by device, by datasource and by signature (datasource and datapoint) and lists the five largest of each type, each with its alert count, its ten most severe alert ids, up to ten of its devices with device_count, and first and last start times, while cluster_count and by_type count every cluster; a device cluster names the device_id its alerts share, null for a website or two devices under one name; 'noise' gives a 0 to 100 score from the entropy of alerts over datasource and datapoint (weight 40), flaps, an alert on the same device and datapoint that re-fires within 30 minutes of clearing (30), and repeats, a combination with three or more alerts (30), with the first ten flap pairs and tuning recommendations; 'bursts' gives the windows of window_seconds on one datasource that hold at least min_alerts alerts on min_devices devices, the ten largest listed and all counted in bursts_detected; 'changes' reads the audit log once and pairs each change (a create, update, delete or import, read from the entry's description) with the first 5-minute alert spike, a bucket above the mean by one standard deviation, within correlation_window_minutes after it, with a confidence from 1.0 to 0.5; it lists the ten pairs of highest confidence and counts them all in total_correlated. Narrow the filters to see what a bounded list leaves out. truncated says when the 5000-alert cap cut either read short. Use get_alerts to list or page through the alerts themselves.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "analyze_alerts"
  }
}

Input Schema

NameRequiredDescriptionDefault
hoursNoHours the window reaches back from now (default: 24)
deviceNoOnly alerts on devices whose name contains this
analysesNoSections to compute (all if omitted)
group_idNoOnly alerts on devices in this device group
severityNoOnly alerts of this severity
datasourceNoOnly alerts from datasources whose name contains this, regardless of case
min_alertsNoFewest alerts a burst holds (default: 10)
min_devicesNoFewest distinct devices a burst holds (default: 3)
window_secondsNoBurst window length in seconds (default: 60)
correlation_window_minutesNoLongest gap from a change to the spike it pairs with (default: 30)

Output Schema

NameRequiredDescriptionDefault
hoursYesHours the alert window reaches back.
noiseNo
burstsNo
portalNoThe portal the call ran against, in multi-portal mode.
changesNo
analysesYes
clustersNo
api_totalYes
truncatedYes
statisticsNo
total_alertsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv5.0.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds substantive behavior: the 5000-alert cap and truncation flag, per-section caps (five largest clusters, ten most severe ids, ten flap pairs, ten bursts, ten correlated pairs), the 1.0-0.5 confidence range, and precise definitions of flaps and repeats. The only gap is that it does not say how expensive the 'changes' audit-log read is beyond "reads the audit log once".

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The lead sentence is well front-loaded, but the body is a single enormous semicolon-chained run-on covering five analyses, which is hard to scan and forces the agent to parse clauses mid-sentence. Almost every clause carries information, yet the lack of paragraph or bullet structure costs readability.

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?

For a 10-parameter, five-mode analysis tool with an output schema, the description covers what each mode returns, how results are capped, and when truncation applies. Nothing an agent needs to invoke it correctly or interpret the sections is missing.

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?

Schema coverage is 100%, so the baseline is 3, but the description earns more by explaining what each analysis section computes and how correlation_window_minutes, min_alerts/min_devices/window_seconds, and the datasource/device filters actually affect output. It still leaves the exact semantics of 'analyses' omission and device_id-null behavior slightly implicit.

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?

Opens with a specific verb+resource ("Analyze one alert window") and immediately enumerates the concrete questions it answers (how many fired and when, which belong together, noise, bursts, preceding changes). It explicitly separates itself from the sibling get_alerts, which only lists/pages alerts, so an agent can choose between them without opening a 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?

Gives explicit when-to-use framing via the question list and names the alternative (get_alerts) with its distinct role. It also advises narrowing filters when a bounded list is incomplete, which tells the agent how to behave when results look truncated.

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

Deploy Server

Other Tools