API & MCP

Everything a person can do on Room Layout Optimizer, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Room Layout Optimizer

Give the room size, doors, windows and your furniture with the clearance each piece needs. A deterministic grid search places everything inside the room without overlaps, keeps door swings and a walkway clear, prefers walls and windows where requested and returns coordinates plus a text floor plan.

Inputs of Room Layout Optimizer
FieldTypeDefaultDescription
roomWidth (required)number—Room width (west → east)
roomDepth (required)number—Room depth (north → south)
gridCminteger10Grid size. Positions snap to this grid; furniture sizes are rounded up to it.
walkwayCminteger60Minimum walkway width
openingstable—Doors and windows. Offset is measured along the wall from its west end (north/south walls) or north end (east/west walls).
furniture (required)table—Furniture. Width = side along its back; depth = front to back. Clearance = free space needed in front (to open drawers, get into bed, sit).

Example request

Bedroom with desk by the window

curl -X POST https://roomlayoutoptimizer.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"roomWidth":400,"roomDepth":350,"gridCm":10,"walkwayCm":60,"openings":[{"kind":"door","wall":"south","offset":20,"width":80},{"kind":"window","wall":"north","offset":150,"width":120}],"furniture":[{"name":"Double bed","width":160,"depth":200,"needsWall":true,"clearanceFront":60,"nearWindow":false},{"name":"Wardrobe","width":150,"depth":60,"needsWall":true,"clearanceFront":70,"nearWindow":false},{"name":"Desk","width":120,"depth":60,"needsWall":true,"clearanceFront":70,"nearWindow":true}]}'

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)

{
  "mcpServers": {
    "room-layout-optimizer": { "type": "http", "url": "https://roomlayoutoptimizer.usefulweb.site/mcp" }
  }
}