---
name: schedule-post
description: >
  Schedule or draft Instagram and TikTok posts with Unsora — uses connected
  accounts and generated media URLs. Use when the user wants to publish, schedule,
  or post content to social after generation.
---

# Schedule Post

Publish or schedule content to Instagram and TikTok via `create_post` and related tools.

---

## Prerequisites

1. **Paid plan** — `get_subscription` must show `isActive: true`. If not, direct user to [app.tryunsora.com/billing](https://app.tryunsora.com/billing).
2. **Connected accounts** — `get_accounts` returns account ids for Instagram/TikTok. If empty, user must connect at [app.tryunsora.com/scheduler/connections](https://app.tryunsora.com/scheduler/connections).
3. **Media URL** — public HTTPS URL of video or image(s) from a prior generation step

---

## Workflow

### Schedule existing media

1. `get_subscription` — verify active plan
2. `get_accounts` — list accounts; confirm which ones with the user
3. Collect:
   - `caption` — post text + hashtags
   - `mediaType` — `video`, `slideshow`, or `none`
   - `mediaUrl` (video) or `mediaUrls` (slideshow images)
   - `scheduled_at` — ISO datetime for future post, or omit for draft/immediate
   - Platform options — `instagram` / `tiktok` objects if user needs specific settings
4. `create_post`
5. Confirm success — platform, account name, schedule time

### Generate + schedule in one flow

Use `create_image_and_schedule` when the user wants image → post without manual URL handoff. Still requires account ids and caption.

---

## Common pipelines

| Goal | Steps |
|------|-------|
| Video → TikTok | `create_video` → get `outputUrl` → `create_post` with `mediaType: "video"` |
| Thumbnail carousel → IG | `create_thumbnail` (multiple) → `create_post` with `mediaType: "slideshow"` |
| Clip → schedule best | `create_clipping` → pick clip URL → `create_post` |

In Claude.ai preview hosts, wait for the user to confirm which output URL to use after previews finish.

---

## Scheduling time

- Accept user timezone in natural language; convert to ISO 8601 for `scheduled_at`
- Confirm timezone explicitly if ambiguous ("3pm" — which timezone?)

---

## Listing posts

`list_posts` — show scheduled, draft, and recent posts when user asks what's queued.

---

## Errors

- **No active subscription** — explain paid plan required for scheduler
- **No accounts** — link to connections page
- **Invalid media URL** — ensure URL is from a completed Unsora job and publicly accessible

---

## Safety

- Confirm caption and target accounts before posting
- For immediate publish (no `scheduled_at`), double-check the user wants it live now
