{
  "name": "doc-parse",
  "toolName": "doc_parse",
  "tier": "tool",
  "category": "consuming",
  "title": "Document Extraction",
  "description": "Extract a document (.pptx) into structured data: per-page title and body text, the speaker notes, and — when asked for the layout layer — the exact shapes, coordinates, colors and animation beats of every slide. Runs server-side (ab-render /extract); nothing is installed locally and no model is involved, so the result is deterministic. Two layers via `fields`: `content` is lightweight text (title / text / rawNotes) and is what you want for narration or for summarizing a deck; `layout` additionally returns the slide payload that the ppt-to-video template renders one-to-one from the original file — it embeds every icon as a data URI and is large, so it is written to a file rather than printed.",
  "auth": "required",
  "envVars": [
    "RENDER_API_URL",
    "PRIV_TOKEN",
    "CONVERSATION_ID"
  ],
  "entry": {
    "type": "python",
    "scriptPath": "scripts/extract_via_render.py"
  },
  "parameters": {
    "type": "object",
    "properties": {
      "url": {
        "type": "string",
        "description": "Direct document URL (http/https). A page link or a share link will not work — pass the file URL itself (e.g. what the asset library returns)."
      },
      "kind": {
        "type": "string",
        "enum": ["pptx"],
        "description": "Document kind. Only pptx today; a binary .ppt must be re-saved as .pptx first."
      },
      "fields": {
        "type": "string",
        "description": "Comma-separated layers: `content` (title/text/rawNotes — small) and/or `layout` (slide shapes + beats — large, embeds icons). Default `content,layout`. Ask for content only when you just need the words."
      },
      "slide": {
        "type": "number",
        "description": "Only extract this 1-based page. Omit for the whole deck."
      },
      "out": {
        "type": "string",
        "description": "Where to write the full JSON result (default ./<name>.extract.json). stdout gets a per-page summary instead."
      },
      "json_output": {
        "type": "boolean",
        "description": "Pipeline mode — emit the full JSON on stdout. Avoid with the layout layer: it is hundreds of KB of base64 per page."
      }
    },
    "required": ["url"]
  },
  "ui": {
    "primary": ["url", "fields"],
    "advanced": ["slide", "kind"],
    "hidden": ["out", "json_output"]
  }
}
