Skip to content

MCP tools

audio-convert

Between MP3, WAV, FLAC, Ogg and AAC, with the bitrate under your control.

Behaviour#

What the tool needs and what it does. The server converts nothing itself: it calls the API for you.

PropertyValue
Abilityaudio:convert
RunsPOST /api/v1/tools/audio-convert, then downloads the result
CLIvukem-tools audio convert
ReadsThe files named in the arguments, on the machine the server runs on
Writesoutput

Input#

ArgumentTypeRequiredNotes
inputstringyesPath of the file to read.
outputstringyesWhere to write the result: a file path, or a directory for a tool that yields several files. The result is downloaded at once because it expires in minutes.
optionsobjectnoHow to convert. Only the output format is required. A video input has its soundtrack extracted.
idempotency_keystringnoUp to 128 characters. Repeat a call safely: the same key returns the same conversion.

An argument that is not in the tool's schema is refused with invalid_input.

Options#

NameTypeRequiredDescription
options.bitrateintegernoBit rate in kbit/s for MP3, Opus and AAC. 0 uses the format's default. Ignored by FLAC and WAV, which are lossless. min 0; max 320
options.channelsintegerno1 for mono, 2 for stereo. 0 keeps the source's. min 0; max 2
options.normalisebooleannoNormalise the loudness to -16 LUFS, the figure streaming platforms use
options.sample_rateintegernoResample, in hertz. 0 keeps the source's rate. min 0; max 192000
options.tostringnoMp3, wav, flac, opus or aac. GET /api/v1/tools/audio-convert/formats lists what this server can write. max length 8
options.two_passbooleannoMeasure the whole recording before correcting it. Costs a second decode and is the only way to hit the target reliably

Output#

A call that works returns isError: false, the result as JSON text in content, and the same result as an object in structuredContent.

MemberTypeAlways presentNotes
toolstringyesThe tool that ran.
conversion_idstringyesThe conversion on the server.
statusstringyesfinished.
outputsarray of objectyesOne entry for each file written: path, name, mime (when known) and size_bytes.
bytes_inintegernoBytes uploaded.
bytes_outintegernoBytes written.
notestringnoWhat the conversion says about itself, when it has something to say.
expires_atstringnoWhen the server deletes its copy of the result.

Errors#

A failed call is not a protocol error: it returns isError: true and a code the agent can branch on. The ones this tool is likely to meet:

  • invalid_input: an argument is missing, unknown or out of range, or a file is not readable or is empty. Checked before anything is uploaded.
  • missing_key and unauthorized: VUKEM_TOOLS_API_KEY is not set, or the server refused it.
  • missing_ability: the key lacks audio:convert.
  • file_too_large, conversion_failed, timeout and result_expired: the server could not finish or the result was gone before it was downloaded.
  • rate_limited, network_error and io_error: a limit, the server could not be reached, or a file could not be read or written.

The full table, with retry and conversion_type, is in What a result looks like.

Safety#

The agent chooses the paths, and the process can read and write anything your user can. The result is written to a temporary file next to output and then renamed, so a failed download leaves no partial file. See What keeps an agent safe.

Example#

Ask the agent

Convert audio: read in.mp3 and write out.mp3.

The call (tools/call)

JSON
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"audio-convert","arguments":{"input":"in.mp3","output":"out.mp3","options":{"bitrate":192,"channels":2,"normalise":true,"to":"mp3","two_pass":true}}}}

The result (result)

JSON
{"jsonrpc":"2.0","id":1,"result":{"content":[{"type":"text","text":"{\"tool\":\"audio-convert\",\"conversion_id\":\"01JQ8Z5X0K7M3N9P2R4T6V8W0Y\",\"status\":\"finished\",\"outputs\":[{\"path\":\"out.mp3\",\"name\":\"out.mp3\",\"size_bytes\":1234}],\"bytes_in\":1500,\"bytes_out\":1234,\"expires_at\":\"2026-01-02T15:09:05Z\"}"}],"structuredContent":{"tool":"audio-convert","conversion_id":"01JQ8Z5X0K7M3N9P2R4T6V8W0Y","status":"finished","outputs":[{"path":"out.mp3","name":"out.mp3","size_bytes":1234}],"bytes_in":1500,"bytes_out":1234,"expires_at":"2026-01-02T15:09:05Z"},"isError":false}}

The values are illustrative: the names and the output path come from your call, the sizes and the id from the run. The member names are exact.

Next steps#