Skip to main content
Glama

check_invariants

Audit the experiment store against loop invariants to flag orphaned trials, missing observations, unsealed runs, budget overruns, and stalled hypotheses; report-only.

Instructions

Audit the experiment store against the loop's invariants.

Returns {status: ok|violations, checks: [{name, ok, violations, detail}]}. Detection complement to write-time enforcement: orphaned running trials, completed trials lacking observations, unsealed executions, strace divergence, undigested input data, budget overruns, stuck hypotheses, stalled trials. Report-only — nothing is repaired or mutated. The run is logged to /logs/ (retention: [integrity] log_max_files).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
checksNo
serverNo
statusNo
triggerNo
log_fileNo
checked_atNo
duration_msNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.28

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantially: it declares 'Report-only — nothing is repaired or mutated,' specifies the log destination and retention policy, and gives the exact return shape. Gaps remain around permissions/auth needs and runtime cost, but the mutation-safety claim and side-effect disclosure are exactly what an agent needs.

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 and return shape in the first two sentences, then the detection list, then the report-only guarantee and log path. The enumeration of eight violation types is long but each item is a concrete detectable condition, so the length is earned rather than padding.

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

Completeness4/5

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

An output schema exists and the description still previews the return structure ({status, checks:[...]}), correctly avoiding redundant explanation of that schema's internals. It covers scope, safety, side effects, and logging, leaving only unstated items like authorization requirements and whether the check is read-only in the strict sense.

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?

The tool takes zero parameters, so the baseline of 4 applies; there is nothing for the description to clarify and it appropriately spends no words on argument syntax. It instead documents the return payload, which is the relevant detail for a no-arg tool.

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: 'Audit the experiment store against the loop's invariants.' No sibling tool performs invariant auditing, so the agent can pick it out immediately. It also enumerates the exact classes of problems detected (orphaned running trials, unsealed executions, budget overruns, etc.), which sharpens the purpose rather than restating the name.

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

Usage Guidelines3/5

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

'Detection complement to write-time enforcement' frames the tool as the read-side counterpart to enforcement, which implies when to reach for it. However, no sibling is named as an alternative and there is no explicit when/when-not guidance or prerequisite (e.g. run after run_trial/list_trials, or health-check cadence). Usage is implied rather than stated.

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