{
  "openapi": "3.1.1",
  "info": {
    "title": "Poster Tiler (Big Picture on Many Pages) API",
    "version": "1.0.0",
    "summary": "Print a big poster on ordinary paper: tiles with overlap, crop marks and an assembly map.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://printshoppostertiler.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Print a big poster on ordinary paper: tiles with overlap, crop marks and an assembly map.",
        "description": "Enlarge a JPEG or PNG to a poster of any width and split it over A4, Letter or other sheets with overlap, trim lines, crop marks, alignment crosses and tile names, plus a cover page with the assembly map, the effective resolution and a test square. Without an image you get the tiling plan.\n\nMethodology:\n- Printable area = paper − 2 × margin; each next sheet starts one step = printable − overlap further, so neighbouring sheets share the overlap strip. Sheets across = ceil((poster − overlap) / step); with “fewest sheets” both orientations are tried.\n- The image is embedded once (JPEG unchanged, PNG losslessly compressed) and every sheet shows its part through a clipping rectangle, so the PDF stays small and keeps the full resolution.\n- Effective resolution = image pixels ÷ poster inches (Lumina’s print planner gives the matching print size table). Below about 100 pixels per inch prints look soft up close.\n\nPrinters differ slightly in scale and margins: print the cover page first and measure the 50 mm test square. Interlaced PNG and CMYK JPEG files are not supported.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "printshop_poster_tiler",
        "x-owner-app": "printshop",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrintshopPosterTilerInput"
              },
              "examples": {
                "example1": {
                  "summary": "60 cm poster plan for a 4000 × 3000 photo",
                  "value": {
                    "imageWidth": 4000,
                    "imageHeight": 3000,
                    "width": 600
                  }
                },
                "example2": {
                  "summary": "One-metre portrait poster on Letter paper",
                  "value": {
                    "imageWidth": 3000,
                    "imageHeight": 4500,
                    "width": 1000,
                    "paper": "letter",
                    "overlap": 15
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintshopPosterTilerResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "PrintshopPosterTilerInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "image": {
            "title": "Image (JPEG or PNG, optional)",
            "type": "object",
            "description": "Upload as {filename, contentType?, contentBase64}. Max 24414 KiB. Accepts image/jpeg,image/png.",
            "additionalProperties": false,
            "required": [
              "filename",
              "contentBase64"
            ],
            "properties": {
              "filename": {
                "type": "string"
              },
              "contentType": {
                "type": "string"
              },
              "contentBase64": {
                "type": "string"
              }
            }
          },
          "imageWidth": {
            "title": "Image width in pixels (when no file)",
            "type": "integer",
            "minimum": 1,
            "maximum": 100000,
            "default": 4000
          },
          "imageHeight": {
            "title": "Image height in pixels (when no file)",
            "type": "integer",
            "minimum": 1,
            "maximum": 100000,
            "default": 3000
          },
          "width": {
            "title": "Poster width (mm)",
            "type": "number",
            "minimum": 100,
            "maximum": 5000,
            "default": 600
          },
          "paper": {
            "title": "Paper size",
            "type": "string",
            "enum": [
              "a3",
              "a4",
              "a5",
              "a6",
              "b5",
              "letter",
              "legal",
              "tabloid",
              "halfletter"
            ],
            "default": "a4"
          },
          "orientation": {
            "title": "Sheet orientation",
            "type": "string",
            "enum": [
              "auto",
              "portrait",
              "landscape"
            ],
            "default": "auto"
          },
          "margin": {
            "title": "Printer margin (mm)",
            "description": "Most printers cannot print the outer 3–6 mm.",
            "type": "number",
            "minimum": 0,
            "maximum": 30,
            "default": 8
          },
          "overlap": {
            "title": "Overlap (mm)",
            "type": "number",
            "minimum": 0,
            "maximum": 40,
            "default": 10
          },
          "cropMarks": {
            "title": "Crop marks and alignment crosses",
            "type": "boolean",
            "default": true
          },
          "title": {
            "title": "Title on the cover page",
            "type": "string",
            "maxLength": 120,
            "default": "Poster"
          }
        },
        "required": []
      },
      "PrintshopPosterTilerResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "sheets",
              "cols",
              "rows",
              "orientation",
              "posterWidthMm",
              "posterHeightMm",
              "ppi",
              "tiles",
              "imageUsed",
              "pages",
              "pageWidthMm",
              "pageHeightMm",
              "warnings",
              "files",
              "openInApp"
            ],
            "properties": {
              "sheets": {
                "type": "integer"
              },
              "cols": {
                "type": "integer"
              },
              "rows": {
                "type": "integer"
              },
              "orientation": {
                "type": "string"
              },
              "posterWidthMm": {
                "type": "number"
              },
              "posterHeightMm": {
                "type": "number"
              },
              "ppi": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "imageUsed": {
                "type": "boolean"
              },
              "tiles": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "name",
                    "xMm",
                    "yMm",
                    "widthMm",
                    "heightMm"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "xMm": {
                      "type": "number"
                    },
                    "yMm": {
                      "type": "number"
                    },
                    "widthMm": {
                      "type": "number"
                    },
                    "heightMm": {
                      "type": "number"
                    }
                  }
                }
              },
              "pages": {
                "type": "integer"
              },
              "pageWidthMm": {
                "type": "number"
              },
              "pageHeightMm": {
                "type": "number"
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "files": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "pdf",
                  "svg",
                  "png"
                ],
                "properties": {
                  "pdf": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "artifactId",
                      "filename",
                      "mime",
                      "bytes",
                      "sha256",
                      "path"
                    ],
                    "properties": {
                      "artifactId": {
                        "type": "string"
                      },
                      "filename": {
                        "type": "string"
                      },
                      "mime": {
                        "type": "string"
                      },
                      "bytes": {
                        "type": "integer"
                      },
                      "sha256": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string",
                        "description": "Download path on the same site (valid for about 2 hours)."
                      }
                    }
                  },
                  "svg": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "artifactId",
                      "filename",
                      "mime",
                      "bytes",
                      "sha256",
                      "path"
                    ],
                    "properties": {
                      "artifactId": {
                        "type": "string"
                      },
                      "filename": {
                        "type": "string"
                      },
                      "mime": {
                        "type": "string"
                      },
                      "bytes": {
                        "type": "integer"
                      },
                      "sha256": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string",
                        "description": "Download path on the same site (valid for about 2 hours)."
                      }
                    }
                  },
                  "png": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "artifactId",
                      "filename",
                      "mime",
                      "bytes",
                      "sha256",
                      "path"
                    ],
                    "properties": {
                      "artifactId": {
                        "type": "string"
                      },
                      "filename": {
                        "type": "string"
                      },
                      "mime": {
                        "type": "string"
                      },
                      "bytes": {
                        "type": "integer"
                      },
                      "sha256": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string",
                        "description": "Download path on the same site (valid for about 2 hours)."
                      }
                    }
                  }
                }
              },
              "openInApp": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}