{
  "openapi": "3.1.1",
  "info": {
    "title": "Storyboard Shot Builder API",
    "version": "1.0.0",
    "summary": "Turn a timed shot list into an editable storyboard with simple staging sketches.",
    "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://fliplinestoryboardbuilder.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Turn a timed shot list into an editable storyboard with simple staging sketches.",
        "description": "Plan boards with action, dialogue, scene, shot size and camera notes. Quantize durations to frames, add optional stick-figure staging, and download an editable Flipline Story Desk project, shot list and dialogue subtitles.\n\nMethodology:\n- Each nonblank line uses Title | Seconds | Action | Dialogue, optionally followed by Scene | Shot size | Camera. Pipes cannot appear inside fields. Shot sizes: wide, medium, close, detail, over-shoulder. Camera labels: static, pan-left, pan-right, tilt-up, tilt-down, push-in, pull-out, handheld.\n- Seconds are rounded to the nearest whole frame, with a minimum of one frame. Board intervals are half-open; timecodes are non-drop-frame at integer 1–30 FPS. Maximum 48 boards, 120 seconds per board and ten minutes total.\n- Staging sketches are original, deterministic stick figures and a ground line. They are editable drawing marks, not AI-generated images or 3D camera simulations. No Storyboarder project, Fountain screenplay or NLE timeline import is provided.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "flipline_storyboard_builder",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FliplineStoryboardBuilderInput"
              },
              "examples": {
                "example1": {
                  "summary": "Three shots for a short scene",
                  "value": {
                    "shots": "The workshop | 3 | A courier reaches the door. | | Outside | wide | pan-right\nA small parcel | 2 | The maker opens the box. | What is inside? | Workshop | close | static\nA new idea | 4 | The pair lean over the workbench. | Let us try it. | Workshop | over-shoulder | pull-out",
                    "fps": 24
                  }
                },
                "example2": {
                  "summary": "A portrait dialogue beat",
                  "value": {
                    "shots": "A pause | 1.25 | A character looks up. | Hello. | Window | close | static",
                    "aspect": "portrait",
                    "staging": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FliplineStoryboardBuilderResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "FliplineStoryboardBuilderInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "shots": {
            "title": "Shots: Title | Seconds | Action | Dialogue | Scene | Shot size | Camera",
            "type": "string",
            "maxLength": 100000,
            "default": "The workshop | 3 | A courier reaches the door. | | Outside | wide | pan-right\nA small parcel | 2 | The maker opens the box. | What is inside? | Workshop | close | static\nA new idea | 4 | The pair lean over the workbench. | Let us try it. | Workshop | over-shoulder | pull-out"
          },
          "name": {
            "title": "Storyboard name",
            "type": "string",
            "maxLength": 120,
            "default": "A small delivery"
          },
          "fps": {
            "title": "Storyboard frame rate (FPS)",
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "default": 24
          },
          "aspect": {
            "title": "Storyboard aspect ratio",
            "type": "string",
            "enum": [
              "wide",
              "classic",
              "cinema",
              "portrait"
            ],
            "default": "wide"
          },
          "staging": {
            "title": "Add editable staging sketches",
            "type": "boolean",
            "default": true
          }
        },
        "required": []
      },
      "FliplineStoryboardBuilderResult": {
        "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": [
              "project",
              "timing",
              "openInApp"
            ],
            "properties": {
              "project": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "format",
                  "version",
                  "name",
                  "width",
                  "height",
                  "fps",
                  "paper",
                  "boards"
                ],
                "properties": {
                  "format": {
                    "const": "flipline-story"
                  },
                  "version": {
                    "const": 1
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 32,
                    "maximum": 1600
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 32,
                    "maximum": 1600
                  },
                  "fps": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  },
                  "paper": {
                    "type": "string",
                    "pattern": "^#[a-fA-F0-9]{6}$"
                  },
                  "boards": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 48,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "title",
                        "scene",
                        "shot",
                        "camera",
                        "frames",
                        "action",
                        "dialogue",
                        "notes",
                        "locked",
                        "marks",
                        "reference"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[-a-zA-Z0-9_]{1,80}$"
                        },
                        "title": {
                          "type": "string",
                          "maxLength": 80
                        },
                        "scene": {
                          "type": "string",
                          "maxLength": 80
                        },
                        "shot": {
                          "enum": [
                            "wide",
                            "medium",
                            "close",
                            "detail",
                            "over-shoulder"
                          ]
                        },
                        "camera": {
                          "enum": [
                            "static",
                            "pan-left",
                            "pan-right",
                            "tilt-up",
                            "tilt-down",
                            "push-in",
                            "pull-out",
                            "handheld"
                          ]
                        },
                        "frames": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 3600
                        },
                        "action": {
                          "type": "string",
                          "maxLength": 1200
                        },
                        "dialogue": {
                          "type": "string",
                          "maxLength": 1200
                        },
                        "notes": {
                          "type": "string",
                          "maxLength": 1200
                        },
                        "locked": {
                          "type": "boolean"
                        },
                        "marks": {
                          "type": "array",
                          "maxItems": 500,
                          "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                              "id",
                              "kind",
                              "points",
                              "color",
                              "size",
                              "fill"
                            ],
                            "properties": {
                              "brush": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                  "kind",
                                  "opacity",
                                  "flow",
                                  "spacing",
                                  "texture",
                                  "pressure",
                                  "seed"
                                ],
                                "properties": {
                                  "kind": {
                                    "enum": [
                                      "ink",
                                      "pencil",
                                      "marker",
                                      "wash",
                                      "airbrush"
                                    ]
                                  },
                                  "opacity": {
                                    "type": "number",
                                    "minimum": 0,
                                    "maximum": 1
                                  },
                                  "flow": {
                                    "type": "number",
                                    "minimum": 0,
                                    "maximum": 1
                                  },
                                  "spacing": {
                                    "type": "number",
                                    "minimum": 0.08,
                                    "maximum": 1
                                  },
                                  "texture": {
                                    "type": "number",
                                    "minimum": 0,
                                    "maximum": 1
                                  },
                                  "pressure": {
                                    "type": "boolean"
                                  },
                                  "seed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 4294967295
                                  }
                                }
                              },
                              "pressures": {
                                "type": "array",
                                "minItems": 1,
                                "maxItems": 4096,
                                "items": {
                                  "type": "number",
                                  "minimum": 0,
                                  "maximum": 1
                                }
                              },
                              "id": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80
                              },
                              "kind": {
                                "enum": [
                                  "pen",
                                  "eraser",
                                  "line",
                                  "rect",
                                  "ellipse",
                                  "image"
                                ]
                              },
                              "points": {
                                "type": "array",
                                "minItems": 1,
                                "maxItems": 4096,
                                "items": {
                                  "type": "array",
                                  "minItems": 2,
                                  "maxItems": 2,
                                  "items": {
                                    "type": "number",
                                    "minimum": 0,
                                    "maximum": 1
                                  }
                                }
                              },
                              "color": {
                                "type": "string",
                                "pattern": "^#[a-fA-F0-9]{6}$"
                              },
                              "size": {
                                "type": "number",
                                "minimum": 1,
                                "maximum": 100
                              },
                              "fill": {
                                "type": "boolean"
                              },
                              "source": {
                                "type": "string",
                                "pattern": "^data:image/(png|jpeg|webp);base64,[A-Za-z0-9+/=]+$"
                              },
                              "angle": {
                                "type": "number",
                                "minimum": -360,
                                "maximum": 360,
                                "description": "Clockwise rotation in degrees around the center of the mark bounds (normalized to -180…180)."
                              },
                              "flipX": {
                                "type": "boolean",
                                "description": "Mirror horizontally around the mark center."
                              },
                              "flipY": {
                                "type": "boolean",
                                "description": "Mirror vertically around the mark center."
                              }
                            }
                          }
                        },
                        "reference": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": false,
                          "required": [
                            "source",
                            "opacity",
                            "visible"
                          ],
                          "properties": {
                            "source": {
                              "type": "string",
                              "pattern": "^data:image/(png|jpeg|webp);base64,[A-Za-z0-9+/=]+$"
                            },
                            "opacity": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 1
                            },
                            "visible": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "description": "Story Desk. Frame-based board durations, half-open timeline intervals and non-drop-frame timecodes. Up to 600 seconds total and 120 seconds per board at the chosen FPS. Canvas up to 2 MP, 50000 points, 2000 marks and 6 million source-image characters across all boards. Ink erasers affect preceding ink only; the independent reference is preserved. Camera moves are planning labels, not animated camera paths."
              },
              "timing": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "fps",
                  "boards",
                  "frames",
                  "durationMs",
                  "gifDurationMs",
                  "scenes",
                  "shots"
                ],
                "properties": {
                  "fps": {
                    "type": "integer"
                  },
                  "boards": {
                    "type": "integer"
                  },
                  "frames": {
                    "type": "integer"
                  },
                  "durationMs": {
                    "type": "number"
                  },
                  "gifDurationMs": {
                    "type": "number"
                  },
                  "scenes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "scene",
                        "boards",
                        "frames"
                      ],
                      "properties": {
                        "scene": {
                          "type": "string"
                        },
                        "boards": {
                          "type": "integer"
                        },
                        "frames": {
                          "type": "integer"
                        }
                      }
                    }
                  },
                  "shots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "board",
                        "id",
                        "title",
                        "scene",
                        "shot",
                        "camera",
                        "frames",
                        "startFrame",
                        "endFrame",
                        "startMs",
                        "endMs",
                        "durationMs",
                        "gifDurationMs",
                        "in",
                        "out",
                        "action",
                        "dialogue",
                        "notes"
                      ],
                      "properties": {
                        "board": {
                          "type": "integer"
                        },
                        "id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "scene": {
                          "type": "string"
                        },
                        "shot": {
                          "type": "string"
                        },
                        "camera": {
                          "type": "string"
                        },
                        "frames": {
                          "type": "integer"
                        },
                        "startFrame": {
                          "type": "integer"
                        },
                        "endFrame": {
                          "type": "integer"
                        },
                        "startMs": {
                          "type": "number"
                        },
                        "endMs": {
                          "type": "number"
                        },
                        "durationMs": {
                          "type": "number"
                        },
                        "gifDurationMs": {
                          "type": "number"
                        },
                        "in": {
                          "type": "string"
                        },
                        "out": {
                          "type": "string"
                        },
                        "action": {
                          "type": "string"
                        },
                        "dialogue": {
                          "type": "string"
                        },
                        "notes": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              },
              "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"
              }
            }
          }
        }
      }
    }
  }
}