{
  "openapi": "3.1.1",
  "info": {
    "title": "Vector Shape Generator API",
    "version": "1.0.0",
    "summary": "Make editable SVG polygons, stars and spirals from simple settings.",
    "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://luminavectorshapegenerator.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Make editable SVG polygons, stars and spirals from simple settings.",
        "description": "Create a transparent SVG shape with adjustable points, rotation, colors and stroke. Download the artwork or import it into Flipline Motion Desk for animation.\n\nMethodology:\n- The generator creates one path on a square transparent canvas. Polygon vertices and alternating star vertices are placed around the center; rotation starts from the upward direction.\n- Spirals are open Archimedean polylines with 32 straight segments per turn, not fitted curves. Spiral fill is always none and a visible stroke is required.\n- The stated bounds cover path geometry before stroke. Stroke is inset inside the viewBox, and the SVG contains only generated geometry and validated solid colors.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "lumina_vector_shape_generator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LuminaVectorShapeGeneratorInput"
              },
              "examples": {
                "example1": {
                  "summary": "Five-point star",
                  "value": {
                    "kind": "star",
                    "size": 512,
                    "points": 5,
                    "innerRadius": 0.45,
                    "turns": 3,
                    "rotation": 0,
                    "fill": "#E5AA4F",
                    "stroke": "#253C3A",
                    "strokeWidth": 8
                  }
                },
                "example2": {
                  "summary": "Open spiral",
                  "value": {
                    "kind": "spiral",
                    "size": 512,
                    "points": 5,
                    "innerRadius": 0.45,
                    "turns": 2,
                    "rotation": 0,
                    "fill": "none",
                    "stroke": "#236F8A",
                    "strokeWidth": 4
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LuminaVectorShapeGeneratorResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "LuminaVectorShapeGeneratorInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "kind": {
            "title": "Shape",
            "type": "string",
            "enum": [
              "polygon",
              "star",
              "spiral"
            ],
            "default": "star"
          },
          "size": {
            "title": "Canvas size (px)",
            "type": "integer",
            "minimum": 32,
            "maximum": 2000,
            "default": 512
          },
          "points": {
            "title": "Points (polygon and star)",
            "type": "integer",
            "minimum": 3,
            "maximum": 64,
            "default": 5
          },
          "innerRadius": {
            "title": "Star inner radius (fraction)",
            "type": "number",
            "minimum": 0.05,
            "maximum": 0.95,
            "default": 0.45
          },
          "turns": {
            "title": "Spiral turns",
            "type": "number",
            "minimum": 0.5,
            "maximum": 12,
            "default": 3
          },
          "rotation": {
            "title": "Rotation (degrees)",
            "type": "number",
            "minimum": -360,
            "maximum": 360,
            "default": 0
          },
          "fill": {
            "title": "Fill (six-digit HEX or none)",
            "type": "string",
            "maxLength": 7,
            "default": "#E5AA4F"
          },
          "stroke": {
            "title": "Stroke (six-digit HEX or none)",
            "type": "string",
            "maxLength": 7,
            "default": "#253C3A"
          },
          "strokeWidth": {
            "title": "Stroke width (px)",
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "default": 8
          }
        },
        "required": []
      },
      "LuminaVectorShapeGeneratorResult": {
        "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": [
              "kind",
              "svg",
              "path",
              "closed",
              "pointCount",
              "bounds"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "polygon",
                  "star",
                  "spiral"
                ]
              },
              "svg": {
                "type": "string"
              },
              "path": {
                "type": "string"
              },
              "closed": {
                "type": "boolean"
              },
              "pointCount": {
                "type": "integer"
              },
              "bounds": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "minX",
                  "minY",
                  "maxX",
                  "maxY"
                ],
                "properties": {
                  "minX": {
                    "type": "number"
                  },
                  "minY": {
                    "type": "number"
                  },
                  "maxX": {
                    "type": "number"
                  },
                  "maxY": {
                    "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"
              }
            }
          }
        }
      }
    }
  }
}