Skip to main content
Glama

Hol State At

hol_state_at

Replays a theorem's tactics up to a given file position and returns the resulting HOL4 proof goals. Use it to inspect what remains to be proved at any step in a Script file.

Instructions

Get proof state at a file position.

Replays tactics from theorem start up to (but not including) the tactic at the given position, then shows current goals. Auto-enters theorem if needed.

By default only the top goal is shown (with total count). Set all_goals=True to see every goal on the stack.

If replay fails before reaching the requested position, the default behavior is to refuse to show goals (they would be from the wrong proof state). Set show_partial=True to see the best-effort goals anyway.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "line": "<line>"
    },
    "name": "hol_state_at"
  }
}

Input Schema

NameRequiredDescriptionDefault
colNo1-indexed column number (default 1)
fileNoPath to .sml file (auto-inits cursor if no cursor exists)
lineYes1-indexed line number (position in the proof)
sessionNoSession name (default: "default")default
workdirNoWorking directory for HOL (used with file)
all_goalsNoIf True, show all goals; otherwise only the top goal (default: False)
max_outputNoMax bytes of output (default 1000)
show_partialNoIf True, show best-effort goals even when replay fails before reaching the requested position (default: False)
context_afterNoOn PROOF BROKEN, number of source lines after the failure to include in the step plan context (default: 0, off). Both default to 0 (only failing step shown); pass e.g. 3 for surrounding context.
context_beforeNoOn PROOF BROKEN, number of source lines before the failure to include in the step plan context (default: 0, off). The failing step is always shown; this adds steps whose source positions fall within the line range.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations at all, the description carries the full burden and does substantial work: it discloses the replay-from-theorem-start behavior, auto-entering the theorem, the default top-goal-only rendering with a total count, and the deliberate refusal to show goals when replay fails before the target position. That last detail is exactly the kind of non-obvious behavior an agent needs. It stops short of stating permission/state requirements or that output can be truncated by max_output.

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?

Four short, front-loaded paragraphs that each address a distinct concern — core behavior, default goal rendering, failure handling — with no filler. Slightly repetitive in re-explaining the partial-goal case in both prose paragraphs, but the structure is easy to scan.

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?

An output schema exists so return values need not be explained, and the description covers the genuinely uncertain parts of a 10-parameter tool: what gets replayed, what is shown by default, and what happens on premature replay failure. The remaining parameters are fully documented in the schema, so an agent has enough to invoke this correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3, and the description largely restates the all_goals and show_partial semantics already documented in the schema rather than adding new meaning. It says nothing about line/col indexing conventions, the file/workdir pairing, or session selection, all of which live only in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Get proof state at a file position') and elaborates with the mechanism (replay tactics from theorem start, then show current goals). This distinguishes it from file-status or proof-check siblings by describing a position-based query, though it never names or contrasts those siblings explicitly.

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?

Gives conditional guidance for the two behavioral flags (all_goals for the whole stack, show_partial when replay fails early), which is real usage context. However, it never says when to prefer this tool over hol_check_proof or hol_file_status, nor what prerequisites like an active session/cursor are required beyond the brief 'auto-enters theorem' note.

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