> For the complete documentation index, see [llms.txt](https://docs.podigee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-tools/media-and-publishing.md). Agents can also search and read this documentation through its [MCP server](https://docs.podigee.com/~gitbook/mcp).

# Media and publishing tools

MCP tools that upload a recording or cover, encode media, and publish, schedule, or unpublish.

These tools move a file from the computer of the person to Podigee and attach a recording to an episode. They start and stop its encoding, and publish, schedule, or unpublish an episode. Most assistants need only two of them: `create_upload` for the file and `publish_episode` for the rest. The production tools are for an existing episode that gets a new recording without a publish.

Every Model Context Protocol (MCP) client gets the full JSON (JavaScript Object Notation) input and output schemas of each tool from `tools/list`. This page gives the contract, the parameters, the most useful output fields, one example, and the errors that each tool adds.

In the Required column, a value such as "Yes, for the preview" or "Yes, for the change" is a rule of the call. The JSON schema can show the field as optional.

| Tool                | What it does                                                                       | Scopes                                  | Read-only or write |
| ------------------- | ---------------------------------------------------------------------------------- | --------------------------------------- | ------------------ |
| `create_upload`     | Starts the upload of a recording or a cover image from the computer of the person. | `mcp:media:write`                       | Write              |
| `get_upload`        | Reads the state of an upload and gives a fresh address for the next part.          | `mcp:media:write`                       | Read-only          |
| `publish_episode`   | Publishes, schedules, or unpublishes an episode, and creates it when needed.       | `mcp:podcasts:write`, `mcp:media:write` | Write              |
| `create_production` | Attaches an uploaded recording to an existing episode.                             | `mcp:podcasts:write`, `mcp:media:write` | Write              |
| `start_production`  | Starts the encoding of a production.                                               | `mcp:podcasts:write`, `mcp:media:write` | Write              |
| `stop_production`   | Stops an encoding that runs.                                                       | `mcp:podcasts:write`, `mcp:media:write` | Write              |
| `get_production`    | Reads the encoding state of a production.                                          | `mcp:podcasts:read`                     | Read-only          |

Each section has a contract line. The values come from the tool annotations. "Open world" means that the tool can read or change something outside Podigee. The scope rules are on [Authorization and scopes](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/authorization-and-scopes.md). The rules for previews, confirm values, and idempotency keys are on [Preview and confirm changes](https://docs.podigee.com/documentation/start-here/ai-agents/work-safely/preview-and-confirm-changes.md).

This server never fetches a file from a link. A recording or a cover comes only from an upload. The file goes from the computer of the person straight to Podigee storage. The parts, the address lifetimes, and the upload quotas are on [Media upload protocol](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/media-upload-protocol.md).

## `create_upload`

`create_upload` starts the upload of a file on the computer of the person: a recording (audio or video) or a cover image. The answer has the address for the file and a shell command that sends it with one HTTP (Hypertext Transfer Protocol) `PUT` request. A very large file goes in more than one part; `part_count` says how many.

After the upload, a recording goes to `publish_episode` (or `create_production`) with its `upload_id`. A cover goes to `update_podcast` or `update_episode` as `attributes.cover_image_upload_id`. Use this tool only when the assistant can read the file and run commands. A chat app cannot do this: it gives the person the upload page instead, and `find_in_podigee` has its link. A cover is a square PNG or JPEG image, 1,400 to 3,000 pixels wide, up to 2 MB.

**Contract:** scope `mcp:media:write`. Read-only: no. Destructive: no. Idempotent: yes. Open world: yes.

| Parameter         | Type    | Required | Default              | Limits                                                                                                                                                                                                                                                          | Meaning                                                                                                                    |
| ----------------- | ------- | -------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `filename`        | string  | Yes      | None                 | 1 to 255 bytes (UTF-8); a file ending of 1 to 15 letters or digits; no slash, backslash, or control character                                                                                                                                                   | The file name with its ending.                                                                                             |
| `byte_size`       | integer | Yes      | None                 | 1 to 21,474,836,480 bytes (20 GiB)                                                                                                                                                                                                                              | The exact size of the file, for example from `wc -c < FILE`. The address is signed for this size; another size is refused. |
| `content_type`    | string  | No       | From the file ending | Audio: `audio/mpeg`, `audio/mp3`, `audio/x-m4a`, `audio/mp4`, `audio/aac`, `audio/ogg`, `audio/opus`, `audio/vorbis`. Video: `video/ogg`, `video/mp4`, `video/quicktime`, `video/x-matroska`, `video/x-msvideo`, `video/webm`. Image: `image/png`, `image/jpeg` | Leave it out. The file ending decides it.                                                                                  |
| `idempotency_key` | string  | Yes      | None                 | 1 to 128 characters                                                                                                                                                                                                                                             | Any unique text for this upload. The same key with the same file returns the same upload.                                  |

| Output field                                 | Meaning                                                                                  |
| -------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `upload_id`                                  | The ID of the upload. Send it to the tool that uses the file.                            |
| `state`                                      | The state of the upload, for example `pending`, `uploading`, or `completed`.             |
| `part_count`, `part_size`, `completed_parts` | How many parts the file has, the size of a part, and the parts in storage.               |
| `next_part.command`                          | The shell command that sends the next part. `FILE` stands for the path of the file.      |
| `next_part.url`, `next_part.expires_at`      | A short-lived address for the part. Use it in the command. Do not show it to the person. |
| `expires_at`                                 | When the upload ends.                                                                    |
| `next_step`                                  | What to do next.                                                                         |

Example request:

```json
{
  "filename": "episode-12.mp3",
  "byte_size": 48213504,
  "idempotency_key": "upload-episode-12"
}
```

Errors:

* `invalid_params`: the file name, the size, or the media type is not accepted, or the file needs more parts than allowed.
* `upload_quota_exceeded`: the account has too many active uploads or reached a daily limit.
* `idempotency_conflict`: the key was already used for another file.
* `upstream_unavailable`: storage did not answer. Try again later. `storage_forbidden` will not work on a retry.

The common errors are on [Limits, errors, and recovery](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/limits-errors-and-recovery.md).

## `get_upload`

`get_upload` reads the state of an upload that `create_upload` started. It says which parts are in storage, gives a fresh address for the next missing part, and says what to do next. Call it when an address expired, after each part of a file with several parts, or to check that the file arrived.

You do not need a separate step to finish an upload. The tool that uses the file checks that the file arrived and closes the upload.

**Contract:** scope `mcp:media:write`. Read-only: yes. Destructive: no. Idempotent: yes. Open world: yes.

| Parameter   | Type          | Required | Default | Limits                    | Meaning                                                                          |
| ----------- | ------------- | -------- | ------- | ------------------------- | -------------------------------------------------------------------------------- |
| `upload_id` | string (UUID) | Yes      | None    | An upload of this account | The ID that `create_upload` returned. A UUID is a universally unique identifier. |

The output fields are the same as for `create_upload`.

Example request:

```json
{
  "upload_id": "3f2b8c1e-7a4d-4e8f-9b2a-6c5d4e3f2a1b"
}
```

Errors: `not_found` for an upload that this account does not have. `validation_error` when the upload has expired; start a new upload. The common errors are on [Limits, errors, and recovery](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/limits-errors-and-recovery.md).

## `publish_episode`

`publish_episode` publishes an episode now, schedules it, or takes a live episode back to draft. With `episode_id` it acts on that episode. Without `episode_id` it makes a new episode from `episode_attributes`. An episode needs a recording to go live, and the recording comes from an upload (`create_upload`), never from a link.

`publication.mode` is one of these:

* `now` publishes at once.
* `scheduled` publishes at `published_at`. The time needs an offset. The person can name a time without a zone, such as "Tuesday at 7am". That time is in the time zone of the person (`time_zone` in `doctor`), never in UTC (Coordinated Universal Time). A time in the past is refused.
* `draft` takes a live or scheduled episode offline, or keeps a new episode unpublished. This is the reversible way to take an episode offline.

Send the request with `dry_run: true` first and show the preview to the person. The confirmed call returns a durable operation. Follow it with `get_operation` on [Import and operation tools](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-tools/import-and-operations.md). While the publish waits for the recording, the operation has `waiting`: tell the person what it waits for. After a failure, follow `recovery`. The rule for waiting and recovery is on [Follow and recover long-running operations](https://docs.podigee.com/documentation/start-here/ai-agents/work-safely/follow-and-recover-long-running-operations.md).

One episode can have only one active publish at a time.

**Contract:** scopes `mcp:podcasts:write` and `mcp:media:write`, for every mode, `draft` included. Read-only: no. Destructive: yes. Idempotent: yes. Open world: yes.

| Parameter                  | Type               | Required                                       | Default       | Limits                                                                                                                                                                                                                                                                               | Meaning                                                    |
| -------------------------- | ------------------ | ---------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------- |
| `podcast_id`               | integer            | Yes                                            | None          | A podcast of this connection                                                                                                                                                                                                                                                         | The podcast of the episode.                                |
| `episode_id`               | integer            | No                                             | A new episode | An episode of `podcast_id`                                                                                                                                                                                                                                                           | The episode to publish, schedule, or take offline.         |
| `episode_attributes`       | object             | For a new episode                              | None          | `title` (required for a new episode), `subtitle`, `description`, `show_notes`, `show_notes_md`, `authors`, `number`, `season`, `slug`, `explicit`, `external_url`, `publication_type`, `keywords`, `labels`. No chapter marks, transcript, or cover: set them with `update_episode`. | The texts and settings of the episode.                     |
| `media`                    | object             | For a new episode, or an episode without media | None          | `source` must be `upload`; `upload_id` of a completed recording upload                                                                                                                                                                                                               | The recording. Links are not fetched.                      |
| `publication`              | object             | Yes                                            | None          | `mode`: `now`, `scheduled`, or `draft`; `published_at` only with `scheduled`                                                                                                                                                                                                         | When and how the episode goes out.                         |
| `publication.published_at` | string (date-time) | With `scheduled`                               | None          | ISO 8601 with an offset; in the future                                                                                                                                                                                                                                               | The publication time.                                      |
| `dry_run`                  | boolean            | Yes, for the preview                           | None          | `true` for the preview                                                                                                                                                                                                                                                               | `true` shows the preview and changes nothing.              |
| `confirm`                  | string             | Yes, for the change                            | None          | From the preview                                                                                                                                                                                                                                                                     | Send it only after the person said yes in a later message. |
| `idempotency_key`          | string             | Yes, for the change                            | None          | 1 to 255 characters                                                                                                                                                                                                                                                                  | Any unique text for this publish.                          |

| Output field                             | Meaning                                                                                                                                                                                                              |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Preview: `plan`                          | The podcast, the episode, `create_episode`, the texts, the media, and the publication as Podigee will run them.                                                                                                      |
| Preview: `confirm`, `next_step`          | The confirm value and what to do with the preview.                                                                                                                                                                   |
| Result: `operation_id`, `state`, `stage` | The durable operation and where it is.                                                                                                                                                                               |
| Result: `waiting`, `recovery`            | What a waiting publish waits for, and the next step after a failure. The fields are on [Import and operation tools](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-tools/import-and-operations.md). |
| Result: `next_action`                    | The `get_operation` call to follow the operation.                                                                                                                                                                    |

Example request (preview):

```json
{
  "podcast_id": 42,
  "episode_attributes": {
    "title": "Episode 12: Cold brew at home"
  },
  "media": {
    "source": "upload",
    "upload_id": "3f2b8c1e-7a4d-4e8f-9b2a-6c5d4e3f2a1b"
  },
  "publication": {
    "mode": "scheduled",
    "published_at": "2026-11-24T07:00:00+01:00"
  },
  "dry_run": true
}
```

Errors:

* `validation_error`: one of these causes:
  * A new episode without a title or without media, or an episode without media and no `media`.
  * A media source other than `upload`, or an upload that is not usable or is a cover image.
  * An `episode_id` of another podcast.
  * `published_at` without `scheduled`, or a scheduled time in the past.
* `invalid_params`: `published_at` is not an ISO 8601 time, or the change has no `idempotency_key`.
* `forbidden`: the person may edit episodes of this podcast but may not publish, schedule, or unpublish them. That right belongs to their role on the podcast, not to the connection.
* `operation_in_progress`: the episode already has an active publish. The failed operation has the error code `episode_publish_in_progress`.
* `idempotency_conflict`: the key was already used for another publish.

The common errors are on [Limits, errors, and recovery](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/limits-errors-and-recovery.md).

## `create_production`

`create_production` attaches a file that you sent with `create_upload` to an existing episode, as a new production. The tool checks that the file arrived and closes the upload, also for the preview. A cover image upload is refused. For a new episode, or to publish in the same step, use `publish_episode`. After the production exists, start its encoding with `start_production`.

**Contract:** scopes `mcp:podcasts:write` and `mcp:media:write`. Read-only: no. Destructive: yes. Idempotent: yes. Open world: yes.

| Parameter         | Type          | Required            | Default | Limits                                         | Meaning                                       |
| ----------------- | ------------- | ------------------- | ------- | ---------------------------------------------- | --------------------------------------------- |
| `episode_id`      | integer       | Yes                 | None    | An episode of this connection                  | The episode that gets the recording.          |
| `upload_id`       | string (UUID) | Yes                 | None    | A completed recording upload of this account   | The ID that `create_upload` returned.         |
| `dry_run`         | boolean       | Yes                 | None    | `true` for the preview, `false` for the change | `true` shows the preview and changes nothing. |
| `confirm`         | string        | Yes, for the change | None    | From the preview                               | Send it only after the person said yes.       |
| `idempotency_key` | string        | Yes                 | None    | 1 to 255 characters                            | Any unique text for this change.              |

| Output field                                               | Meaning                                                                 |
| ---------------------------------------------------------- | ----------------------------------------------------------------------- |
| Preview: `episode_id`, `upload_id`, `confirm`, `next_step` | What will be attached, and the confirm value.                           |
| Result: `id`                                               | The production ID. Use it with `start_production` and `get_production`. |
| Result: `state`                                            | `initial`, `encoding`, `encoded`, or `error`.                           |

Example request (preview):

```json
{
  "episode_id": 1234,
  "upload_id": "3f2b8c1e-7a4d-4e8f-9b2a-6c5d4e3f2a1b",
  "idempotency_key": "attach-episode-12",
  "dry_run": true
}
```

Errors: `validation_error` when the upload is not usable (expired, not complete, or used for another episode) or is a cover image. `forbidden` when the person may not edit the episode. The common errors are on [Limits, errors, and recovery](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/limits-errors-and-recovery.md).

## `start_production`

`start_production` starts the encoding of a production. With `publish_episode: true`, Podigee publishes the episode when the encoding is done. A production that is encoding now is refused. A production that is already encoded can be encoded again.

This tool is not idempotent: each confirmed call starts an encoding. Follow the encoding with `get_production`.

**Contract:** scopes `mcp:podcasts:write` and `mcp:media:write`. Read-only: no. Destructive: yes. Idempotent: no. Open world: yes.

| Parameter         | Type    | Required            | Default | Limits                                         | Meaning                                                 |
| ----------------- | ------- | ------------------- | ------- | ---------------------------------------------- | ------------------------------------------------------- |
| `production_id`   | integer | Yes                 | None    | A production of this connection                | The ID that `create_production` returned.               |
| `publish_episode` | boolean | No                  | `false` | None                                           | `true` publishes the episode when the encoding is done. |
| `dry_run`         | boolean | Yes                 | None    | `true` for the preview, `false` for the change | `true` shows the preview and changes nothing.           |
| `confirm`         | string  | Yes, for the change | None    | From the preview                               | Send it only after the person said yes.                 |

| Output field                                        | Meaning                                                    |
| --------------------------------------------------- | ---------------------------------------------------------- |
| Preview: `production`, `publish_episode`, `confirm` | The production, the publish choice, and the confirm value. |
| Result: `state`, `job_id`                           | The state of the production and the encoding job.          |

Example request (preview):

```json
{
  "production_id": 5678,
  "publish_episode": false,
  "dry_run": true
}
```

Errors:

* `insufficient_encoding_minutes`: the plan has no encoding time left.
* `forbidden`: the person may not publish episodes of this podcast, which encoding needs. An organization admin can give the permission.
* `validation_error`: the production is encoding now. Wait until `get_production` says `encoded`.

The common errors are on [Limits, errors, and recovery](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/limits-errors-and-recovery.md).

## `stop_production`

`stop_production` stops an encoding that runs. It needs a preview and a confirmation.

**Contract:** scopes `mcp:podcasts:write` and `mcp:media:write`. Read-only: no. Destructive: yes. Idempotent: no. Open world: yes.

| Parameter       | Type    | Required            | Default | Limits                                         | Meaning                                       |
| --------------- | ------- | ------------------- | ------- | ---------------------------------------------- | --------------------------------------------- |
| `production_id` | integer | Yes                 | None    | A production of this connection                | The production to stop.                       |
| `dry_run`       | boolean | Yes                 | None    | `true` for the preview, `false` for the change | `true` shows the preview and changes nothing. |
| `confirm`       | string  | Yes, for the change | None    | From the preview                               | Send it only after the person said yes.       |

| Output field                     | Meaning                                     |
| -------------------------------- | ------------------------------------------- |
| Preview: `production`, `confirm` | The production and the confirm value.       |
| Result: `state`                  | The state of the production after the stop. |

Example request (preview):

```json
{
  "production_id": 5678,
  "dry_run": true
}
```

Errors: `forbidden` when the person may not publish episodes of this podcast. `not_found` for a production that this connection cannot see. The common errors are on [Limits, errors, and recovery](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/limits-errors-and-recovery.md).

## `get_production`

`get_production` reads the encoding state of a production. Call it after `start_production` until the state is `encoded` or `error`.

**Contract:** scope `mcp:podcasts:read`. Read-only: yes. Destructive: no. Idempotent: yes. Open world: no.

| Parameter       | Type    | Required | Default | Limits                          | Meaning                                   |
| --------------- | ------- | -------- | ------- | ------------------------------- | ----------------------------------------- |
| `production_id` | integer | Yes      | None    | A production of this connection | The ID that `create_production` returned. |

| Output field               | Meaning                                                          |
| -------------------------- | ---------------------------------------------------------------- |
| `state`, `status`          | `initial`, `encoding`, `encoded`, or `error`.                    |
| `episode_id`, `job_id`     | The episode and the encoding job.                                |
| `encoded_at`, `updated_at` | When the encoding finished and when the production last changed. |

Example request:

```json
{
  "production_id": 5678
}
```

Errors: `not_found` for a production that this connection cannot see. The common errors are on [Limits, errors, and recovery](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/limits-errors-and-recovery.md).

## Next step

* To upload a file step by step, read [Upload media and cover images](https://docs.podigee.com/documentation/start-here/ai-agents/media-and-publishing/upload-media-and-cover-images.md).
* To publish step by step, read [Encode and publish episodes](https://docs.podigee.com/documentation/start-here/ai-agents/media-and-publishing/encode-and-publish-episodes.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.podigee.com/documentation/start-here/ai-agents/mcp-tools/media-and-publishing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
