@awesomate/hosting-mcp
Version:
Awesomate MCP server — lets Claude manage your Awesomate WordPress hosting, plan, limits, n8n automations, and build Node/static apps + databases
88 lines (66 loc) • 10.7 kB
Markdown
# Bringing in a Vimeo or Wistia library
The owner's videos already live on Vimeo or Wistia. You can do the whole job with them: list the library, look through it, count a choice, save it, start it when that is free, follow it to the finish, and bring single videos in by link. Two tools:
- `awesomate_knowledge_videos` reads, and is free: `connections`, `imports`, `import`, `folders`, `videos`, `count`, `check_links`, `links_status`.
- `awesomate_knowledge_videos_change` changes: `list_library`, `refresh`, `choose`, `start`, `pause`, `resume`, `cancel`, `team_request`, `add_links`.
Pro and above. Choosing and links need the video picker (feature `video_library_picker`): without it, `list_library`, `refresh`, `folders`, `videos`, `count`, `choose`, `team_request`, `check_links`, `add_links` and `links_status` answer `feature_unavailable`: say its sentence in one line and stop. Never retry it. `connections`, `imports`, `import`, `start`, `pause`, `resume` and `cancel` need Pro only.
## The money rules
- **You never pay, and you never say anything was paid.** `start` only starts what charges nothing: every chosen video has captions, or this import's transcription is already paid for. When starting with transcription would charge, the answer is `prepared: true` with `charge_aud` and `finish_in_hub`: nothing started and nothing was charged. Give the user the amount and the link, and tell them the owner presses Start there. When `owner_task.given` is true, the owner also has a task in Tasks that opens it.
- **Without transcription is free, but it can't be undone.** Videos without captions come in without their words, and they are never transcribed later. `start {transcribe:false}` on a choice with such videos answers `needs_confirm` with `untranscribed_hours`. Say it plainly ("3.2 hours of these have no captions; started this way they come in without their words, for good"), and only if they agree in so many words, send `start` again with `transcribe:false` and `confirm` set to the account slug.
- **Links use the month's media hours; an import doesn't.** A video without captions added by link is transcribed out of this month's media hours. When a choice's uncaptioned hours fit what's left (`check_links` gives `media_hours_left`), you may offer that beside the paid start. The quoted import holds its chosen videos (`check_links` reads them `chosen_in_import` and `add_links` skips them), so this way means stopping the import first: "Starting this with transcription is A$15. Or, since 3.2 hours fit this month's media hours, I can stop this import (nothing is charged, caption answers are kept) and add those videos one by one instead." Only with their yes.
- Get the user's yes before `choose`, `start`, `team_request` or `add_links`, always with the videos and hours said first.
- Never retry a 402 or 403.
## What stays in the hub
Give the link from the answer (`.../knowledge/library/videos?import=<id>`):
- **Connecting a library.** It takes the provider's token. Never ask for a token in chat, and never take one if the user pastes it: send them to the hub page, where they connect it themselves.
- **A paid start**, as above.
- **Stopping an import that has a payment on it.** `cancel` answers `finish_in_hub`: the owner stops it there.
- **A team member's key** can't start an import (`key_not_yet` or `owner_only`). Give them the link to send the owner.
## The steps
1. **Is a library connected?** `awesomate_knowledge_videos {action:'connections'}`. None: send the user to the hub page to connect one, and stop.
2. **Find or start the import.** `{action:'imports'}` lists them, newest first. A library has one live import at a time (listing, choosing, checking, quoted, running, paused). If there is none for the library, `awesomate_knowledge_videos_change {action:'list_library', provider:'wistia'}` lists it newest first. When the library already has an import under way, the answer says `existing: true`, gives that import and says what can be done with it now (browse and choose, wait for the list or the quote, `refresh` a whole-library one to choose from it, or nothing until it finishes or is stopped in the hub): use it, never start another.
3. **Wait for the list.** `{action:'import', importId}` gives `progress_words`, one sentence to relay as it is ("Reading the library: 1,200 of about 3,000 listed so far."). Ask again in a minute; once the state is `choosing`, the library can be browsed. A list that is old (new uploads missing) is listed again with `refresh`.
4. **Look through it with the user.**
- `{action:'folders', importId}`: each folder's videos, hours and size, subfolders included.
- `{action:'videos', importId, folderId?, q?, from?, to?, show?, sort?, cursor?, limit?}`: a page of videos, newest first by default. Each has a `state` (available, in, cannot, in_progress), its length, size, and `captioned` (null until chosen: captions are checked on the chosen videos only). Read `next_cursor` for the next page; a page is never the whole library.
5. **Count before choosing.** `{action:'count', importId, rule}` saves nothing. It answers `videos`, `hours`, `bytes`, `captioned_hours`, `uncaptioned_hours`, `unknown_caption_videos` (captions not checked yet) and `fits_room` (false: bigger than the storage left; null: not known yet).
6. **Tell the user and get their yes.** Use their words, for example: "That's 40 videos, 12.5 hours, about 50 GB. 2 hours already have captions; 10.5 hours don't, and 3 videos haven't been checked yet. Shall I choose these?"
7. **Choose.** `awesomate_knowledge_videos_change {action:'choose', importId, rule}` with the same rule. A new choice replaces the last one and its quote: if someone else chose the current videos, say so before replacing them. The import moves to checking captions, then it is quoted: read `import` again in a minute.
8. **Read the quote.** `import`: its `quote`, `transcription` {blocks, amount, paid}, and `start` {with_transcription {charge_aud, free}, without_transcription {untranscribed_hours}, fits_storage, finish_in_hub (the link to give the user)}. `free: 'captioned'` or `'paid'` means starting with transcription charges nothing.
9. **Start, or prepare.** With the user's yes, `start {importId, transcribe:true}`. A free start answers `started: true`. A paid one answers `prepared: true`: say "Nothing's been charged. Starting it with transcription is A$15 for these 12.5 hours; you press Start here: <link>. You also have a task in Tasks for it." Never "I've started it" or "I've charged".
10. **Follow it.** `import` again gives `progress_words`, one sentence to relay ("12 of 40 in. Copying 2, transcribing 1, 22 waiting."). When it finishes, say what came in and what couldn't (`problems`, grouped by reason). The owner is emailed when it ends too.
11. **Pause, resume, stop.** `pause` keeps what's in and copies nothing new; `resume` carries on; `cancel` stops it (videos already in stay, and caption answers are kept). A big library the user would rather hand over: `team_request` (their yes first) raises one ticket on our desk and charges nothing; give them the ticket link.
## Single videos by link
1. `awesomate_knowledge_videos {action:'check_links', urls:[...]}` (or `provider` + `providerIds`), up to 100. It adds nothing. Each link has a `state`: `new` (would come in), `in` (already in Knowledge), `in_progress`, `chosen_in_import` (an import will bring it), `not_listed` (its length is known once the library is listed: `list_library` first), `refused` (with the reason: several videos, YouTube, not a video link). It gives the totals, `media_hours_left` (about) and `uncaptioned_fit` (how many of those without captions fit, in the order given).
2. Tell the user: "8 videos, 5.5 hours. 3 have captions. The other 5 need 4.2 hours of transcription, and this month has about 4.8 left, so all of them fit." Stay inside the hours with a margin: the figure trails a little.
3. With their yes, `awesomate_knowledge_videos_change {action:'add_links', ...}` with the same links. Each is `queued`, `skipped` (with why), `refused`, or `not_sent`. `stopped` says why a run stopped: `time_limit` (send the `not_sent` ones again), `rate_limited` (wait `retry_after`, then send them again), anything else (relay it and don't resend).
4. Follow them with `links_status {provider, providerIds}`. A video without captions that needed more than the month had left comes back `available` with the problem "needs 1.5 hours of transcription and this month has 0.5 left": it wasn't added. Say so; it can be added again next month or after a media-hours pack. Never add again a video that reads `in`.
## The rule
A rule starts from one of these, and may combine them:
| Key | Takes |
|---|---|
| `all: true` | every video in the library |
| `folderIds` | these folders, with their subfolders (ids from `folders`) |
| `providerIds` | these videos (`provider_id` from `videos`) |
Then narrows or cuts:
| Key | Does |
|---|---|
| `from`, `to` | uploaded on or after, and up to and including, these days (`YYYY-MM-DD`) |
| `q` | titles containing these words |
| `excludeIds` | never these videos |
| `newest` | only the newest N of what is left |
| `maxBytes` | keep it under a size (the hub's "Fit to my storage") |
"The newest 10" is `{all: true, newest: 10}`. "Everything in Webinars from this year" is `{folderIds: ['<id>'], from: '2026-01-01'}`. An unknown key is refused before anything is sent: a typo must never widen a choice someone pays for.
## When it says no
| Answer | What to say |
|---|---|
| `not_connected` | Connect the library in the hub first (link). |
| `charge_locked` | This import's transcription is paid for (or being paid), so its choice is fixed. Start it in the hub, then choose more once it's done. |
| `busy` | Someone else is changing this import right now. Try again in a minute. |
| `wrong_state` / "has moved on" | The import has started or ended. Read `imports` again. |
| A 403 naming `knowledge:write` | This key can read and count, not choose. Whoever owns the account chooses, or makes a key that can. |
| `prepared: true` | Not a refusal: nothing was charged; give the amount and the link. |
| `needs_confirm` | Ask in so many words, then `start` with `confirm`. |
| `needs_more_storage` | The choice is bigger than the storage left: choose fewer, or choose again with `maxBytes` (Fit to my storage). |
| `transcription_paid` | Its transcription is paid for: start it with `transcribe:true`, which charges nothing more. |
| `not_quoted` | Not waiting to start (or its quote isn't ready): read `import` again in a minute. |
Never retry a 402 or 403.