API & MCP

Everything a person can do on Autotile Generator (blob 47 and Wang 16 rules), a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Autotile Generator (blob 47 and Wang 16 rules)

Draw terrain as # and . rows and choose the 47-tile blob set or the 16-tile Wang edge or corner set. The rule engine picks each tile variant from its neighbours and returns tile indices, a Tiled TMX map, a rendered PNG and merged collision rectangles.

Inputs of Autotile Generator (blob 47 and Wang 16 rules)
FieldTypeDefaultDescription
terraintextarea"....................\n..######......###...\n.########....#####..\n.###..###....Terrain rows (# = terrain, . = empty)
modeselect (blob47, edge16, corner16)"blob47"Rule set
tileSizeinteger16Tile size (px)
outsideselect (empty, terrain)"empty"Cells beyond the grid
orientationselect (orthogonal, isometric)"orthogonal"Map orientation
encodingselect (csv, base64, base64-zlib, base64-gzip)"csv"TMX layer encoding
tilesetfile—Own tileset PNG (optional; tiles in slot order unless mapped)
mappingtext—Slot → tile mapping (optional; 47 or 16 numbers, −1 = missing)

Example request

Two islands with a lake (blob 47)

curl -X POST https://fliplineautotilegenerator.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"terrain":"....................\n..######......###...\n.########....#####..\n.###..###....##.##..\n.########.....###...\n..######............\n....##.....#######..\n....##.....#######..\n..........##.....#..\n.#####.....#######..\n.#####..............\n....................","mode":"blob47","tileSize":16,"outside":"empty","orientation":"orthogonal","encoding":"csv","mapping":""}'

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": {
    "flipline-autotile-generator": { "type": "http", "url": "https://fliplineautotilegenerator.usefulweb.app/mcp" }
  }
}