Skip to main content
Glama

Predict the most likely runtime failure in a file

predict_failures
Read-only

Identify likely runtime failures in JavaScript and TypeScript by combining static analysis with an independent model review that returns line numbers and reasons.

Instructions

Combine static analysis with a second-opinion verdict from the signed-in Claude Code, Codex, or GitHub Copilot CLI, returning the most likely runtime failure with a line number and reason. status distinguishes actionable, uncertain, no-finding, and unavailable results. checked lists the bug categories the model reports having considered, so a clean file weighed against the whole catalogue is distinguishable from one where it stopped early; it is a self-report, and an empty list means no coverage was reported. Pass multi: true to get every finding the model can demonstrate, ranked, in a findings array instead of one verdict — experimental, and more findings per call is also more surface for false positives per call. actionable applies the measured score >= 0.7 precision gate. uncertain names a candidate the reviewer could not confirm: read its cited lines before dismissing it, and report it only if you confirm it yourself. This spawns another model and takes 5-15 seconds, so only call it when you specifically want an independent second opinion. If you are yourself reviewing the code, use analyze_file and read the source instead. Reviewing several files? Pass them all as files in one call rather than calling once per file: small files share bounded model calls to reduce repeated CLI context. Groups run concurrently, with individual verdicts and explicit failures.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoAbsolute path to a .js/.jsx/.ts/.tsx file
filesNoAbsolute paths to review in one call. Small files share bounded model calls, reducing repeated CLI context; large files run alone. Replies carry a `results` array in the order given. Supersedes `file`. At most 100; only JavaScript/TypeScript source is sent to the model.
modelNoModel override passed to the CLI
multiNoReturn every finding the model can demonstrate, ranked by score, rather than the single most likely one (default false). Experimental: the precision gate was measured on one-finding replies, so `actionable` is less well characterised here.
logFileNoOptional log file to fold into the combined score
verboseNoInclude the static metric counts and the full log breakdown (default false)
providerNoWhich CLI to ask (default: whichever is installed)
concurrencyNoModel calls in flight at once (default 4), each covering up to eight files. Lower it if the provider starts rate-limiting.
calleeContextNoAlso send bounded imported definitions and referenced type contracts so the model can check dependency behavior (default true). Turning this off reduces input tokens but removes that evidence.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.9.0
    • changedInput schema / properties / concurrency / description
      Previous value: -"Verdicts in flight at once for a batch (default 4). Lower it if the provider starts rate-limiting."New value: +"Model calls in flight at once (default 4), each covering up to eight files. Lower it if the provider starts rate-limiting."
    • changedInput schema / properties / files / description
      Previous value: -"Absolute paths to review in one call, run concurrently. Prefer this over one call per file when checking a change set: the verdicts are independent, so a batch bills the same as the same files one at a time but finishes in roughly the time of the slowest one. Replies carry a `results` array in the order given. Supersedes `file`."New value: +"Absolute paths to review in one call. Small files share bounded model calls, reducing repeated CLI context; large files run alone. Replies carry a `results` array in the order given. Supersedes `file`. At most 100; only JavaScript/TypeScript source is sent to the model."
    • addedInput schema / properties / files / maxItems
      Added value: +100
  2. First observedv0.8.2

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the readOnly/openWorld annotations by disclosing cost and latency (spawns another model, 5-15 seconds), rate-limit behavior (lower `concurrency` if the provider throttles), the precision-gate semantics of `actionable`, the experimental status of `multi`, and the false-positive surface tradeoff.

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?

Dense but front-loaded, leading with the core purpose before the status/checked/multi details and the usage/alt-tool guidance. Every sentence carries information, though the volume is high enough that some trimming is 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?

No output schema exists, yet the description explains return semantics (status categories, checked self-report, findings array, per-file verdicts with explicit failures), which is exactly what an agent needs for a 9-param, no-required-param tool.

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?

With 100% schema coverage the baseline is 3, but the description adds real meaning: `files` supersedes `file` with a results array, `multi` changes the return shape, `actionable` applies a measured >=0.7 gate, and `concurrency` defaults to 4 with rate-limit guidance. It does not fully cover `model`, `provider`, or `logFile`, so it is not a 5.

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 (predict) and resource (runtime failure in a file) and names the mechanism (static analysis plus a second-opinion CLI verdict). It clearly distinguishes itself from sibling analyze_file, which it explicitly routes simple self-review cases to.

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 ('only call it when you specifically want an independent second opinion'), when-not ('if you are yourself reviewing the code, use analyze_file and read the source instead'), and a batching alternative (pass all files in one call rather than calling per file).

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