Skip to main content
Glama

qr_decode

Decode one or more QR/2D codes from an image, recover damaged or low-resolution codes, and return text, symbology, confidence, and payload risk flags.

Instructions

Decode one or more QR/2D codes from an image. Tries zxing-cpp (multiple binarizers), OpenCV, ZBar and preprocessing variants; if all fail it automatically falls back to qr_repair for glare/blur/low-resolution damage. Returns text, symbology, EC level, corner points, confidence and a parsed payload with URL risk flags.

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_decode"
  }
}

Input Schema

NameRequiredDescriptionDefault
imageYesLocal path, base64, data URI or http(s) URL
repairNoTry damaged-code recovery when normal decoding fails
formatsNoSymbologies to try, e.g. ["QRCode","DataMatrix"]
budget_msNoTime budget in milliseconds
max_variantsNoMax preprocessing variants
include_parseNoAttach semantic/risk analysis to each result

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.8/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 well: it discloses the multi-engine pipeline (zxing-cpp, OpenCV, ZBar), preprocessing variants, and the automatic repair fallback for glare/blur/low-resolution damage. It omits failure behavior (what happens when every engine fails) and any latency or size limits, which keeps it below a 5.

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?

Three sentences, front-loaded with the action, followed by mechanism and return shape — no filler. The engine name-dropping ('zxing-cpp (multiple binarizers), OpenCV, ZBar') is the one stretch that could be compressed without losing decision-relevant 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, read-only decode tool with a fully described schema and an output schema, the definition covers mechanism, damage handling, and output contents adequately. Missing are error semantics when no code is found and any input-size constraints, which would matter for an agent deciding whether to retry or escalate.

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 adds marginal meaning on top: the mention of preprocessing variants and the automatic repair fallback contextualizes the `max_variants` and `repair` parameters beyond their terse schema text. It says nothing about `budget_ms`, `formats`, or `include_parse`, so the gain is modest.

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+resource: 'Decode one or more QR/2D codes from an image', which cleanly separates it from generate/parse/repair-style siblings. It stops short of explicitly contrasting with qr_detect or qr_batch, so an agent must infer that this is the full decode-with-fallback path rather than detection-only or batch-driver.

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 description usefully tells the agent that repair is automatic ('falls back to qr_repair'), implicitly relieving it of manually chaining qr_repair for damaged codes. However, there is no explicit when-to-use guidance against qr_detect, qr_batch, or qr_parse, and no stated exclusion or precondition.

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