{
  "name": "giphy_fetch",
  "description": "Download chosen GIFs (ids from giphy_search) into a workspace-relative folder — projects/<name>/assets/gif/ is the house rule — and write a GIPHY.md credits file beside them. Bytes are checked to actually be a GIF, capped at 12 MB each, and refused outside the workspace. Do this when a GIF is going into a video: a render reads frames off disk and cannot wait on a URL.",
  "parameters": {
    "properties": {
      "ids": {
        "type": "array",
        "items": { "type": "string" },
        "description": "The GIPHY ids giphy_search printed, at most 20 per call."
      },
      "into": {
        "type": "string",
        "description": "Workspace-relative folder to download into, e.g. \"projects/reel/assets/gif\". One folder per project is the house rule."
      }
    },
    "required": ["ids", "into"]
  },
  "run": "NODE_BIN=\"$(command -v node || true)\"; if [ -z \"$NODE_BIN\" ]; then echo 'giphy_fetch: node not found on PATH' >&2; exit 2; fi; S=\"skills/giphy/tools/giphy_fetch/fetch.mjs\"; if [ ! -f \"$S\" ]; then echo 'giphy_fetch: fetch.mjs not found — this tool runs from an installed giphy skill folder (skills/giphy/)' >&2; exit 2; fi; exec \"$NODE_BIN\" \"$S\""
}
