Skip to main content
Glama

qr_repair

Recover text and a clean image from damaged QR codes caused by glare, blur, low resolution, or partial occlusion; also verifies a suspected payload hint with a score. Supports versions 1–4.

Instructions

Recover a damaged QR code (glare, blur, low resolution, partial occlusion). Fits the module grid from the finder patterns, decodes format information via BCH, then applies Reed-Solomon erasure/Chase correction. Returns the recovered text, a verification score and a rebuilt clean QR image. Supports QR versions 1-4; larger versions are reported as unsupported. hint= accepts a suspected full text to verify against the damaged modules.

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": {
      "image": "<image>"
    },
    "name": "qr_repair"
  }
}

Input Schema

NameRequiredDescriptionDefault
ecNoForce error-correction level
hintNoSuspected complete payload; verified by regenerating the QR
maskNoForce mask 0-7
imageYesLocal path, base64, data URI or http(s) URL
versionNoForce QR version 1-4, or auto-detect
save_cleanNoWrite the rebuilt QR PNG to the output directory
max_attemptsNoCap on Reed-Solomon attempts

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden; it does well on the pipeline (finder patterns, BCH format decode, Reed-Solomon/Chase correction), the version ceiling, and the returned verification score. It omits that the tool writes a PNG file by default (save_clean=true) and says nothing about cost or latency implications of the 700-attempt correction budget, which matters for a tool with file side effects.

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?

Purpose is front-loaded in the first sentence, followed by mechanism, return values, limits, and the hint note in a logical order. The BCH/Reed-Solomon detail is more internals than an agent needs, but it does convey robustness and no sentence is redundant.

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 seven-parameter tool with an output schema, the description covers purpose, scope limits, return content, and one non-obvious parameter. The remaining gap is routing guidance against the sibling decoders and the default file-write side effect, both of which an agent would want before calling.

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 100%, so the baseline is 3; the description earns an extra point by explaining hint's semantics ('suspected full text to verify against the damaged modules'), which adds operational meaning beyond the schema's one-line note. The other six parameters (ec, mask, version, save_clean, max_attempts) are left entirely to 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?

The description opens with a specific verb and resource ('Recover a damaged QR code') and immediately bounds the scope with concrete failure modes (glare, blur, low resolution, occlusion) plus a hard version limit (1-4). That makes it clearly distinct from a plain decoder like qr_decode, though it never names the sibling 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?

The listed damage conditions imply when this tool is the right choice over a standard decode, and the hint parameter's use case is spelled out. However, it never states when NOT to use it (e.g. clean images should go to a decoder) or what to do when the version exceeds 4 beyond the error being reported.

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