Skip to main content
Glama
VMware-Monitor

VMware-Monitor

scan_host_logs

Read-onlyIdempotent

Reads recent ESXi host syslog entries and returns lines matching error, warning, or critical patterns, so you can find why a host is in trouble when vCenter events do not explain it.

Instructions

[READ] Scan recent ESXi host syslog lines for error/warning patterns.

Reads the last lines entries of selected logs (default hostd/vmkernel/vpxa) via the diagnostic system and returns only the lines matching known trouble patterns (error, fail, critical, panic, lost access, timeout, …). Severity follows the level ESXi wrote on the line (Cr/Er/Wa/In…, raw token in log_level); a critical keyword still wins. By default findings are grouped by pattern — each item has count, hosts, first_seen/last_seen (log time), severity, source (host_log:<key>), pattern and one sample; lines_matched is the ungrouped count. group=false returns one row per line (severity, source, message, time, observed_at, entity, log_level, log_time). time is the log timestamp (null when absent); observed_at is when this scan read the line. Returns the list envelope {items, returned, limit, total, truncated, hint}. total is null on purpose — this is "errors within the scanned window", not all errors ever. logs_unavailable lists every host/log that could NOT be read, with the reason (e.g. the account lacks Global.Diagnostics); empty items means nothing matched only when logs_unavailable is empty too.

Use this when get_events or investigate_host show a host in trouble but not why: vCenter events and ESXi syslog are different sources. Filter with host_name to keep the scan fast on large clusters; a name that matches no host returns an error (get the exact name from list_esxi_hosts), not an empty result. Every call reads the last lines lines afresh.

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": "scan_host_logs"
  }
}

Input Schema

NameRequiredDescriptionDefault
groupNoGroup repeated lines by pattern (default true). One call on a lab returned 353 lines, 195 of them one statistics-provider message.
linesNoHow many recent lines per log to scan (default 500, at least 1).
targetNovCenter/ESXi target from config (default if omitted).
log_keysNo1–16 distinct diagnostic keys, e.g. ["hostd", "vobd"]. Omit for defaults. Availability depends on the target; unsupported keys appear in logs_unavailable. File paths are not accepted.
host_nameNoFilter to a single host by exact name (None = all hosts).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.6.2
    • addedInput schema / properties / log_keys
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "1–16 distinct diagnostic keys, e.g. [\"hostd\", \"vobd\"]. Omit for defaults. Availability depends on the target; unsupported keys appear in logs_unavailable. File paths are not accepted.",
      +  "title": "Log Keys"
      +}
  2. Addedv2.2.0

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare readOnly/destructive/idempotent/openWorld, so the safety profile is covered. The description nonetheless adds substantial behavior: default log keys, severity derivation from ESXi's own level token, the null-on-purpose total, and the logs_unavailable semantics that prevent misreading an empty result. The note that "every call reads the last lines lines afresh" is in mild tension with idempotentHint (results can differ between calls) but describes freshness rather than side effects, so it is clarification, not contradiction.

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 verb and scope, then structured around return semantics before usage guidance. It is dense and long, with some parenthetical sprawl and a restatement of the group flag already covered by the schema, but nearly every sentence carries operational information.

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?

There is no output schema, and the description fully compensates: it documents the list envelope fields, what total deliberately does not mean, the per-item structure in both grouped and ungrouped modes, and the logs_unavailable list. An agent has everything needed to call it and to interpret a zero-result response correctly.

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; the description earns above that by stating the default log_keys (hostd/vmkernel/vpxa), the row shape returned when group=false, and the error behavior for a non-matching host_name — meanings the schema does not carry.

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?

"[READ] Scan recent ESXi host syslog lines for error/warning patterns" gives a specific verb plus resource and scope, and the body explicitly separates it from get_events/investigate_host as a different data source. An agent can distinguish it from every listed sibling 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?

Names the exact triggering situation (get_events or investigate_host show a host in trouble but not why) and the reason the alternative is insufficient. It also gives a performance guideline (filter with host_name on large clusters), a recovery path when host_name matches nothing (get the exact name from list_esxi_hosts), and warns that every call re-reads the window.

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