{
  "name": "subtitle-convert",
  "summary": "Converts a subtitle track between SubRip (.srt) and WebVTT (.vtt), normalising the cues.",
  "rationale": "It fetches through a hardened guard and re-serialises the cue model rather than string-patching, so positioning settings, cue ids and NOTE blocks convert cleanly instead of corrupting the output an agent would have to repair.",
  "family": "av",
  "price_usd": "0.003",
  "free": false,
  "timeout_ms": 15000,
  "max_timeout_seconds": 36,
  "input_schema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "url": {
        "type": "string",
        "maxLength": 2048,
        "format": "uri",
        "description": "Absolute http(s) URL of a SubRip or WebVTT file, at most 2048 characters; the source format is detected from the content, not the extension."
      },
      "to": {
        "default": "vtt",
        "description": "Target format, vtt (default) or srt; cues are re-serialised, so SRT output is renumbered and VTT cue ids, settings and NOTE blocks are dropped.",
        "type": "string",
        "enum": [
          "srt",
          "vtt"
        ]
      }
    },
    "required": [
      "url"
    ],
    "additionalProperties": false
  },
  "input_example": {
    "url": "https://grist.tools/samples/av/subtitle-captions.srt",
    "to": "vtt"
  },
  "output_example": {
    "source_url": "https://grist.tools/samples/av/subtitle-captions.srt",
    "source_format": "srt",
    "target_format": "vtt",
    "cue_count": 3,
    "subtitle": "WEBVTT\n\n00:00:01.000 --> 00:00:03.500\nThe tide goes out slowly.\n\n00:00:04.000 --> 00:00:06.250\nShells line the wet sand,\none row after another.\n\n00:00:07.000 --> 00:00:09.000\nBy noon the water returns.\n"
  },
  "errors": [
    "invalid_input",
    "blocked_target",
    "unreachable_target",
    "upstream_timeout",
    "unsupported_content_type",
    "too_large",
    "unprocessable",
    "internal"
  ]
}