> 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/import-and-operations.md). Agents can also search and read this documentation through its [MCP server](https://docs.podigee.com/~gitbook/mcp).

# Import and operation tools

MCP tools that import a podcast from a feed and follow, resume, or cancel durable operations.

`import_podcast` moves a podcast from another host into Podigee. An import and a publish run for some time, so Podigee runs them as durable operations. The other tools on this page read an operation, resume it, or cancel it. The `waiting` and `recovery` objects tell the assistant what a publish waits for and what to do after a failure.

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 |
| ------------------ | ----------------------------------------------------------------------------- | --------------------------------------- | ------------------ |
| `import_podcast`   | Imports a podcast from an RSS feed into a new or an existing podcast.         | `mcp:podcasts:write`, `mcp:media:write` | Write              |
| `get_operation`    | Reads the state, progress, result, `waiting`, and `recovery` of an operation. | The read scope of the operation type    | Read-only          |
| `resume_operation` | Starts a failed, stalled, or waiting operation again.                         | The write scopes of the operation type  | Write              |
| `cancel_operation` | Cancels an operation that has not finished.                                   | The write scopes of the operation type  | Write              |

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). The rule for when to wait, resume, cancel, or contact support 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).

## `import_podcast`

`import_podcast` imports a podcast from its RSS (Really Simple Syndication) feed address. Without `podcast_id` it creates a new podcast. With `podcast_id` and `confirm_existing_podcast: true` it imports the episodes into an existing podcast.

Send the request with `dry_run: true` first. The preview reads the feed and says whether Podigee can read it and how many episodes it has. Show this to the person before they confirm. The confirmed call returns an operation. Follow it with `get_operation`: its `progress` says how many episodes of the total are imported.

Import works on every current plan, Launch included, and on older paid plans. An older trial, an older free plan, or a collaborator plan cannot import. `checks.import` in `doctor` says whether the plan allows it. An import into a new podcast also needs a free podcast in the plan and a connection to the person's own account. For a member of an organization, the own account is the organization. A connection to an account under "Shared with you" can import only into an existing podcast.

**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                                                    |
| ----------------------------- | ------------ | -------------------- | ------------- | -------------------------------- | ---------------------------------------------------------- |
| `feed_url`                    | string (URI) | Yes                  | None          | A feed address                   | The RSS feed address of the podcast to import.             |
| `podcast_id`                  | integer      | No                   | A new podcast | A podcast of this connection     | The existing podcast that gets the episodes.               |
| `confirm_existing_podcast`    | boolean      | With `podcast_id`    | `false`       | Must be `true` with `podcast_id` | Confirms the import into an existing podcast.              |
| `episode_limit`               | integer      | No                   | 1,000         | 1 to 1,000                       | Imports at most this number of episodes.                   |
| `skip_episodes_without_audio` | boolean      | No                   | `false`       | None                             | `true` leaves out episodes that have no audio file.        |
| `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 import.                           |

| Output field                                                              | Meaning                                                                                |
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| Preview: `feed.reachable`                                                 | `false` means that the import will fail. `feed.error_type` and `feed.message` say why. |
| Preview: `feed.title`, `feed.total_episodes`, `feed.total_duration_hours` | What the feed holds. Show `total_episodes` to the person.                              |
| Preview: `episode_limit`, `skip_episodes_without_audio`, `confirm`        | The limits that the import will use, and the confirm value.                            |
| Result: `operation_id`, `podcast_import_id`                               | The operation and the import.                                                          |
| Result: `next_action`                                                     | The `get_operation` call to follow the import.                                         |

Example request (preview):

```json
{
  "feed_url": "https://feeds.example.com/the-morning-mug.xml",
  "episode_limit": 50,
  "skip_episodes_without_audio": true,
  "dry_run": true
}
```

Errors:

* `plan_limit_reached` with `entitlement: podcast_import`: the plan does not include import. This says nothing about the feed.
* `plan_limit_reached` with `entitlement: podcast_licenses`: the plan has no free podcast for a new podcast. Import into an existing podcast, or upgrade the plan.
* `forbidden`: an import into a new podcast needs a connection to the person's own account. A connection to an account under "Shared with you" gets this error.
* `not_found`: the target podcast is not a podcast of this connection.
* `validation_error` or `invalid_params`: the request or the feed is not accepted, for example `podcast_id` without `confirm_existing_podcast: true`.
* `validation_error` with "Daily podcast import limit reached.": the account started 20 imports in the last 24 hours. Wait; do not retry at once.
* `idempotency_conflict`: the key was already used for another request.

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_operation`

`get_operation` reads a durable operation: its state, its stage, its progress, and its result or error. A publish that waits for its recording has `waiting`: what it waits for, since when, whether the recording still changes, and what happens then. After a failure or a stall, `recovery` names the one next step.

An operation belongs to the person and the account that started it. A new connection of the same person to the same account can read, resume, and cancel it. Another person, or the same person in another account, gets `not_found`. The tool has no fixed scope. It needs the read scope of the operation type: `mcp:listeners:read` for a listener password reset, and `mcp:podcasts:read` for all other types. It does not work while the subscription is suspended.

These operation types exist: `publish_episode`, `podcast_import`, `listener_password_reset`, `create_podcast`, `update_podcast`, `create_episode`, `update_episode`, `duplicate_episode`, `bulk_update_episodes`, `create_listener`, `create_production`, and `submit_to_platform`.

**Contract:** scope of the operation type. Read-only: yes. Destructive: no. Idempotent: yes. Open world: no.

| Parameter      | Type          | Required | Default | Limits                                      | Meaning                                                                             |
| -------------- | ------------- | -------- | ------- | ------------------------------------------- | ----------------------------------------------------------------------------------- |
| `operation_id` | string (UUID) | Yes      | None    | An operation of this person in this account | The ID that a confirmed change returned. A UUID is a universally unique identifier. |

| Output field              | Meaning                                                                                                                                                                                             |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `operation_type`, `stage` | The kind of work and the step that runs.                                                                                                                                                            |
| `state`                   | `queued`, `running`, `waiting`, `succeeded`, `failed_retryable`, `failed_terminal`, or `cancelled`. `succeeded`, `failed_terminal`, and `cancelled` end the operation. `failed_retryable` does not. |
| `retryable`, `attempts`   | Whether a resume can help, and the number of attempts.                                                                                                                                              |
| `progress`                | For an import: `current`, `total`, `percent`, and the current episode.                                                                                                                              |
| `result`                  | For a publish: `episode_id`, `production_id`, `publication_mode`, and `published_at`. For an import: `podcast_id`, `imported_episode_ids`, `partial_failure`, and `encoding_failures`.              |
| `error`                   | `code` and `message`, and for an import also `paused`, `pause_reason`, `encoding_failures`, and the failed episode.                                                                                 |
| `waiting`                 | What a waiting publish waits for. See "The waiting object".                                                                                                                                         |
| `recovery`                | The one next step after a failure or a stall. See "The recovery object".                                                                                                                            |

An import with `result.partial_failure: true` has episodes without playable media, because their encoding failed. The podcast is usable; `encoding_failures` counts the episodes.

Example request:

```json
{
  "operation_id": "8d1c2b3a-4e5f-4a6b-9c7d-0e1f2a3b4c5d"
}
```

Errors: `not_found` for an operation of another person or another account. `insufficient_scope` without the read scope of the operation type. 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).

## The waiting object

A publish can wait while Podigee processes its recording. Then `state` is `waiting`, and `get_operation` returns `waiting`, read at the time of the call. Other states and other operation types have no `waiting`. Report the wait to the person in plain words. While `continues_automatically` is `true`, the person can leave, and nobody has to keep asking.

| Field                                           | Meaning                                                                                                                                                                                                                                            |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `on`                                            | `video_processing` or `audio_encoding`.                                                                                                                                                                                                            |
| `recording_state`                               | `processing`: the work goes on. `ready`: the recording is processed and the publish goes on soon. `failed`: the processing failed. `no_change_for_hours`: nothing changed for hours (for an encode that ran, 6 hours); nothing reported a failure. |
| `recording_uploaded_at`, `recording_changed_at` | When the current recording was uploaded and when it last changed.                                                                                                                                                                                  |
| `percent`                                       | The progress of the audio encode, only while it runs and reports a value.                                                                                                                                                                          |
| `then`                                          | `publishes`, `publishes_at_scheduled_time`, or `stays_draft`: what happens to the episode when the wait ends.                                                                                                                                      |
| `continues_automatically`                       | `true` for `processing` and `ready`. `false`: follow `recovery`.                                                                                                                                                                                   |
| `poll_after_seconds`                            | 60. A hint for the next call, not an estimate of the remaining time.                                                                                                                                                                               |
| `checked_at`                                    | When Podigee read this state.                                                                                                                                                                                                                      |
| `recovery`                                      | The next step when the recording failed or stalled.                                                                                                                                                                                                |

When a later call still says `ready`, call `resume_operation`. For `no_change_for_hours` and for `failed`, `recovery.action` is usually `resume_operation`: a resume checks the recording and starts its processing again. Do not ask for a new upload in this case.

## The recovery object

A failed or stalled publish has `recovery` with one `action` and a `message`. Follow the action. Do not propose a new upload or another file format unless the action is `replace_recording`.

| `action`               | What to do                                                                                                                                                                                                                                                        |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `restore_access`       | The access that the operation needs is gone. `error.message` says which. The person restores it. Then resume when `retryable` is `true`, or send `publish_episode` again.                                                                                         |
| `check_plan_allowance` | The plan does not cover the publish. Call `doctor` and tell the person which allowance is used up. After the person gets more allowance, resume when `retryable` is `true`, or send `publish_episode` again.                                                      |
| `correct_request`      | Podigee refused the request. `error.message` says why. Correct the request and send `publish_episode` again with a new `idempotency_key`. Do not resume.                                                                                                          |
| `replace_recording`    | The episode needs a new recording. The person replaces it on the episode page; `find_in_podigee` with `episode_id` has the link. Do not resume. When `retryable` is `true`, cancel the operation with `cancel_operation` before you send `publish_episode` again. |
| `resume_operation`     | Call `resume_operation` once. If the operation fails the same way again, do not resume again: the person contacts Podigee support with the operation ID.                                                                                                          |
| `contact_support`      | Do not retry, and do not ask for a new upload. The person contacts Podigee support with the operation ID and the episode link.                                                                                                                                    |

## `resume_operation`

`resume_operation` starts an operation again. It works for a failed operation with `retryable: true`. It also works for a waiting publish (stage `encoding` or `media_processing`) and a waiting import (stage `encoding`), for example when the recording failed or stalled. For these, `retryable` can be `false`: follow `recovery`, not only `retryable`. A resume of a waiting publish checks the recording and starts its processing again. It does not need a new upload.

The tool needs a preview and a confirmation. It needs the write scopes of the operation type, for example `mcp:podcasts:write` and `mcp:media:write` for a publish or an import. This tool is not idempotent: each confirmed call starts the work again.

**Contract:** write scopes of the operation type. Read-only: no. Destructive: yes. Idempotent: no. Open world: yes.

| Parameter      | Type          | Required            | Default | Limits                                         | Meaning                                       |
| -------------- | ------------- | ------------------- | ------- | ---------------------------------------------- | --------------------------------------------- |
| `operation_id` | string (UUID) | Yes                 | None    | An operation of this person in this account    | The operation to resume.                      |
| `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: `operation`, `confirm`, `next_step` | The operation as it is now, the confirm value, and what to do with the preview.                             |
| Result                                       | The operation after the resume, with the same fields as `get_operation`, `waiting` and `recovery` included. |

Example request (preview):

```json
{
  "operation_id": "8d1c2b3a-4e5f-4a6b-9c7d-0e1f2a3b4c5d",
  "dry_run": true
}
```

Errors:

* `operation_in_progress`: the operation is queued, runs, or waits and cannot be resumed now, or its cancellation is still in progress.
* `validation_error`: the operation type cannot be resumed, or the operation is not retryable.
* `forbidden`: the person no longer has the permission that the work needs.

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).

## `cancel_operation`

`cancel_operation` cancels an operation that has not finished. For a publish, it stops the encoding that runs. For an import, it stops the import. A failed operation with `retryable: true` can also be canceled. Cancel is a required step of the `replace_recording` recovery when the publish waits or has `retryable: true`. First cancel the operation. Then the person replaces the recording on the episode page. Then send `publish_episode` again.

A call without `confirm` returns the preview. A canceled operation stays canceled; a second cancel returns it unchanged. The tool needs the write scopes of the operation type.

**Contract:** write scopes of the operation type. Read-only: no. Destructive: yes. Idempotent: yes. Open world: yes.

| Parameter      | Type          | Required            | Default                         | Limits                                      | Meaning                                       |
| -------------- | ------------- | ------------------- | ------------------------------- | ------------------------------------------- | --------------------------------------------- |
| `operation_id` | string (UUID) | Yes                 | None                            | An operation of this person in this account | The operation to cancel.                      |
| `dry_run`      | boolean       | No                  | `true` when `confirm` is absent | None                                        | `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: `operation_id`, `confirm`, `next_step` | The operation, the confirm value, and what to do with the preview.                                 |
| Result                                          | The operation with `state: cancelled` and `cancelled_at`, with the same fields as `get_operation`. |

Example request (preview):

```json
{
  "operation_id": "8d1c2b3a-4e5f-4a6b-9c7d-0e1f2a3b4c5d",
  "dry_run": true
}
```

Errors:

* `validation_error`: the operation has already finished (`succeeded` or `failed_terminal`), or it is a listener password reset that runs now.
* `operation_in_progress`: the cancellation has not reached its end yet. Read the operation again.
* `forbidden`: the person may not stop the encoding of this 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).

## Next step

* To import a podcast step by step, read [Import a podcast](https://docs.podigee.com/documentation/start-here/ai-agents/media-and-publishing/import-a-podcast.md).
* To follow and recover a publish or an import, read [Follow and recover long-running operations](https://docs.podigee.com/documentation/start-here/ai-agents/work-safely/follow-and-recover-long-running-operations.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/import-and-operations.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.
