Skip to main content
Glama

WAI Quantum job service

Decode a syndrome or a circuit's detectors

qec_decode
Read-onlyIdempotent

Decode with the engine's decoders. At code capacity, give code and a syndrome (the violated checks) or an error (the flipped qubits: its syndrome is taken and its residual judged, logical or not): matching (exact) and union_find for codes whose qubits sit in at most two checks; color for colour codes (restriction to matching on the three restricted lattices, lifted at each colour, completed below half the distance by an exact search); relay_bp for any code (it can stall on a degenerate error of a topological code, and then says it did not converge); search for the lightest error with the syndrome up to max_weight. At circuit level, give memory ({distance, rounds, p}: the rotated surface-code memory experiment), circuit (the circuit text: tags, Pauli-target observables and coordinates read) or model (detector error model text, decompositions with ^ read), with the fired detectors (the prediction: which observables flipped) or shots (sampled and decoded: the failure rate and its standard error): matching (exact), correlated (exact matching twice through the model's decomposed faults, the second answer kept only when the model's mechanisms explain it more cheaply), union_find, bp_osd, or window (a sliding window: window {commit, buffer} rounds; every edge set below half the distance is corrected once the buffer is at least (d + 1)/2). Sealed with the service's key.

Input Schema

NameRequiredDescriptionDefault
codeNoA code by name: surface:D (the rotated surface code, odd D from 3 to 15), toric:L (2 to 12), steane, color:D (the triangular 6.6.6 colour code, odd D from 3 to 15), bb:72, bb:90, bb:108, bb:144 (or gross) or bb:288 (bivariate-bicycle codes); or {"family", "distance" | "size" | "n"}.
seedNoThe sampling seed (default 1).
errorNoThe flipped qubits, by index.
modelNoA detector error model in its text.
shotsNoSample this many shots of the circuit and decode each.
memoryNoThe rotated surface-code memory experiment at circuit level.
windowNowindow: rounds each window commits and the rounds after them it sees.
circuitNoA noisy Clifford circuit in the circuit text.
decoderNoThe decoder (default: matching, or color for a colour code, relay_bp for a bivariate-bicycle code).
syndromeNoThe violated checks, by index.
detectorsNoThe detectors that fired.
max_weightNosearch: the heaviest error to try.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already cover read-only/idempotent safety, but the description adds substantial behavioral context: relay_bp can stall on degenerate topological errors and reports non-convergence, correlated keeps the second answer only when mechanisms explain it, window requires buffer ≥ (d+1)/2, and outputs are 'sealed'. This is rich beyond the annotations.

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?

Front-loaded with the core action and dense but purposeful — nearly every clause conveys a decoder constraint or input expectation. However, the single-paragraph format with semicolon chains is harder to scan than it could be, and 'Sealed with the service's key' is cryptic.

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?

Given 12 parameters, nested objects, and an output schema, the description covers both modes, decoder choices, constraints, and defaults thoroughly. Minor omissions like seed and budget_ns are adequately handled by the 100%-covered schema.

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?

With 100% schema coverage the baseline is 3, but the description goes further by explaining parameter interplay: give code with syndrome or error, memory is {distance, rounds, p}, circuit/model texts are parsed (tags, Pauli-target observables, ^ decompositions), window is {commit, buffer} rounds, and max_weight is for the search decoder.

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?

States a specific verb (decode) and resource (syndrome, circuit detectors) and outlines the two operating modes (code capacity vs circuit level) with concrete inputs. It is easy to distinguish from qec_code or qec_threshold without opening another 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?

Provides detailed mapping of which decoder fits which code/input (e.g., union_find for qubits in ≤ two checks, color for colour codes, relay_bp for any code with stall caveat) and describes the required input combinations for each level. No explicit 'when not to use' or sibling comparison, but the internal guidance is strong.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources