<!-- Generated from backend/src/brandsmith/entrypoints/api/mcp/guide.py. Do not edit by hand. -->

# Brandsmith agent guide

This guide is for AI agents that use Brandsmith through its MCP server. It is the same text
as the `brandsmith://guide` resource.

## What Brandsmith is

Brandsmith makes short vertical videos that sell, for a brand or a creator. It finds what
already works on YouTube, makes clips and new videos from it, lets the user review them,
posts them on a schedule, and learns from the results. Everything happens in one
**workspace**: the token's workspace, or the one in the `X-Workspace` header.

## The core loop

1. **Find**: "What works in my niche?" Use `list_outliers`, `intel_browse` and
   `intel_manage`.
2. **Make**: "Clip these winners", "Make an explainer". Use `make_clips`, `start_run`,
   `generate`, `make_explainer`, `make_ugc_hook`, `make_remix` and `influencer_talk`.
   A narrated story video (60 to 150 seconds) is written in steps: `story_draft`, then
   `story_update`; `get_story` reads it. `studio` with `kind: "story"` makes the video.
   To make a video stage by stage, fix one moment of a finished one, or edit it on the
   timeline: `studio`. It shows every full prompt, edits or rewrites it, checks the plan
   for free, and generates each moment on its own. Its `timeline` and `edit_timeline`
   actions trim, move, split, remove and add shots, and change the captions, the music
   mix and the voice timing, for free, with `undo` and `redo`; `assemble` updates the video.
   Its project actions plan from one sentence (`plan`), list the projects, rename them,
   `duplicate` them (free, nothing made) and group them into campaigns. `classify` picks
   the format from that sentence, with a reason (or pass `format_id: "auto"`).
   `rewrite_all` changes the whole video from one instruction ("make it calmer and
   warmer") as new versions, for free, and `rewrite_all_undo` takes that change set back.
   Clips from a long video (`format_id: "clips"`) find the moments first, then make only
   the clips the user keeps; they go to Review. A story (`format_id: "story"`) is written
   first, then made picture by picture and shot by shot.
   A clip of a clip run is re-cut in its clips studio: `studio` with `kind: "clips"` and
   the run id. `edit` sets a clip's `params.segments`, then `generate` makes it again.
3. **Review**: "Show me what is ready". Use `list_review`, `clip_extras`, `approve_clip`
   and `reject_clip`.
4. **Post**: "Schedule this week". Use `list_posts`, `manage_post`, `social_accounts` and
   `publishing_settings`.
5. **Learn**: "What worked?" Use `results`, `learn_defaults` and `connected_channels`.

Support tools: `list_brands`, `manage_brand` and `brand_pronunciation` (brands),
`list_formats`, `list_audio`,
`explainer_styles` and `influencers` (menus), `upload_file` (the user's own files),
`list_videos`, `video_status` and `manage_video` (made videos), `list_runs`, `run_status` and
`manage_run` (clip runs), and `credits_balance` (credits).

## Credits and the confirm rule

Paid work spends **credits**. Every paid tool takes `confirm` (default false).

1. Call the tool with `confirm` left out. Nothing starts. The answer is a quote:
   `{"confirm_required": true, "credits": 12, "credits_available": 100,
   "enough_credits": true, "message": "Nothing started. ..."}`.
2. Tell the user the price and what will happen, in one or two sentences.
3. When the user agrees, call the same tool with the same arguments and `confirm: true`.

The user agrees when they say yes to the quote, or when they asked for this exact work at
this price earlier in the conversation. Never confirm a spend the user did not ask for.
Ask before you make a job bigger: more clips, a longer video or a higher quality.

- `enough_credits: false` means the call would be refused. Tell the user to add credits.
- `capped_by_balance: true` (clip runs only) means the run holds all the user has. It stops
  when the credits are used up.
- Credits are held when the work starts. Any part that fails gives its credits back.
- `credits_balance` shows the balance and what running work holds. The resource
  `brandsmith://pricing` lists the prices.

## Ids

- Brandsmith ids are UUIDs, for example `3f2b9c1e-0a4d-4c5e-9b7a-2d1e8f6a4b3c`.
- A YouTube video id has 11 characters, for example `dQw4w9WgXcQ`.
- A clip in review has one `id`. The same id names its titles and covers.
- An uploaded file has a media id (`upload_file`). Use it as `product_image_id`, as an
  image input of `generate`, as `media_id` of `make_remix`, or in `upload_ids` of
  `make_clips`.

## Long work and polling

Runs, generations, explainers, UGC hooks, remixes, influencer videos and Studio makes run
in the background. The first answer comes at once, with an `id` and a `status`.

| Work | Status tool |
|---|---|
| `make_clips`, `start_run` | `run_status` |
| `generate`, `influencer_talk` | `generation_status` |
| `make_explainer`, `make_ugc_hook` | `video_status` with `kind: "production"` |
| `story_draft` | `get_story`, until `status` is "ready" |
| `make_remix` | `video_status` with `kind: "remix"` |
| a `studio` generate, auto or assemble | `studio` with `action: "get"` |

Poll every 30 seconds or more. A clip run of five videos takes about 10 to 20 minutes. An AI
video takes about 2 to 10 minutes. Tell the user the work is running and offer to check
back. Links such as `video_url` and `output_url` expire after a short time. Read the status
again for a fresh link.

## Lists and paging

Every list takes `limit` and `cursor`, and answers `next_cursor`. Pass `next_cursor` back as
`cursor` for the next page. It is null on the last page.

## Errors

A refused call is a tool error. Its text is a plain code or sentence.

| Error | What to do |
|---|---|
| `insufficient_credits` | Tell the user. They add credits in Settings, Billing. |
| `brand_not_ready` | The brand is still learning. Wait, or use no brand. |
| `stale_revision` | The angle is from an older brand profile. Make angles again. |
| "What should this ... video be about?" | No words with a brand. See below. |
| "... not found" | The id is wrong or belongs to another workspace. List again. |
| "this view of the workspace is read-only" | A platform admin view. Use a member's token. |
| "... is not available on this server" | That feature is off here. Tell the user. |
| "bad cursor" | Pass `next_cursor` exactly as it came. |
| a field name and a reason | Fix that input and call again. |

A start or a recipe with a brand and no words starts nothing. Its text ends with the 422
body as JSON, `{"detail": "What should this Maison Noir video be about?", "ideas": [...]}`.
Ask the user, or pass one idea as `prompt` (for a recipe, as the target's `topic`).
`manage_brand` "ideas" gives the same three ideas for free. The brand's name is never
the topic.

## Good practice

- Ask which niche, brand or account when it is not clear. `intel_browse` with
  `kind: "niches"`, `list_brands` and `social_accounts` with `action: "list"` give the
  choices.
- Show clips before you approve them. Approve only the clips the user chose.
- Keep the post times the user asked for. Without a time, `approve_clip` takes the
  account's next free daily slot.
- Give `reject_clip` the real reason. Brandsmith learns from it.
- Talk about credits. Brandsmith shows no money amounts and no vendor names to agents.

## Workflows

### Find and clip winners in my niche

```
intel_browse({"kind": "niches"})
list_outliers({"niche": "personal finance", "days": 14, "limit": 10})
make_clips({"video_ids": ["aaaaaaaaaaa", "bbbbbbbbbbb"], "clips_per_source": 3})
  -> {"confirm_required": true, "credits": 18, ...}   # tell the user: 18 credits
make_clips({"video_ids": ["aaaaaaaaaaa", "bbbbbbbbbbb"], "clips_per_source": 3,
            "confirm": true})
  -> {"id": "<run id>", "status": "queued", ...}
run_status({"run_id": "<run id>"})                     # every 30 s or more, until "done"
list_review({"run_id": "<run id>", "sort": "score"})
clip_extras({"id": "<clip id>", "action": "titles"})
approve_clip({"id": "<clip id>", "account_id": "<account id>",
              "title": "Nobody talks about this tax rule"})
```

### Make an explainer

```
explainer_styles({"action": "list"})                   # or read brandsmith://styles
make_explainer({"topic": "How compound interest works", "style": "paper", "seconds": 30})
  -> quote                                             # tell the user the credits
make_explainer({"topic": "How compound interest works", "style": "paper", "seconds": 30,
                "confirm": true})
  -> {"id": "<production id>", "status": "queued", ...}
video_status({"id": "<production id>", "kind": "production"})   # until "succeeded"
```

### Make a story video

```
get_story({"catalog": true})                           # templates, lengths, prices
story_draft({"source": "premise", "premise": "A lighthouse keeper hears a knock",
             "genre": "horror", "seconds": 90})
  -> quote                                             # a small draft price
story_draft({... same arguments ..., "confirm": true})
  -> {"id": "<story id>", "status": "drafting", ...}
get_story({"story_id": "<story id>"})                  # until "ready"; show the script
story_update({"story_id": "<story id>", "script": [...]})   # the user's edits
studio({"action": "get", "kind": "story", "id": "<story id>"})   # every picture and shot
studio({"action": "auto", "kind": "story", "id": "<story id>"})  # the full price
studio({"action": "auto", "kind": "story", "id": "<story id>", "confirm": true})
studio({"action": "get", "kind": "story", "id": "<story id>"})   # until the final is made
```

For an existing story, ask the user which `rights` apply (public domain, true events,
their own work, or licensed). Retelling someone else's copyrighted story needs permission.

### Re-cut a clip before you post it

```
studio({"action": "get", "kind": "clips", "id": "<run id>"})
  -> {"stages": [..., {"key": "shots", "items": [{"id": "clip:<moment id>",
       "params": {"segments": [[10.0, 32.0]], ...}}]}]}  # each clip's cut, in seconds
studio({"action": "edit", "kind": "clips", "id": "<run id>", "item_id": "clip:<moment id>",
        "params": {...}})   # {"segments": [[26.0, 28.0], [10.0, 32.0]]}: a teaser, the body
studio({"action": "generate", "kind": "clips", "id": "<run id>",
        "item_id": "clip:<moment id>"})
  -> {"confirm_required": true, "credits": 2, ...}     # tell the user the credits
studio({"action": "generate", "kind": "clips", "id": "<run id>",
        "item_id": "clip:<moment id>", "confirm": true})
studio({"action": "get", "kind": "clips", "id": "<run id>"})   # until the clip is "done"
```

### Make a video in the Studio, moment by moment

```
studio({"action": "start", "format_id": "product_asmr",
        "inputs": {...}})                              # the format's own inputs
  -> {"kind": "generation", "id": "<studio id>", "stages": [...]}   # every full prompt
studio({"action": "edit", "kind": "generation", "id": "<studio id>",
        "item_id": "shot:2", "prompt": "<the whole new prompt>"})
studio({"action": "rewrite", "kind": "generation", "id": "<studio id>",
        "item_id": "shot:2", "instruction": "make the pour slower"})
studio({"action": "check", "kind": "generation", "id": "<studio id>"})   # free
studio({"action": "generate", "kind": "generation", "id": "<studio id>",
        "item_id": "shot:2"})
  -> quote                                             # tell the user the credits
studio({... same arguments ..., "confirm": true})
studio({"action": "get", "kind": "generation", "id": "<studio id>"})   # until "done"
studio({"action": "auto", "kind": "generation", "id": "<studio id>"})  # the rest, quote
studio({"action": "assemble", "kind": "generation", "id": "<studio id>",
        "confirm": true})
```

To fix one moment of a finished video, call `studio` with `action: "get"` and the video's
`kind` and `id` (from `list_videos`), then edit and generate that one item.

To edit a finished video on its timeline (free), then update it:

The edits, as one list:

```
ops = [{"op": "trim", "part_id": "shot:1", "trim_in": 0.4, "trim_out": 3.2},
       {"op": "delete", "part_id": "shot:3"},
       {"op": "captions", "position": "top", "size": "large"},
       {"op": "music", "volume_db": -4, "fade_out": 1.5}]
```

```
studio({"action": "timeline", "kind": "production", "id": "<video id>"})
studio({"action": "edit_timeline", "kind": "production", "id": "<video id>", "ops": ops})
studio({"action": "undo", "kind": "production", "id": "<video id>"})   # or "redo"
studio({"action": "assemble", "kind": "production", "id": "<video id>"})   # quote: 0
studio({... same arguments ..., "confirm": true})   # a new final version
```

### Make the rest of a Studio video at once, and fix what fails

```
studio({"action": "quote_all", "kind": "generation", "id": "<studio id>"})
  -> {"confirm_required": true, "credits": 90, "lines": [...]}   # a line per moment
studio({"action": "generate", "kind": "generation", "id": "<studio id>",
        "confirm": true})                              # holds every price, makes a few
studio({"action": "get", "kind": "generation", "id": "<studio id>"})
  -> each item's "progress": {"state": "waiting" | "making", "percent", "step"}
  -> a failed item has "refunded_credits" and up to three "fixes":
     {"label": "Simplify the action", "action": "rewrite", "instruction": "..."}
studio({"action": "rewrite", ..., "item_id": "shot:1", "instruction": "<the fix's>"})
studio({"action": "generate", ..., "item_id": "shot:1"})   # quote, then confirm
```

Each item has its prompt in `prompt_parts`. To change one part, send `edit` with
`parts: {"camera": "a slow orbit"}`. Each version says its `changed_parts`. Use
`hide_version` to tidy the list, and `make_from_version` to make an older prompt again.
A shot with a `start_from` can start from an upload or a frame of its clip, for free:
`start_from` with `params: {"start_from": "upload", "media_id": "<image id>"}` or
`{"start_from": "frame", "at": 1.5}`. The next `generate` of that shot starts from it.

### Best quality or Save credits

Every final video is 1080p. Ask the user which one they want, with both prices:

- Best quality: the shots are made at 720p, then sharpened to 1080p. Today's price.
- Save credits: the shots are made at 480p, then sharpened to 1080p, for about half the
  credits. Faces look a little smoother; products, scenes and text look the same.
- Native 1080p: the shots are made at 1080p, with no sharpening, priced from the real cost
  plus margin (about double). `quality_credits.native` is there only where it is offered.

One-click tools take it in `creative`, e.g. `"creative": {"quality_mode": "save"}`. Their
quote has `quality_credits` with both prices; `save` is null where a model cannot make 480p
(a talking video, or a quality level whose model starts at 720p). In the Studio,
`generate` (of one shot or of several) and `auto` take
`quality_mode` "best", "save" or "native";
each shot has `quality_credits`, and `faces: true` marks a close-up of a person, where Best
quality is recommended. A shot's own size, including native 1080p, is its
`params.resolution`, changed with `edit`. A made beat has a `badge` that says the truth,
such as "1080p · sharpened from 720p".

### Briefs and ingredients

Each beat of a Studio video has a `brief`: the ingredients on its frame, its motion marks,
its key frames and its scene lines. Its prompt is written from the brief like a director's
brief. `studio` actions `brief`, `set_brief`, `draft_brief`, `keep_guesses`, `add_frame`,
`remove_frame` and `make_frame` work on it; only `make_frame` costs (the still price, quoted
first). The `library` tool lists, makes, changes and deletes ingredients; the platform's
built-ins start with `pl_`.

### Schedule this week

```
social_accounts({"action": "list"})
list_review({"status": "pending", "sort": "score", "limit": 10})
approve_clip({"id": "<clip 1>", "account_id": "<account id>", "title": "...",
              "when": "2026-12-01T18:00:00Z"})
approve_clip({"id": "<clip 2>", "account_id": "<account id>", "title": "..."})
list_posts({"start": "2026-11-30T00:00:00Z", "end": "2026-12-07T00:00:00Z"})
manage_post({"post_id": "<post id>", "action": "reschedule",
             "when": "2026-12-03T18:00:00Z"})
```

## Tool reference

Each tool's own description has its inputs with examples, its answer, its cost and its errors. A tool with a `confirm` input can spend credits.

| Tool | What it does | Can spend credits |
|---|---|---|
| `approve_clip` | Approve a clip and schedule its post on a connected social account. Free. | no |
| `brand_pronunciation` | Read or set how voice-overs say a brand's hard words. Free. | no |
| `clip_extras` | Titles, covers, AI thumbnails, layout and test variants of one clip. Free, except | yes |
| `connected_channels` | Read the workspace's own connected YouTube channels and their video stats. Free. | no |
| `credits_balance` | Show the workspace's credits, and optionally the latest ledger entries. Free. | no |
| `explainer_styles` | Browse and manage explainer styles: the built-in ones and My styles. Mostly free. | yes |
| `generate` | Make a short video in one format from list_formats. Paid: spends credits. | yes |
| `generation_status` | Show one video from generate or influencer_talk. Free. | no |
| `get_story` | Read a story, list the user's stories, or show the story menu. Free. | no |
| `influencer_talk` | Make a talking-head video: an influencer says a script to camera. Paid. | yes |
| `influencers` | Find, make and shape AI influencers: made-up people who present videos. Some paid. | yes |
| `intel_browse` | Read the workspace's Intel: channels, niches, title patterns and more. Free. | no |
| `intel_manage` | Change which YouTube channels and niches the workspace tracks. Free. | no |
| `learn_defaults` | Set how Brandsmith uses what it learned for new clips. Free. | no |
| `library` | The Library: every reusable voice, track, upload, default and recipe, and the one | yes |
| `list_audio` | List voices, music tracks or sound effects to pass to the make tools. Free. | no |
| `list_brands` | List the workspace's brands: name, status and profile. Free. | no |
| `list_formats` | List the video formats generate can make, with inputs and credit prices. Free. | no |
| `list_outliers` | List YouTube videos that beat their own channel's usual views, best first. Free. | no |
| `list_posts` | List the posts on the calendar, in time order. Free. | no |
| `list_review` | List clips in the review queue. Free. | no |
| `list_runs` | List the workspace's clip runs, newest first. Free. | no |
| `list_videos` | List the videos the workspace made, newest first. Free. | no |
| `make_clips` | Cut short vertical clips from chosen videos. Paid: spends credits. | yes |
| `make_explainer` | Make an explainer: a narrated short video that explains one topic in a style. Paid. | yes |
| `make_remix` | Remix a reference ad: keep its structure and pacing, make new shots and words. Paid. | yes |
| `make_ugc_hook` | Make a UGC hook: a person reacts on camera under a big hook line. Paid. | yes |
| `manage_brand` | Learn a brand from its website, read or edit it, make ad angles, and keep its video | yes |
| `manage_post` | Move, cancel, label or copy one scheduled post. Free. | no |
| `manage_run` | Cancel a running clip run, or remove failed runs from the list. Free. | no |
| `manage_video` | Retry, remake, reassemble, hide or remove made videos. Retry and remake are paid. | yes |
| `publishing_settings` | Read or set the workspace's publishing defaults. Free. | no |
| `reject_clip` | Reject a clip with a reason. Brandsmith learns from the reasons. Free. | no |
| `results` | Read how posted videos did, and what Brandsmith learned from them. Free. | no |
| `run_status` | Show a clip run's progress. Free. | no |
| `social_accounts` | List and manage the social accounts that posts go to. Free. | no |
| `start_run` | Pick the best recent outliers of a niche and cut clips from them. Paid: credits. | yes |
| `story_draft` | Start a story video, or have the AI write a part of one. Paid (a small price). | yes |
| `story_update` | Edit any part of a story: its outline, sheets, script, voice, look or length, or | yes |
| `studio` | Make any video stage by stage, or fix one moment of a finished video. Paid: the | yes |
| `upload_file` | Upload a photo or a video so the make tools and clip runs can use it. Free. | no |
| `video_status` | Show one made video: its status, its parts, its credits and its link when ready. Free. | no |
