Prepare an image for LINE (resize + host + verify)
line_prepare_imageResize and host images for LINE messaging, returning a prepared_key for use in imagemap or image messages. No hosting setup needed; works from file paths, URLs, or base64.
Instructions
Make any image sendable to LINE with ZERO hosting knowledge: resizes to the imagemap widths (1040/700/460/300/240), hosts them via the best available provider, HEAD-verifies every size, and returns a prepared_key that line_design_imagemap / line_send_message accept directly.
Provider chain (auto-selected, user never configures): self (HTTP deployments with MCP_PUBLIC_URL) → local-tunnel (default for stdio installs; free cloudflared quick tunnel, outbound-only so it works behind NAT) → handoff (a zip + Thai step-by-step manual instructions — nobody dead-ends).
Why this exists: LINE has no upload API for message images; they must sit on public HTTPS. IMPORTANT (live-verified 2026-07-31): LINE fetches the image when each recipient FIRST VIEWS the message — NOT at send time. Keep this MCP process (and the machine) running until most recipients have opened the message; once viewed, LINE's cache serves the image permanently (survives host shutdown and even device restarts). Default keep-alive: 24h.
Returns { prepared_key, provider, base_url?, image_url?, preview_image_url?, verified, expires_at?, handoff?, warnings }. NEVER claims false success: every returned URL was verified reachable; if verification fails (e.g. the network blocks the tunnel), the tool automatically tears the tunnel down and returns the handoff package instead.
Example: "ส่งรูปนี้เป็น Rich Message" → 1) line_prepare_image { image: { file_path: "/Users/me/promo.png" } } → 2) line_design_imagemap { prepared_key, alt_text, areas } → 3) line_send_message { message: { message_json } }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | The source image. Provide EXACTLY ONE of file_path | base64 | source_url. | |
| purpose | No | "imagemap" (default) = Rich Message with tappable areas (needs 5 hosted sizes). "image_message" = plain image bubble (needs full + preview). | imagemap |
| keep_alive_hours | No | How long to keep the hosting alive (default 24h). Must cover the window until recipients FIRST VIEW the message (that's when LINE fetches); hosting also ends if this MCP process exits. |