3 Real Bugs We Caught When an AI Agent Compiled a 2,849 sq ft House Plan Through Our MCP Server A developer running a hosted Streamable HTTP MCP server for floor-plan compilation reported three edge cases exposed after a real 2,849 sq ft, 16-room residential plan was submitted by an AI agent, causing the SVG preview page to return a 500 error. The failures traced to LLM-generated JSON using aliases like type/name/rotation instead of the schema's kind/label/rotationDeg, which crashed a symbol renderer on an undefined kind, and to unit-conversion drift where 2.333 ft became 27.996 inches, tripping a strict 28-inch interior-door check on eight standard doors. The fix was a single normalizer coercing aliases before geometry, SVG, DXF, PDF or Three.js processing, plus filtering unpositioned notes and documenting units in the tool's inputSchema. Over the past 48 hours our hosted Streamable HTTP MCP server https://www.plumbdraft.com/mcp crossed 2,500 tool calls. Most early traffic to a new MCP endpoint is registry health checks and small 1-room test payloads. Then a real residential floor plan hit the server: 2,849 sq ft, 16 rooms, 26 doors, dozens of walls, and full kitchen and bath fixtures. The compilation succeeded, the agent returned our live 2D/3D preview URL to the user, and the user clicked the link four times. And our preview page returned a 500 Internal Error . Debugging that single real-world payload exposed three subtle edge cases that unit tests against clean internal fixtures never caught. If you are building an MCP server that turns LLM-generated JSON into deterministic files CAD, PDF, SVG, diagrams, or spreadsheets , these three patterns will probably bite you too. Our internal TypeScript model expects furniture fixtures with explicit fields: interface FurnitureItem { id: string; kind: string; // e.g. "kitchen island", "bed queen" category: string; label: string; x: number; y: number; widthIn: number; depthIn: number; rotationDeg: number; } Our MCP tools/list schema originally described the plan argument as a generic object "FloorPlan JSON object containing walls, openings, rooms, furniture." . Without explicit field names in the parameter description, the calling model did something totally reasonable: type: "island" , name: "Kitchen Island" , and rotation: 90 instead of kind , label , and rotationDeg . { type: "door", style: "overhead" } and { type: "opening" } instead of door double and cased opening . notes: "Verify structural headers", "Check local setback" as plain strings without x or y blueprint leader coordinates. The planar room-detection engine did not care about furniture.kind , so compile floorplan geometry succeeded cleanly and stored the plan in D1. The crash happened downstream when the user opened the rendered SVG preview page, where our architectural symbol renderer ran: if item.kind.startsWith 'bed ' { ... } item.kind was undefined . Boom: unhandled TypeError and a 500 page. tools/list : 1 ft = 12 in directly inside the tool's inputSchema description so agents emit canonical JSON on the first call. compileFloorPlan , we now coerce incoming LLM aliases once before geometry, SVG, DXF, PDF, or Three.js ever see the object: js const rawKind = typeof raw.kind === 'string' && raw.kind.trim ? raw.kind.trim : typeof raw.type === 'string' && raw.type.trim ? raw.type.trim : 'custom'; const label = typeof raw.label === 'string' && raw.label.trim ? raw.label.trim : typeof raw.name === 'string' && raw.name.trim ? raw.name.trim : rawKind; const rotationDeg = typeof raw.rotationDeg === 'number' && Number.isFinite raw.rotationDeg ? raw.rotationDeg : typeof raw.rotation === 'number' && Number.isFinite raw.rotation ? raw.rotation : 0; Unpositioned string notes without finite x and y coordinates are filtered out of spatial leader callouts instead of producing NaN in SVG transforms or DXF TEXT entities. Every MCP tool compile , validate , takeoff , dxf , pdf now runs through this single normalizer. 27.996" vs 28" In US residential architecture, 2'-4" 28" and 2'-0" 24" are completely standard interior doors for closets, pantries, laundry rooms, and secondary baths. The agent built the house plan in decimal feet and converted to inches: 2.333 ft 12 in/ft = 27.996 in Our clearance engine had a strict interior door check: if op.widthIn < 28 { addIssue { severity: 'warning', code: 'DOOR WIDTH', detail: Interior door ${op.tag} is ${op.widthIn}" wide... } ; } Because 27.996 < 28 by four thousandths of an inch, eight perfectly normal 2'-4" doors each triggered a -14 point warning. Worse, the error message printed "27.996\"" verbatim, and the overall spatial audit score collapsed to 0/100 even though all 22 hinged door swings were completely unobstructed. We added quarter-inch snapping Math.round n 4 / 4 before running clearance comparisons or formatting labels, lowered the hard warning threshold for interior doors to < 24" keeping 24" to 29.75" as an advisory info note for closets and secondary baths , capped advisory info score deductions, and emitted summary pass entries when all hinged door swings are clear and habitable doors meet = 30" . Re-running the exact same 2,849 sq ft plan immediately moved the audit from 0/100 9 warnings to 84/100 0 warnings, 2 summary passes with crisp 28" and 24" measurements. One underrated UX detail of dual-use SaaS apps built for both humans and AI agents is the handoff from chat back to a browser UI. Our MCP server stages every compiled plan as a shareable 2D/3D preview page /p/