{
  "openapi": "3.1.1",
  "info": {
    "title": "Lottie Inspector & Compactor API",
    "version": "1.0.0",
    "summary": "Inspect Lottie data and remove JSON whitespace safely.",
    "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://fliplinelottieinspector.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Inspect Lottie data and remove JSON whitespace safely.",
        "description": "Inspect Lottie dimensions, timing, layers, keyframes, expressions and asset references. Minify JSON without changing rendering fields, optionally remove root metadata, and open compatible shape animations in Flipline Motion Desk.\n\nMethodology:\n- Parse data-only Lottie JSON with a 2 MB UTF-8 budget, a depth limit of 40 and a 160,000-value budget. Dimensions, timing and finite numbers are checked before inspection. Expressions and references are counted without execution or network requests.\n- Compaction serializes the parsed document without indentation. Every field is retained unless root metadata removal is explicitly selected, which removes only the top-level meta field. Before and after sizes are UTF-8 bytes. No geometry, colors, transforms, expressions or keyframes are optimized.\n- Editor compatibility checks a strict subset: 2D shape layers with solid static fills, strokes and paths, static anchors and animated position, scale, rotation and opacity. Unsupported assets, text, effects, masks, blends, parenting and spatial paths are reported. Compatible transforms are sampled at each composition frame; subframe interpolation can differ.\n- Compatible imports allow 24 layers, 360 frames, 60 FPS, 60 seconds, a 2-megapixel stage and 4096 path points. A project download and editor link are returned only when the entire file fits this subset. General inspection and compaction can still be useful for unsupported files.\n\nDoes not render arbitrary Lottie, evaluate expressions, fetch assets or guarantee player compatibility. Compaction removes whitespace; it does not reduce geometry or keyframes.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "flipline_lottie_inspector",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FliplineLottieInspectorInput"
              },
              "examples": {
                "example1": {
                  "summary": "Inspect a two-layer animation",
                  "value": {}
                },
                "example2": {
                  "summary": "Remove root metadata from a blank composition",
                  "value": {
                    "json": "{\"v\":\"5.7.4\",\"fr\":30,\"ip\":0,\"op\":60,\"w\":480,\"h\":360,\"nm\":\"Blank composition\",\"ddd\":0,\"assets\":[],\"layers\":[],\"meta\":{\"author\":\"Example\"}}",
                    "removeMetadata": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FliplineLottieInspectorResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "FliplineLottieInspectorInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "json": {
            "title": "Lottie JSON",
            "type": "string",
            "maxLength": 2000000,
            "default": "{\n  \"v\": \"5.7.4\",\n  \"fr\": 30,\n  \"ip\": 0,\n  \"op\": 90,\n  \"w\": 480,\n  \"h\": 360,\n  \"nm\": \"A little signal\",\n  \"ddd\": 0,\n  \"assets\": [],\n  \"layers\": [\n    {\n      \"ty\": 4,\n      \"ind\": 1,\n      \"nm\": \"Circle\",\n      \"ip\": 0,\n      \"op\": 90,\n      \"st\": 0,\n      \"sr\": 1,\n      \"ao\": 0,\n      \"bm\": 0,\n      \"ddd\": 0,\n      \"hd\": false,\n      \"ks\": {\n        \"a\": {\n          \"a\": 0,\n          \"k\": [\n            0,\n            0,\n            0\n          ]\n        },\n        \"p\": {\n          \"a\": 1,\n          \"k\": [\n            {\n              \"t\": 0,\n              \"s\": [\n                190,\n                180,\n                0\n              ],\n              \"e\": [\n                290,\n                180,\n                0\n              ],\n              \"o\": {\n                \"x\": [\n                  0.42,\n                  0.42,\n                  0.42\n                ],\n                \"y\": [\n                  0,\n                  0,\n                  0\n                ]\n              },\n              \"i\": {\n                \"x\": [\n                  0.58,\n                  0.58,\n                  0.58\n                ],\n                \"y\": [\n                  1,\n                  1,\n                  1\n                ]\n              }\n            },\n            {\n              \"t\": 44,\n              \"s\": [\n                290,\n                180,\n                0\n              ],\n              \"e\": [\n                190,\n                180,\n                0\n              ],\n              \"o\": {\n                \"x\": [\n                  0.42,\n                  0.42,\n                  0.42\n                ],\n                \"y\": [\n                  0,\n                  0,\n                  0\n                ]\n              },\n              \"i\": {\n                \"x\": [\n                  0.58,\n                  0.58,\n                  0.58\n                ],\n                \"y\": [\n                  1,\n                  1,\n                  1\n                ]\n              }\n            },\n            {\n              \"t\": 89,\n              \"s\": [\n                190,\n                180,\n                0\n              ]\n            }\n          ]\n        },\n        \"s\": {\n          \"a\": 1,\n          \"k\": [\n            {\n              \"t\": 0,\n              \"s\": [\n                70,\n                70,\n                100\n              ],\n              \"e\": [\n                115,\n                115,\n                100\n              ],\n              \"o\": {\n                \"x\": [\n                  0.42,\n                  0.42,\n                  0.42\n                ],\n                \"y\": [\n                  0,\n                  0,\n                  0\n                ]\n              },\n              \"i\": {\n                \"x\": [\n                  0.58,\n                  0.58,\n                  0.58\n                ],\n                \"y\": [\n                  1,\n                  1,\n                  1\n                ]\n              }\n            },\n            {\n              \"t\": 44,\n              \"s\": [\n                115,\n                115,\n                100\n              ],\n              \"e\": [\n                70,\n                70,\n                100\n              ],\n              \"o\": {\n                \"x\": [\n                  0.42,\n                  0.42,\n                  0.42\n                ],\n                \"y\": [\n                  0,\n                  0,\n                  0\n                ]\n              },\n              \"i\": {\n                \"x\": [\n                  0.58,\n                  0.58,\n                  0.58\n                ],\n                \"y\": [\n                  1,\n                  1,\n                  1\n                ]\n              }\n            },\n            {\n              \"t\": 89,\n              \"s\": [\n                70,\n                70,\n                100\n              ]\n            }\n          ]\n        },\n        \"r\": {\n          \"a\": 1,\n          \"k\": [\n            {\n              \"t\": 0,\n              \"s\": [\n                0\n              ],\n              \"e\": [\n                0\n              ],\n              \"o\": {\n                \"x\": [\n                  0.42\n                ],\n                \"y\": [\n                  0\n                ]\n              },\n              \"i\": {\n                \"x\": [\n                  0.58\n                ],\n                \"y\": [\n                  1\n                ]\n              }\n            },\n            {\n              \"t\": 44,\n              \"s\": [\n                0\n              ],\n              \"e\": [\n                0\n              ],\n              \"o\": {\n                \"x\": [\n                  0.42\n                ],\n                \"y\": [\n                  0\n                ]\n              },\n              \"i\": {\n                \"x\": [\n                  0.58\n                ],\n                \"y\": [\n                  1\n                ]\n              }\n            },\n            {\n              \"t\": 89,\n              \"s\": [\n                0\n              ]\n            }\n          ]\n        },\n        \"o\": {\n          \"a\": 1,\n          \"k\": [\n            {\n              \"t\": 0,\n              \"s\": [\n                100\n              ],\n              \"e\": [\n                100\n              ],\n              \"o\": {\n                \"x\": [\n                  0.42\n                ],\n                \"y\": [\n                  0\n                ]\n              },\n              \"i\": {\n                \"x\": [\n                  0.58\n                ],\n                \"y\": [\n                  1\n                ]\n              }\n            },\n            {\n              \"t\": 44,\n              \"s\": [\n                100\n              ],\n              \"e\": [\n                100\n              ],\n              \"o\": {\n                \"x\": [\n                  0.42\n                ],\n                \"y\": [\n                  0\n                ]\n              },\n              \"i\": {\n                \"x\": [\n                  0.58\n                ],\n                \"y\": [\n                  1\n                ]\n              }\n            },\n            {\n              \"t\": 89,\n              \"s\": [\n                100\n              ]\n            }\n          ]\n        }\n      },\n      \"shapes\": [\n        {\n          \"ty\": \"gr\",\n          \"nm\": \"Circle\",\n          \"it\": [\n            {\n              \"ty\": \"el\",\n              \"d\": 1,\n              \"p\": {\n                \"a\": 0,\n                \"k\": [\n                  0,\n                  0\n                ]\n              },\n              \"s\": {\n                \"a\": 0,\n                \"k\": [\n                  68,\n                  68\n                ]\n              }\n            },\n            {\n              \"ty\": \"fl\",\n              \"c\": {\n                \"a\": 0,\n                \"k\": [\n                  0.8392156862745098,\n                  0.6313725490196078,\n                  0.3686274509803922\n                ]\n              },\n              \"o\": {\n                \"a\": 0,\n                \"k\": 100\n              },\n              \"r\": 1\n            },\n            {\n              \"ty\": \"tr\",\n              \"a\": {\n                \"a\": 0,\n                \"k\": [\n                  0,\n                  0\n                ]\n              },\n              \"p\": {\n                \"a\": 0,\n                \"k\": [\n                  0,\n                  0\n                ]\n              },\n              \"s\": {\n                \"a\": 0,\n                \"k\": [\n                  100,\n                  100\n                ]\n              },\n              \"r\": {\n                \"a\": 0,\n                \"k\": 0\n              },\n              \"o\": {\n                \"a\": 0,\n                \"k\": 100\n              },\n              \"sk\": {\n                \"a\": 0,\n                \"k\": 0\n              },\n              \"sa\": {\n                \"a\": 0,\n                \"k\": 0\n              }\n            }\n          ]\n        }\n      ]\n    },\n    {\n      \"ty\": 4,\n      \"ind\": 2,\n      \"nm\": \"Shape\",\n      \"ip\": 0,\n      \"op\": 90,\n      \"st\": 0,\n      \"sr\": 1,\n      \"ao\": 0,\n      \"bm\": 0,\n      \"ddd\": 0,\n      \"hd\": false,\n      \"ks\": {\n        \"a\": {\n          \"a\": 0,\n          \"k\": [\n            0,\n            0,\n            0\n          ]\n        },\n        \"p\": {\n          \"a\": 0,\n          \"k\": [\n            240,\n            180,\n            0\n          ]\n        },\n        \"s\": {\n          \"a\": 0,\n          \"k\": [\n            100,\n            100,\n            100\n          ]\n        },\n        \"r\": {\n          \"a\": 0,\n          \"k\": 0\n        },\n        \"o\": {\n          \"a\": 0,\n          \"k\": 100\n        }\n      },\n      \"shapes\": [\n        {\n          \"ty\": \"gr\",\n          \"nm\": \"Shape\",\n          \"it\": [\n            {\n              \"ty\": \"rc\",\n              \"d\": 1,\n              \"p\": {\n                \"a\": 0,\n                \"k\": [\n                  0,\n                  0\n                ]\n              },\n              \"s\": {\n                \"a\": 0,\n                \"k\": [\n                  220,\n                  170\n                ]\n              },\n              \"r\": {\n                \"a\": 0,\n                \"k\": 32\n              }\n            },\n            {\n              \"ty\": \"fl\",\n              \"c\": {\n                \"a\": 0,\n                \"k\": [\n                  0.18823529411764706,\n                  0.30980392156862746,\n                  0.3411764705882353\n                ]\n              },\n              \"o\": {\n                \"a\": 0,\n                \"k\": 100\n              },\n              \"r\": 1\n            },\n            {\n              \"ty\": \"tr\",\n              \"a\": {\n                \"a\": 0,\n                \"k\": [\n                  0,\n                  0\n                ]\n              },\n              \"p\": {\n                \"a\": 0,\n                \"k\": [\n                  0,\n                  0\n                ]\n              },\n              \"s\": {\n                \"a\": 0,\n                \"k\": [\n                  100,\n                  100\n                ]\n              },\n              \"r\": {\n                \"a\": 0,\n                \"k\": 0\n              },\n              \"o\": {\n                \"a\": 0,\n                \"k\": 100\n              },\n              \"sk\": {\n                \"a\": 0,\n                \"k\": 0\n              },\n              \"sa\": {\n                \"a\": 0,\n                \"k\": 0\n              }\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}"
          },
          "removeMetadata": {
            "title": "Remove root metadata",
            "type": "boolean",
            "default": false
          }
        },
        "required": []
      },
      "FliplineLottieInspectorResult": {
        "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": [
              "report",
              "beforeBytes",
              "afterBytes",
              "savedBytes",
              "removedMetadata",
              "compactFile",
              "projectFile",
              "openInApp"
            ],
            "properties": {
              "report": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "width",
                  "height",
                  "fps",
                  "inFrame",
                  "outFrame",
                  "frames",
                  "durationSeconds",
                  "layers",
                  "assets",
                  "keyframes",
                  "points",
                  "expressions",
                  "externalAssets",
                  "layerTypes",
                  "shapeTypes",
                  "features",
                  "sourceBytes",
                  "editorCompatible",
                  "editorIssue",
                  "importMethod"
                ],
                "properties": {
                  "width": {
                    "type": "number"
                  },
                  "height": {
                    "type": "number"
                  },
                  "fps": {
                    "type": "number"
                  },
                  "inFrame": {
                    "type": "number"
                  },
                  "outFrame": {
                    "type": "number"
                  },
                  "frames": {
                    "type": "number"
                  },
                  "durationSeconds": {
                    "type": "number"
                  },
                  "layers": {
                    "type": "integer"
                  },
                  "assets": {
                    "type": "integer"
                  },
                  "keyframes": {
                    "type": "integer"
                  },
                  "points": {
                    "type": "integer"
                  },
                  "expressions": {
                    "type": "integer"
                  },
                  "externalAssets": {
                    "type": "integer"
                  },
                  "layerTypes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "integer"
                    }
                  },
                  "shapeTypes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "integer"
                    }
                  },
                  "features": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "sourceBytes": {
                    "type": "integer"
                  },
                  "editorCompatible": {
                    "type": "boolean"
                  },
                  "editorIssue": {
                    "type": "string"
                  },
                  "importMethod": {
                    "type": "string"
                  }
                }
              },
              "beforeBytes": {
                "type": "integer"
              },
              "afterBytes": {
                "type": "integer"
              },
              "savedBytes": {
                "type": "integer"
              },
              "removedMetadata": {
                "type": "boolean"
              },
              "compactFile": {
                "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)."
                  }
                }
              },
              "projectFile": {
                "anyOf": [
                  {
                    "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)."
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "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"
              }
            }
          }
        }
      }
    }
  }
}