From a text prompt to a stud-checked LEGO model: research, design, look, fix
On Mister Blocks you can type "Breaking Bad RV" or "a capybara in a hot spring" and, a few minutes later, get a LEGO model with step-by-step instructions where every stud is checked. The first version was one big prompt: "design this in bricks". It worked about as well as you'd expect. This post is about the pipeline that replaced it: research, plan, design, check the shape, look at it, fix every stud, and how it shows its progress so a long wait doesn't feel like a hang. Breaking Bad RV (Fleetwood Bounder): 123 pieces, 13 steps. More TV show builds. 1. Research first, with a search budget The planner gets web search, capped at three searches. It decides whether the idea is buildable (it declines hateful symbols, sexual content and real-world gore), then writes a short plan: a name (which becomes the page address, /builds/-lego-build) a piece target: vehicles 70–160, characters and creatures 120–250, buildings and scenes 100–220 a size in studs a brief of 8–14 steps, wi
On Mister Blocks you can type "Breaking Bad RV" or "a capybara in a hot spring" and, a few minutes later, get a LEGO model with step-by-step instructions where every stud is checked.
The first version was one big prompt: "design this in bricks". It worked about as well as you'd expect. This post is about the pipeline that replaced it: research, plan, design, check the shape, look at it, fix every stud, and how it shows its progress so a long wait doesn't feel like a hang.

Breaking Bad RV (Fleetwood Bounder): 123 pieces, 13 steps. More TV show builds.
1. Research first, with a search budget
The planner gets web search, capped at three searches. It decides whether the idea is buildable (it declines hateful symbols, sexual content and real-world gore), then writes a short plan:
- a name (which becomes the page address,
/builds/)-lego-build - a piece target: vehicles 70–160, characters and creatures 120–250, buildings and scenes 100–220
- a size in studs
- a brief of 8–14 steps, with the colours of every visible part
The colours rule came from a real failure. Asked for a Waymo Ojai, the pipeline drew it white with a glass band all the way round. That's the older Waymo, a Jaguar. The planner now has to take colours from the research "for the exact version asked for, never from an older or related model of the same brand", and name the colour of the body, the face, the glass and the roof.

The Waymo Ojai, after the fix: pale blue with a black face. 112 pieces. More LEGO cars.
The same incident added a design rule: the windscreen part is a low, raked car windscreen, but vans, buses and robotaxis have an upright one, built as a wall of clear bricks, with solid pillars holding the roof up and something inside (seats, a dashboard) so the glass doesn't look empty.
2. One line per piece
The designer writes the model as plain text, one line per piece:
ID KIND X Y Z LX LZ H STEP COLOR DIR ON
Nine kinds of part (plate, brick, slope, axle plate, wheel, fender, windscreen, steering wheel, chain) on a stud grid. It's wrapped in a strict JSON schema, so the response always parses, and the long fixed system prompt is cached between calls.
Plain lines beat nested JSON objects here for one practical reason: you can count them while they stream. More on that below.
3. Shape check: did it build the right size?
The most common failure wasn't broken studs. It was a model that was technically fine and far too small. The comment in the code still says it: "a Waymo robotaxi came out as a low 62-piece box".
So before anything else, the design is compared with the plan. If it has fewer than 75% of the target pieces, a footprint under 75% of the planned size, or a height under 75% of the planned height, it goes back with exactly those numbers. Up to two rounds.
4. Look review: draw it in ASCII and ask
Then the model looks at its own work. The design is drawn as ASCII side, front and top views: one letter per colour, one character per stud. Those drawings go back with the research brief and one question: compare it with the real thing, the way a kid holding the real thing would.
It's crude, but it catches the things a stud checker can't: a car whose face is the wrong colour, a character with no arms, a stadium with no stands.

Dodger Stadium: 1,394 pieces, 118 steps. More sports builds and LEGO buildings.
5. Fix every stud
Finally, the stud checker: unknown sizes, colours missing from the palette, empty steps, pieces held by nothing, overlaps, wheels that can't turn. Up to 40 problems go back per round, and the model answers with a patch (remove these ids, add or replace these lines), not a whole new design. Up to six rounds.
If anything is still wrong at the end, the build is saved anyway, and the chat says so plainly and offers "say 'fix it'" instead of pretending it's perfect.
Progress that means something
A Vercel function can run for 800 seconds, so the pipeline gets 11 minutes and leaves the rest to save. The request that starts it answers immediately; the work continues in the background (waitUntil) and writes its progress onto the build itself. The page polls a tiny endpoint every 2 seconds.
The progress bar is real:
- Planning (12–35%): the model's thinking is streamed as a summary, and the page shows its last finished sentence after "Planning:". Never half a thought.
- Placing (35–92%): because every piece is one line, the server counts lines as they stream and shows "Placing piece 84 of about 120…".
- Checking: "Checking every stud: fixing 6 problems (round 2)…".
Stages that won't fit are skipped: a shape or look round only starts if more than 5 minutes are left, a fix round if more than 2.5. And if a job stops reporting for 150 seconds, the page says the designer stopped and offers a retry, instead of spinning forever.

The Knight (Hollow Knight): 74 pieces, 9 steps. More video game builds.
Then you can talk to it
Every build has a chat. "Make the roof red" or "add a trailer" sends the current design, the remaining problems and the last few messages, and asks for a patch, which goes through the same checks. Your first message makes your own copy, so nobody else's build changes.
Try it with your own idea at misterblocks.com, see what others asked for on custom LEGO instructions, or browse easy builds and buildings.
Unofficial fan builds. LEGO® is a trademark of the LEGO Group, which does not sponsor or endorse this site. Characters and brands belong to their owners.
