API & MCP

Everything a person can do on N-back Sequence Generator, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

  • POST https://mindquarrynbacksequence.usefulweb.app/api/v1/calculate – run N-back Sequence Generator
  • GET https://mindquarrynbacksequence.usefulweb.app/api/v1/tool – inputs, output schema, examples
  • OpenAPI 3.1: /openapi.json · /openapi.yaml
  • Errors: application/problem+json; 422 includes per-field errors.

N-back Sequence Generator

Builds the item list for an n-back task: positions on a 3 × 3 grid, digits or shapes, with an exact number of targets (the item equals the one N steps back) and optional lures (equal to the item N−1 or N+1 back, a common source of false alarms). Every item is checked so that no accidental targets or lures sneak in. The result is the answer key as a table and CSV — the same generator Mindquarry uses for its n-back exercise.

Inputs of N-back Sequence Generator
FieldTypeDefaultDescription
ninteger2N (steps back)
lengthinteger30Number of items
targetPercentnumber30Targets. Share of the items after the first N that are targets.
lurePercentnumber10Lures. Items equal to the one N−1 or N+1 back (but not N back). With N = 1 only N+1 lures exist.
stimuliselect (positions, digits, shapes)"positions"Stimuli
seedtext"mindquarry"Seed (same seed = same sequence)

Example request

2-back, 30 positions, 30 % targets, 10 % lures

curl -X POST https://mindquarrynbacksequence.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"n":2,"length":30,"targetPercent":30,"lurePercent":10,"stimuli":"positions"}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

  • Streamable HTTP endpoint: https://mindquarrynbacksequence.usefulweb.app/mcp – protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake).
  • Tools: mindquarry_n_back_sequence
  • Local stdio connector: node src/mcp-stdio.ts --tool=mindquarry-n-back-sequence
{
  "mcpServers": {
    "mindquarry-n-back-sequence": { "type": "http", "url": "https://mindquarrynbacksequence.usefulweb.app/mcp" }
  }
}