Skip to main content
Glama
DustinTrap

kvm-pilot

by DustinTrap

wait_for_state

Read-only

Waits until a KVM-connected machine reaches a target boot or run phase, polling gates and vision. Returns phase and confidence, or timeout with last state.

Instructions

Wait (bounded) until the screen reaches a boot/run phase (read-only).

Server-side twin of CLI watch: polls cheap power/signal/boot-progress gates, then server-side vision, until phase (a classify_screen token; unknown tokens fail fast with the valid list) is observed. timeout is seconds, capped server-side at 300 — chain calls for longer waits. Success returns phase/confidence plus a frame_ref to pass to mouse as observed_frame_ref; a timeout returns reached=false with the last observed state (never a hang, never a raised error). With no server-side vision credentials only cheap-gate phases are waitable; others fail fast pointing at classify_screen polling. Holds the driver open up to timeout s. Details: doctrine topic 'interfaces'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hintNoOptional context for the vision backend, e.g. what you expect on screen ('Fedora installer, language page').
phaseYesTarget boot/run phase token as classify_screen names it (e.g. 'bios', 'bootloader', 'os_login'); an unknown token fails fast with the valid list.
profileNoProfile name from ~/.config/kvm-pilot/config.toml selecting which KVM/BMC (and its managed host) this call targets. Omit to use the server's default (KVM_PILOT_PROFILE).
timeoutNoSeconds to wait before returning reached=false; capped server-side at 300.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.0.0
    • addedInput schema / properties / hint / description
      Added value: +"Optional context for the vision backend, e.g. what you expect on screen ('Fedora installer, language page')."
    • addedInput schema / properties / phase / description
      Added value: +"Target boot/run phase token as classify_screen names it (e.g. 'bios', 'bootloader', 'os_login'); an unknown token fails fast with the valid list."
    • addedInput schema / properties / profile / description
      Added value: +"Profile name from ~/.config/kvm-pilot/config.toml selecting which KVM/BMC (and its managed host) this call targets. Omit to use the server's default (KVM_PILOT_PROFILE)."
    • addedInput schema / properties / timeout / description
      Added value: +"Seconds to wait before returning reached=false; capped server-side at 300."
    • addedInput schema / properties / timeout / exclusiveMinimum
      Added value: +0
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: bounded polling of cheap gates then vision, a 300s server-side cap with guidance to chain calls, timeout returns reached=false with last state and never hangs or raises, and it holds the driver open up to timeout. It also discloses the frame_ref handoff to mouse and the vision-credential dependency.

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 core behavior and dense with specifics; some content (the 300s cap, phase token naming) is echoed in the schema, but every sentence carries operational detail and none is filler.

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?

With no output schema, the description carries the return contract itself: phase/confidence plus frame_ref on success, reached=false plus last state on timeout. Combined with the documented failure modes and credential caveat, an agent has everything needed to call and interpret it.

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 adds real meaning: phase is a classify_screen token with fail-fast validation on unknown tokens, timeout is capped server-side at 300, and frame_ref feeds mouse as observed_frame_ref. The phase-token relationship to a sibling tool is genuinely beyond the schema.

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 and resource: wait (bounded) until the screen reaches a boot/run phase, and marks it read-only. It is clearly distinguishable from siblings like classify_screen and power_state because it describes active waiting on a phase token rather than a one-shot classification or a state query.

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

Usage Guidelines4/5

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

Explains when to use this versus alternatives, naming classify_screen polling for non-cheap-gate phases and the no-vision-credentials exclusion. It's clear context, though it doesn't give an explicit 'prefer X over Y when Z' rule beyond those cases.

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