{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/editclips-online/json-schema/editclips-online-tool-schema.json",
  "title": "Tool",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/editclips-online-openapi.yaml#/components/schemas/Tool",
  "type": "object",
  "required": [
    "slug",
    "name",
    "description",
    "category",
    "serverOnly",
    "inputs",
    "options",
    "output"
  ],
  "properties": {
    "slug": {
      "type": "string",
      "description": "Unique identifier. Pass as `tool` when creating a job."
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "category": {
      "type": "string",
      "enum": [
        "video",
        "audio",
        "effects"
      ]
    },
    "serverOnly": {
      "type": "boolean",
      "description": "If true, the tool requires server-side processing (e.g. AI subtitle extraction)"
    },
    "inputs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ToolInput"
      }
    },
    "options": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ToolOption"
      }
    },
    "output": {
      "type": "object",
      "required": [
        "type",
        "mimeType",
        "defaultName"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "video",
            "audio",
            "image",
            "subtitle",
            "zip"
          ]
        },
        "mimeType": {
          "type": "string"
        },
        "defaultName": {
          "type": "string"
        }
      }
    }
  },
  "$defs": {
    "ToolInput": {
      "type": "object",
      "required": [
        "label",
        "accept",
        "maxSize"
      ],
      "properties": {
        "label": {
          "type": "string"
        },
        "accept": {
          "type": "object",
          "description": "MIME type accept map (e.g. `{\"video/*\": []}`)",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "maxSize": {
          "type": "integer",
          "description": "Maximum file size in bytes"
        }
      }
    },
    "ToolOption": {
      "type": "object",
      "required": [
        "key",
        "type",
        "label",
        "default"
      ],
      "properties": {
        "key": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "format-select",
            "number",
            "text",
            "toggle",
            "select"
          ]
        },
        "label": {
          "type": "string"
        },
        "default": {
          "description": "Default value for this option",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            }
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "options": {
          "type": [
            "array",
            "null"
          ],
          "description": "Available choices (for select and format-select types)",
          "items": {
            "type": "object",
            "required": [
              "value",
              "label"
            ],
            "properties": {
              "value": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "group": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "speed": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "quality": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          }
        },
        "min": {
          "type": [
            "number",
            "null"
          ],
          "description": "Minimum value (for number type)"
        },
        "max": {
          "type": [
            "number",
            "null"
          ],
          "description": "Maximum value (for number type)"
        },
        "step": {
          "type": [
            "number",
            "null"
          ],
          "description": "Step increment (for number type)"
        }
      }
    }
  }
}