# convert

Canonical URL: https://developers.iagenify.com/sdk/agent/tools/convert/
Language: en

`convert({ path | url, to, save? })`

Turn a file into another format and save it in the workspace. 244 pairs — a report into a PDF, a video into an MP3 to listen to it.

Status: category: write · 1 credit · source read from the name

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `path` | string |  | A workspace file to convert. |
| `url` | string |  | A remote file or page instead. |
| `to` | string | required | The target format: `pdf`, `mp3`, `png`… |
| `save` | string |  | Where to write it. Next to the source by default, or under `Agent/<date>/` for a URL. |

## What it covers {#families}

| Family | Targets |
| --- | --- |
| Documents | `markdown docx pdf html text json` |
| Images | `png jpg webp gif tiff avif pdf base64` |
| Audio and video | `mp4 webm mov avi mkv` · `mp3 wav m4a aac ogg flac opus` · `gif` |

## The source format comes from the name {#source}

There is no `from`: the extension decides. A file named for what it is converts; one named `.dat` does not.

## An impossible target answers with the possible ones {#refusal}

> **One refusal instead of a series of attempts**
>
> Asking for a target that is not reachable from that source returns the list of the ones that are. The agent picks from it on the next turn rather than guessing again.

## Where it earns its place {#use}

- A deliverable in a named format — a report the user asked for as a PDF.
- The sound out of a video, so [read](/sdk/agent/tools/read) can listen to it.
- A file too large for `read`, whose refusal proposes exactly this.

The system prompt says it plainly: never rebuild a PDF by hand.

- [read](/sdk/agent/tools/read): What it feeds.
- [api.tools.convert()](/sdk/ref/tools/convert): The full matrix.
- [Agent tools](/sdk/agent/tools): The 35, by family.
