Skip to main content
Glama

repair_reply

Fix a seat's unreadable reply in a paused run by correcting JSON punctuation, restoring flagged rows, or fixing objection IDs, so the run resumes.

Instructions

For a run paused for a REPAIR (external_prompt shows repair with its kind): a seat's paid reply could not be read, and THC asks for it to be repaired, never rewritten. Give exactly one of: text, the same reply with only its JSON punctuation fixed (kind near_json; THC takes it only if every word is the same, in the same order); restore_rows, the numbers of the rows the pause flagged (the rows whose words did not fit the criterion at their position), whose criterion text THC sets to the exact text of the criterion at that row's position (kind table_rows; nothing else in the reply changes, a row the seat did not write is never added, and no criterion gets two rows); ids, pairs { from, to } from the request, each an objection id the seat wrote one character off and the id it was shown (kind id_slip; nothing else in the reply changes); or decline: true, which puts the original reply back unchanged, so the stage is read as it would be without a repair. THC writes the repaired reply, keeps the original in the run folder, and resumes the run once no stage is left waiting. A stage is repaired once.

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": {
      "run": "<run>",
      "stage": "<stage>"
    },
    "name": "repair_reply"
  }
}

Input Schema

NameRequiredDescriptionDefault
idsNopairs { from, to } as the request names them (kind id_slip only)
runYes
textNothe seat's reply with its JSON fixed and no word changed (kind near_json only)
stageYes
declineNotrue to put the original reply back unchanged
restore_rowsNothe row numbers the pause flagged, from 1 (kind table_rows only)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.4

TDQS

A4.5/5.0
Behavior5/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 so: it says THC writes the repaired reply, preserves the original in the run folder, resumes the run once no stage is waiting, and that a stage is repaired only once. It also discloses the acceptance rules that gate each mode (all words identical and in order; no row added that the seat did not write; no criterion gets two rows; nothing else in the reply changes).

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?

Content is front-loaded with the trigger condition and then enumerates mutually exclusive payload options, so the shape is easy to scan. The prose is a long run-on with nested parentheticals that could be split into bullets without losing information.

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?

For a six-parameter mutation with no annotations and no output schema, the description covers preconditions, per-mode constraints, side effects on run state, and idempotency. It never states what the call returns or what happens when the submitted repair fails validation, leaving a small gap for an unannotated mutation.

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 67%, and the description meaningfully extends the rest: it defines text as punctuation-only edits, restore_rows as the flagged row numbers with 1-based positions and exact criterion text substitution, ids as {from,to} objection-id slips, and decline as restoring the original unchanged. The two required parameters, run and stage, are given no semantic explanation in either text or schema, which keeps this below 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?

The description names a specific verb (repair) and resource (a seat's unreadable paid reply in a run paused for REPAIR shown by external_prompt), and explicitly contrasts the operation with rewriting ("repaired, never rewritten"). An agent can tell this apart from submit_stage/resume_run without opening any schema.

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?

It states the precondition precisely (run paused for a REPAIR, kind visible in external_prompt) and maps each kind to exactly one acceptable payload: near_json→text, table_rows→restore_rows, id_slip→ids, plus decline as the give-up path. What's missing is an explicit when-not or a named sibling to use instead when no repair is pending.

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