{
  "openapi": "3.1.1",
  "info": {
    "title": "Animation Exposure Sheet API",
    "version": "1.0.0",
    "summary": "Turn drawing holds into a precise animation timing sheet.",
    "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://fliplineexposuresheet.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Turn drawing holds into a precise animation timing sheet.",
        "description": "Enter how many timeline ticks each drawing lasts and a frame rate. Calculate drawing start times, total duration and GIF timing rounded to 10 milliseconds.\n\nMethodology:\n- A drawing held for N ticks lasts N × 1000 / FPS milliseconds. Start and end tick positions are half-open intervals.\n- GIF stores centiseconds. Each drawing duration rounds independently to the nearest 10 ms; the reported GIF total may differ from ideal playback.\n- 1–24 drawings, holds of 1–10 ticks and 1–30 FPS. No uploaded files are needed.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "flipline_exposure_sheet",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FliplineExposureSheetInput"
              },
              "examples": {
                "example1": {
                  "summary": "A six-drawing motion study on twos",
                  "value": {
                    "holds": "2,2,1,1,2,2",
                    "fps": 12
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FliplineExposureSheetResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "FliplineExposureSheetInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "holds": {
            "title": "Drawing holds (ticks, separated by commas)",
            "type": "string",
            "maxLength": 120,
            "default": "2,2,1,1,2,2"
          },
          "fps": {
            "title": "Timeline frame rate (FPS)",
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "default": 12
          }
        },
        "required": []
      },
      "FliplineExposureSheetResult": {
        "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": [
              "fps",
              "drawings",
              "ticks",
              "durationMs",
              "gifDurationMs",
              "frames"
            ],
            "properties": {
              "fps": {
                "type": "integer"
              },
              "drawings": {
                "type": "integer"
              },
              "ticks": {
                "type": "integer"
              },
              "durationMs": {
                "type": "number"
              },
              "gifDurationMs": {
                "type": "number"
              },
              "frames": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "drawing",
                    "hold",
                    "startTick",
                    "endTick",
                    "startMs",
                    "durationMs",
                    "gifDurationMs"
                  ],
                  "properties": {
                    "drawing": {
                      "type": "integer"
                    },
                    "hold": {
                      "type": "integer"
                    },
                    "startTick": {
                      "type": "integer"
                    },
                    "endTick": {
                      "type": "integer"
                    },
                    "startMs": {
                      "type": "number"
                    },
                    "durationMs": {
                      "type": "number"
                    },
                    "gifDurationMs": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "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"
              }
            }
          }
        }
      }
    }
  }
}