Skip to main content
Glama

generate_repair_prompt

Generates actionable self-correction instructions from an evidence packet by inspecting validation and claim-level issues, then formats a structured prompt for revising claims and citations.

Instructions

Generate actionable self-correction instructions for an LLM agent from an evidence packet request. Inspects validation and claim-level issues (missing sources, misquoted excerpts, unmatched numbers, polarity/negation mismatches, weak lexical support) and formats a structured markdown prompt for the agent to revise its claims and citations.

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": {
      "packet_json": "<packet_json>"
    },
    "name": "generate_repair_prompt"
  }
}

Input Schema

NameRequiredDescriptionDefault
packet_jsonYesEvidence packet request JSON to analyze and generate repair instructions for. Call get_schema('evidence_packet_request') for the full nested contract.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.26.0
    • addedInput schema / properties / packet_json / properties / derived_numbers
      Added value: +{
      +  "type": "boolean"
      +}
  2. Addedv1.7.1

TDQS

B3.3/5.0
Behavior2/5

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

No annotations exist, so the description carries the full behavioral burden. It discloses what gets inspected and that the output is a markdown prompt, but says nothing about whether the tool only reads the packet or persists anything, whether it re-validates or trusts the packet as given, whether it invokes a model (implying latency/variability), or what happens with a packet that has no issues.

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?

Two sentences, front-loaded with the core action and then the supporting issue taxonomy. The long parenthetical list is dense but each item is informative; nothing is redundant, though the opening could be trimmed slightly for a tighter lead.

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 tool with one deeply nested input object and no output schema, the description does what is needed: it names the input source, summarizes the issue types being surfaced, and characterizes the return as a structured markdown prompt. It stops short of error/edge-case behavior and the read-only nature of the operation, which keeps it from a 5.

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% and the single nested parameter is fully documented, including the pointer to get_schema('evidence_packet_request'). The description adds only that the packet is what will be 'analyze[d]' to produce instructions, which is a marginal restatement of the schema text, so the baseline 3 applies.

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?

The description gives a specific verb and a precise artifact: 'Generate actionable self-correction instructions for an LLM agent' and 'formats a structured markdown prompt.' The enumerated issue classes (missing sources, misquoted excerpts, polarity/negation mismatches) make it clearly a repair-prompt generator rather than a validator, though it never names a sibling like validate_evidence or verify_claims to draw the boundary 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?

Usage is only implied: the phrase 'from an evidence packet request' and the issue-focused framing suggest it is called after validation exposes problems, but the description never states when to use this versus validate_evidence, verify_claims, or audit_claims. No exclusions or prerequisites are given, leaving the agent to infer the workflow position.

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