> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postploy.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Postploy's MCP server for posting is https://api.postploy.com/mcp and signs in with OAuth. The REST API base URL is https://api.postploy.com/public/v1 and takes an API key as a Bearer token. The API calls channels accounts.

# MCP tools

> The tools Postploy gives your AI, and what each one takes.

You don't call these tools yourself. Your AI picks them when you ask for something. This page shows what it can do, and helps if you're building your own agent.

Each tool follows your permissions. If your role doesn't allow something, the tool returns an error your AI can read and explain.

## Posts

| Tool | What it does |
| - | - |
| `list_posts` | Posts in a time window or status group, the ones that need someone (waiting for approval, failed or blocked), or the ones in the trash. |
| `get_post` | One post: its status, time, text, media, feedback from a reviewer who sent it back, and its link once it's published. |
| `validate_posts` | Checks posts against platform rules without saving them, and returns errors and warnings for each. |
| `schedule_posts` | Creates posts. All of them are checked first, and if any is invalid, nothing is saved. Posts can be scheduled, saved as drafts, held for approval or published now. Posts that carry a slideshow can name it, and its card in Studio shows where it went out. Posts written from an idea can name it, and the Ideas board lists them under it. |
| `update_post` | Changes a post that hasn't been published: its text, media, time, channel or status. It can publish the post right away, which is also how your AI retries a failed post, and attach it to an idea or a slideshow. |
| `restore_posts` | Brings posts back from the trash. A post that never went out comes back as a draft. |
| `send_for_review` | Sends drafts or posts waiting for approval to someone outside your team, like a client. They approve each post or ask for changes from a link, with no account. Approved posts are scheduled for their times, and posts sent back come back as drafts with the reviewer's note. |

## Ideas

The Ideas board holds your team's ideas for posts, in columns your team names and orders, like New, In progress, Ready and Posted.

| Tool | What it does |
| - | - |
| `list_ideas` | The board's columns and their ideas, each with its notes, tags, media and the posts written from it. Your AI can search titles, notes and tags. |
| `get_idea` | One idea, with who added it and the posts written from it. |
| `add_ideas` | Adds ideas at the top of a column, in order. They show as added by you. |
| `update_idea` | Changes an idea's title, notes, tags or media, moves it to another column, or puts it where you want in its column. |
| `update_idea_columns` | Adds, renames, reorders and removes the board's columns. Ideas in a removed column move to the end of the first one. |

## Library

| Tool | What it does |
| - | - |
| `list_media` | Your media library and its collections, newest first, with a small picture of each photo so your AI can see what it's choosing. It can show one collection. |
| `search_stock` | Searches free stock photos and videos, with a small picture of each result. |
| `import_media` | Copies an image or video from an `https` URL into your media library and returns its id, with a small picture of an image. |
| `update_media` | Renames a photo or video, or sets its alt text, which goes out with it on platforms that take alt text. |
| `save_collection` | Creates a collection, renames it, or adds and takes out photos and videos. |

To make images with AI, ask the Postploy assistant or use the media library in Postploy.

## Studio

A slideshow is a set of slides, like a TikTok or Instagram carousel. It follows a template: a reusable design with a size, a writing style, hooks and layouts. Hook layouts open each slideshow, body layouts fill the middle and closing layouts end it. A hook or closing layout can fill several slides in a row, set by its `slides`, and each slide in the middle takes the body layout that suits its words, so a template can open with three before-and-after slides and mix two kinds of middle slide.

| Tool | What it does |
| - | - |
| `get_design_guide` | Every field of a slideshow and a template, your team's fonts, the font catalogue any text can use, the frames, picture sources, sounds, Library collections and autopilot channels your AI can use, and pictures of Postploy's fonts, the ones your team uploaded and the frames. Give it `fonts`, like `"grotesk"`, to look up catalogue families by name, with the id of each weight. |
| `list_templates` | Your team's templates and Postploy's. Each layout lists its layers back to front: text spots with sample words and how each one looks, picture spots, shapes, lines and drawings. |
| `get_template` | One template, with a picture of each layout. |
| `create_template` | Saves a new template from layouts your AI designs, and returns a picture of each layout. |
| `design_template` | Has Postploy design a new template, like **New template** in Studio: it copies a TikTok or Instagram post from its link or from screenshots, follows a description of the look, or learns from one of your slideshows. Returns a picture of each layout. Uses AI credits. |
| `update_template` | Changes anything on a template, from a list of changes, copies it or stars it. Changing one of Postploy's templates saves your team's own copy. |
| `list_slideshows` | Your team's slideshows, with their template, status and the post they went out in. |
| `get_slideshow` | One slideshow and its slides, with a picture of each slide. If Postploy is still making it, it waits. |
| `make_slideshow` | Makes a slideshow in a template, from your AI's words, photos and found pictures, or written by Postploy from a prompt, like **Make** in Studio. |
| `update_slideshow` | Changes anything on a slideshow, from a list of changes, or copies it. |
| `save_slideshow` | Saves a slideshow to your media library as photos, one per slide, or as a video with its sound, and returns their ids for posts. |

A slide or layout is a photo or a colour with `layers` stacked on it, back to front. Each layer has a `kind`:

* `text`: words in a font, size, colour and style.
* `image`: a picture, such as an app screen in a phone frame or a product. The frames are a phone, a browser window and an instant photo.
* `shape`: a square, circle, triangle, star, heart, speech bubble, burst or block arrow, with a `fill` and a `stroke`, either of which can be `null`. A shape can fade out towards one edge: `fade` is `top`, `bottom`, `left` or `right` (or `none` to keep it solid), and `fadeLength` is how much of it fades, as a percent measured from that edge, so a dark panel at the foot of a photo with `"fade": "top", "fadeLength": 50` is solid in its lower half and fades away above it.
* `line`: from one point to another, solid, dashed or dotted, with an arrow or a dot at either end.
* `draw`: a freehand stroke in pen, marker or highlighter.

Every layer can be turned (`rotation`, in degrees), faded (`opacity`), given a `soft` or `hard` `shadow`, `locked` in place or `hidden`.

A text can be bold, italic or underlined, and words within it can have their own font, colour, weight, italic, underline, highlight or size. A text is a list of runs, each with its words and optionally a `font`, a `color`, `bold`, `italic`, `underline`, a `mark` (a highlighter colour behind the words, or `null` for none) and a `scale` (its size as a multiple of the rest of the text, like `0.6` for a small note after a big price). So `[{"text": "8 "}, {"text": "underrated", "font": "instrument-serif", "italic": true}, {"text": " apps"}]` sets "underrated" in a second font, in italics, and `[{"text": "Oat milk is "}, {"text": "free", "mark": "#fde047"}]` highlights "free" in yellow.

A text also has `tracking`, extra space between its letters as a percent of its size, like `12` for spaced-out capitals, and an `anchor`: `top`, `middle` or `bottom`, the edge its `y` holds, so a text grows down, both ways or up when its words get longer. Words can show the slide's place: `{slide}` becomes its number and `{slides}` the number of slides, so `"{slide} / {slides}"` reads `2 / 8`. Postploy fills them in, and when it writes a slideshow it leaves those texts as they are.

Layers can follow each other. A text, picture, shape or line with `below` (`{"ids": [...], "gap": 2}`) sits under the lowest of those layers, `gap` percent of the slide's height below it, so stacked pieces never overlap when words get longer. Layers that follow the same layers with the same gap move together. A shape with `around` (`{"ids": [...], "top": 2, "right": 3, "bottom": 2, "left": 3}`) is a box around those layers, like a card behind some texts, padded on each side by a percent of the slide's width, and grows with them. Set either to `null` to place the layer by its own position.

A layout can repeat some of its layers as `rows`, like a table's rows or a list's items: `{"ids": [...], "gap": 1.5, "most": 6, "more": [...]}`. `ids` are the layers that make the first row, `gap` is the space between rows as a percent of the slide's height, `most` is the most rows one slide can have, and `more` holds sample words for the rows after the first. Each row sits under the one before it and keeps its layers' places among themselves.

A `font` is one of your team's fonts (Postploy's, the ones your team added and the ones it uploaded) or any family from the font catalogue, Google Fonts, by its id: the family's name in lowercase with dashes, like `dm-serif-display`. That takes the family's bold weight, or its heaviest if it has no bold, with its regular weight for words that aren't bold. For another weight, add a colon and the weight from 100 to 900, like `montserrat:900` for Montserrat Black. A family used on a slide or layout joins your team's fonts. Fonts with their own italics, like Instrument Serif, Playfair Display and most catalogue families, draw italic words with them.

Each layout's background and each of its pictures say where a new slideshow gets its picture: a picture source, the same picture every time, or nothing. Backgrounds come from `library`, `stock`, `web` or `ai`. `web` finds a picture on the web, like a logo, a badge, a product or a real place, from a link or from words like `"Google Play badge"`, and keeps the page it came from. Pictures can also come from `app-screen` or `app-icon`, which fill a picture spot with an app's screenshot or icon. A layout or picture spot that takes `library` photos can pick them from one Library collection with its `collectionId`, or from all of them with `null`, so each kind of slide can use its own collection. `get_design_guide` lists the sources, says which of them can fill a background and which take a collection, lists your collections, and says what each source wants to be told, like a short photo search or an app's name. It also says which sources use AI credits for every picture they find, like `ai` and `web`, so your AI uses them only when you ask for them. Each background and picture spot also has a `query`: sample words for what its pictures show, like `"latte art on a wooden table, warm light"`. It's `""` only when the spot has no picture source. The words found its example picture, and when Postploy writes a slideshow it writes each slide's own words like them, so the pictures keep the template's style. If a picture can't be found or made, its spot is left empty and the rest of the slideshow is still made.

When Postploy writes a slideshow from a prompt and it needs facts it can't know without the web, like prices, news or the real apps or places it names, it looks them up on the web first. Changes asked for in the editor look facts up the same way when they need them. The slideshow's `sources` lists the pages the facts came from, and each picture found on the web keeps its own page.

### Changing slideshows and templates

`update_slideshow` and `update_template` take `changes`: a list of [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) operations on the slideshow or template as `get_slideshow` or `get_template` returns it. The operations are `replace`, `add`, `remove`, `move` and `copy`, and each path is a JSON pointer such as `/slides/0/fill`. They run in order, each on the result of the ones before, and an empty list changes nothing. Anywhere a `mediaId` goes, your AI can give `{"find": {"source": "...", "query": "..."}}` to get a new picture from a picture source. A find can add `"collectionId"` to pick from one Library collection; otherwise a find inside a layout or picture spot uses that one's `collectionId`. Postploy looks for pictures only once the changes fit, and saves only the fields they change.

```json theme={null}
{
  "id": "6c1f…",
  "changes": [
    { "op": "replace", "path": "/slides/0/fill", "value": "#ffffff" },
    { "op": "replace", "path": "/slides/0/mediaId", "value": null },
    {
      "op": "add",
      "path": "/slides/1/layers/-",
      "value": {
        "kind": "image",
        "id": "phone",
        "mediaId": { "find": { "source": "app-screen", "query": "Notion" } },
        "frame": "phone",
        "x": 50, "y": 60, "w": 40, "aspect": 2, "corners": "square"
      }
    },
    {
      "op": "add",
      "path": "/slides/1/layers/0",
      "value": {
        "kind": "shape",
        "id": "band",
        "shape": "rect",
        "x": 50, "y": 20, "w": 100, "aspect": 0.2, "fill": "#fde047"
      }
    }
  ]
}
```

If a change points at something that isn't there, or the result isn't a slideshow Postploy can draw, nothing is saved and the error names the change or the field, like `/slides/0/fill: Use a colour like #ffffff`.

The slideshow tools also return `fit`: where each layer landed on each slide. It says how many lines a text takes, whether a layer runs off the slide, which parts of a platform's screen cover it (like TikTok's buttons) and which other layers it overlaps. Your AI uses it with the pictures to fix a slide before you see it.

## Channels and brand

| Tool | What it does |
| - | - |
| `list_accounts` | The channels you can post to, with their ids and platforms. Ask for `postChoices` to also get what each can post right now, read live from its network: for TikTok, who can see a post, the interactions the account allows and its longest video. |
| `list_channel_sets` | Named groups of channels your team posts to together, so you can say "post this to Launch channels". |
| `save_channel_set` | Creates a channel set, renames it or changes its channels. |
| `get_platform_rules` | What each platform accepts: text length, media counts, file sizes, video lengths and post options. |
| `get_brand_voice` | Your team's brand voice from Postploy: the brand, who it's for, its tone, words to avoid, emoji and hashtags, language and example posts. Your AI reads it before writing, so posts sound like you. |

## Clean up

| Tool | What it does |
| - | - |
| `delete` | Deletes posts, ideas, media, collections, slideshows, templates or channel sets, and says what happens to what's left. A post whose time has passed moves to the trash, and posts are never removed from the platform. Posts that used a deleted photo or video stay, without it. Deleting a collection or a channel set keeps its media or channels. |

## Inputs

The tools take the same fields as the [REST API](https://docs.postploy.com/api/posts.md). Expand a tool to see its inputs.

> [accordion] get\_platform\_rules
>
> * `platform` (optional): one of `linkedin`, `twitter`, `instagram`, `facebook`, `tiktok` or `youtube`. Leave it out to get every platform.

> [accordion] list\_posts
>
> * `from`, `to`: a time window, as ISO 8601. Give both or neither.
> * `statusGroup`: any of `draft`, `approval`, `scheduled`, `published` and `failed`.
> * `attention`: `true` for posts that need someone.
> * `trashed`: `true` for the posts in the trash.
> * `sort`: `desc` (newest first, the default) or `asc`.
> * `page` (from `0`) and `limit` (up to 100).

> [accordion] get\_post
>
> * `id`: the post's id.

> [accordion] validate\_posts
>
> * `posts`: up to 50 posts. Each has a `socialAccountId`, or just a `platform` while you're planning, plus `text`, `title`, `mediaIds`, `thread` and `platformFields`.

> [accordion] schedule\_posts
>
> * `posts`: up to 50 posts. Each has `socialAccountId`, `text`, and optionally `title`, `mediaIds`, `scheduledAt`, `timezone`, `status`, `thread` and `platformFields`.
> * `publishNow`: `true` to publish right away.
> * `slideshowId` (optional): the slideshow these posts carry, after `save_slideshow` put its slides in your media library.
> * `ideaId` (optional): the idea these posts are written from.
>
> `scheduledAt` is required unless `status` is `draft` or `publishNow` is `true`.

> [accordion] update\_post
>
> * `id`: the post's id.
> * Any of `socialAccountId`, `text`, `title`, `mediaIds`, `scheduledAt`, `timezone`, `status`, `thread` and `platformFields`. Fields you leave out keep their values.
> * `publishNow`: `true` to publish it right away. For a failed post, that tries again; fix what its `failureReason` says first.
> * `ideaId` or `slideshowId` (optional): attaches the post to an idea or a slideshow.

> [accordion] restore\_posts
>
> * `ids`: up to 100 posts' ids from `list_posts` with `trashed`.

> [accordion] send\_for\_review
>
> * `postIds`: up to 50 drafts or posts waiting for approval.
> * `reviewer`: the reviewer's name. Someone your team has sent posts to before keeps the same link.
> * `email` (optional): where to email the link. Leave it out to share the link yourself.
> * `message` (optional): a note shown with the posts and in the email.
>
> It returns the reviewer and their link. A post out for review shows who it's waiting on in `review`.

> [accordion] list\_media
>
> * `search` (optional): words in file names and descriptions.
> * `type` (optional): `image`, `video` or `audio`.
> * `collectionId` (optional): just the files in one collection.
> * `page` (from `0`) and `limit` (up to 30, 12 by default).
>
> It also returns your collections, with how many files each holds.

> [accordion] update\_media
>
> * `id`: the file's id.
> * `fileName` and `altText` (optional). An empty `altText` clears it.

> [accordion] save\_collection
>
> * `id` (optional): the collection to change. Leave it out to create one, with a `title`.
> * `title` and `description` (optional).
> * `add` and `remove` (optional): ids of photos and videos to put in or take out. They stay in your media library either way.

> [accordion] search\_stock
>
> * `query`: what to look for, like `latte art close up`.
> * `kind` (optional): `image` (the default) or `video`.
> * `page` (from `0`) and `limit` (3 to 20, 12 by default).
>
> To use a result, pass its `url` to `import_media`.

> [accordion] import\_media
>
> * `url`: an `https` URL.
> * `fileName`: a name ending in `jpg`, `jpeg`, `png`, `webp`, `gif`, `mp4` or `mov`.

> [accordion] get\_template, get\_slideshow
>
> * `id`: the template's or slideshow's id.

> [accordion] create\_template
>
> * `name`: up to 60 characters.
> * `ratio`: the size of every slide, `9:16`, `4:5`, `1:1` or `16:9`.
> * `layouts`: the hook layouts, then the body layouts, then the closing layouts, at least one of each, shaped like the layouts `get_template` returns. Each has an `id` of your choosing, and a hook or closing layout can set `slides` to fill several slides in a row.
> * `writing`: how to write the words, like "First person, all lowercase".
> * `whenToUse`: what the template suits, like "Short lists of apps".
> * `hooks` (optional): first lines for slide 1 of future slideshows.

> [accordion] update\_template
>
> * `id`: the template's id.
> * `changes` (optional): JSON Patch operations on the template, as described in [Changing slideshows and templates](#changing-slideshows-and-templates). They can change its `name`, `ratio`, `layouts`, `writing`, `whenToUse`, `topics`, `photos` and `autopilot`.
> * `copy` (optional): `true` saves the result as a new template and leaves this one as it is. With no changes, that duplicates it.
> * `favourite` (optional): `true` stars it in Studio, `false` unstars it.
>
> With `autopilot` on, Postploy makes a slideshow in the template at each set time and posts it to its channels, following your team's approval rules.

> [accordion] make\_slideshow
>
> * `templateId`: the template's id.
> * `slides`: in order. The template's hook layouts take the first slides and its closing layouts the last ones, each for as many slides as it fills, and every slide between takes a body layout. Each slide has `texts`, the words for its layout's text spots in order, leaving out the texts in its rows and the ones that show the slide number, each as a string or as runs to give some words their own font, colour or size, make them bold or not, italic or underlined, or highlight them. Where the layout's sample words set some words apart, set apart the matching words of yours the same way. A text keeps to as many lines as its layout's sample words take, so longer words come out smaller. Optionally a slide also has:
>   * `layout`: for a slide between the hook and closing slides, the `id` of the body layout it takes. Left out, it takes the template's first body layout.
>   * `rows`: for a layout with rows, the words of each row in order, a list per row with the words for each of the row's texts. A slide takes at most the layout's `rows.most` rows.
>   * `photo`: the photo behind the slide, as the id of a photo in your media library, a `{"find": {"source": "...", "query": "..."}}` (with `"collectionId"` to pick from one Library collection), or `null` for just the colour. Left out, the slide keeps its layout's own photo when the layout has no picture source.
>   * `images`: the pictures for its layout's picture spots in order, as ids or finds, with `null` to leave a spot empty. Spots you leave out keep their layout's own picture when the spot has no picture source.
> * `title`, `caption` and `sound` (optional). `sound` is `{"kind":"track","id":"…"}` for one of Postploy's sounds or `{"kind":"upload","mediaId":"…"}` for one of yours, and plays in the video.
>
> To have Postploy write it instead, like **Make** in Studio, leave out `slides` and give:
>
> * `count`: how many slides, 3 to 10.
> * `prompt` (optional): what it's about. Left out, Postploy starts from the template's next hook or topic.
> * `photos` (optional): where this slideshow's background photos come from. `backgrounds` is `template` to keep each layout's own (the default), `colour` for just the colour, or a picture source id for every layout that shows a photo. With `library`, `collectionId` picks one Library collection, or `null` all of it; with anything else it's `null`.
>
> Writing takes about a minute and uses AI credits. If it isn't done by then, the slideshow comes back with `state` set to `making`, and `get_slideshow` with its id waits for the rest.

> [accordion] update\_slideshow
>
> * `id`: the slideshow's id.
> * `changes` (optional): JSON Patch operations on the slideshow, as described in [Changing slideshows and templates](#changing-slideshows-and-templates). They can change its `title`, `brief`, `caption`, `ratio`, `sound` and `slides`.
> * `copy` (optional): `true` saves the result as a new slideshow and leaves this one as it is. With no changes, that duplicates it.

> [accordion] save\_slideshow
>
> * `id`: the slideshow's id.
> * `as`: `photos` or `video`.
>
> It waits until the files are ready, then returns them.

> [accordion] design\_template
>
> * `from`: what Postploy designs it from: `post`, `screenshots`, `described` or `slideshow`.
> * `url`: with `post`, the link to a TikTok or Instagram post.
> * `mediaIds`: with `screenshots`, a picture of each slide from your media library, in slide order.
> * `text`: with `described`, how it looks, like where the words go and how they're styled.
> * `slideshowId`: with `slideshow`, the slideshow's id, plus an optional `name` and `whenToUse`.
>
> Once a copied post or screenshots are designed, Postploy draws each layout, compares it with the post's slides and fixes what differs, like the size and place of each piece of text, highlighted words, dividers, shapes, photos fading into a colour and tilt. Pieces of text that sit right under each other, like a headline and its paragraph, are linked with `below`, so they stay together when a slideshow's words are longer or shorter. The post's slides stay with the template, so asking for a change to it can bring a slide closer to the post.
>
> A copy uses AI credits for its design and for the check against the post, and it starts only when your team has enough left for both. Otherwise it stops at once with the error, before using any.
>
> Designing takes about a minute. If it isn't done by then, the template comes back with `state` set to `designing` and the step it's on, and `get_template` with its id waits for the rest. If Postploy can't open the post, for example because it's private or age-restricted, the error says so. Screenshots of its slides work instead.

> [accordion] get\_brand\_voice
>
> No inputs. It returns `voice`: your brand voice as text, including what your team hasn't set yet.

> [accordion] list\_ideas
>
> * `search` (optional): words in titles, notes and tags.
> * `columnId` (optional): one column's ideas.
> * `page` (from `0`) and `limit` (up to 100, 50 by default).

> [accordion] get\_idea
>
> * `id`: the idea's id.

> [accordion] add\_ideas
>
> * `ideas`: up to 20 ideas. Each has a `title`, and optionally `notes`, `tags` and `mediaIds`.
> * `columnId` (optional): the column to add them to. Left out, they go in the first column.

> [accordion] update\_idea
>
> * `id`: the idea's id.
> * Any of `title`, `notes`, `tags` and `mediaIds`. Fields you leave out keep their values, and `tags` and `mediaIds` replace the saved lists.
> * `columnId` (optional): moves the idea to that column, at the end unless `place` says otherwise.
> * `place` (optional): where it goes in its column: `top`, `end` or `{"after": "<idea id>"}`.

> [accordion] update\_idea\_columns
>
> * `columns`: every column to keep, left to right, each with its `id` from `list_ideas` and its `name`. A new name renames a column, a column without an `id` is added, and a column you leave out is removed. Up to 12 columns, each with its own name.

> [accordion] save\_channel\_set
>
> * `id` (optional): the set to change. Leave it out to create one, with a `name` and `accountIds`.
> * `name` and `accountIds` (optional). `accountIds` replaces the set's channels.

> [accordion] delete
>
> * Any of `posts`, `ideas`, `media`, `collections`, `slideshows`, `templates` and `channelSets`: up to 100 ids each.
>
> Each kind needs its own permission, like deleting posts or content, and the error names the one that's missing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.