convert¶
Convert a file from one format to another. Same surface as the CLI's
octa --convert: both ends resolved by
file extension, both routed through Octa's FormatRegistry.
When to use¶
- "Convert this Excel to a clean Parquet."
- "Export this SQLite table to CSV."
- "Make a JSON copy of this Stata file."
Input schema¶
| Parameter | Type | Required? | Default | Description |
|---|---|---|---|---|
input |
string | no* | (no default) | Source file path. Format inferred from extension |
open_tab |
string | no | (no default) | Convert an open GUI tab instead of input (name, or @active). Only in the Assistant. |
output |
string | yes | (no default) | Destination file path. Format inferred from extension |
table |
string | no | (no default) | For multi-table input sources, which table to export |
unlimited |
bool | no | false |
Lift the 2,000,000-row file-loader cap so the entire source file is converted |
sort |
array | no | none | Sort the rows before writing: [{column, descending}], first key first |
natural |
bool | no | false |
Sort text naturally (file2 before file10) |
* input or open_tab is required.
sort orders the rows before they are written. A column the source
does not have is refused with a message naming it.
Response shape¶
Example calls¶
CSV → Parquet¶
Response:
Export one SQLite table to JSON¶
{
"name": "convert",
"arguments": {
"input": "/data/app.sqlite",
"output": "/tmp/users.json",
"table": "users"
}
}
Excel → SQLite¶
{
"name": "convert",
"arguments": {
"input": "/tmp/quarterly.xlsx",
"output": "/tmp/quarterly.sqlite"
}
}
Read-only target rejection¶
Octa rejects up-front when the output extension maps to a read-only reader:
| Format | Why read-only |
|---|---|
SAS (.sas7bdat) |
sas7bdat 0.2 is read-only |
Microsoft Access (.mdb, .accdb) |
jetdb is read-only |
QlikView data (.qvd) |
Read-only by design |
R datasets (.rds, .rdata, .rda) |
rds2rust is read-only |
HDF5 (.h5, .hdf5, .hdf) |
hdf5-reader is read-only |
MATLAB (.mat) |
Read-only by design |
NetCDF (.nc) |
netcdf3 is read-only |
EPUB (.epub) |
Read-only by design |
GeoJSON (.geojson) |
Read-only by design |
Trying to convert to one of these errors with:
{ "error": { "code": "invalid_params", "message": "convert failed: format SAS does not support writing; pick a different output extension" }}
These same formats are perfectly fine as input: convert
input.sas7bdat output.csv is valid.
Performance and safety¶
- The input is loaded fully into memory before writing. Streaming
formats (Parquet, CSV, TSV) honour the initial-load cap during
the read step (2,000,000 rows by default). For larger
conversions, pass
unlimited: true; without it the answer carriesinitial_load_cappedand aninitial_load_note. Parquet files with very many row groups fall back to a DuckDB-backed reader automatically. - A file read only in part is refused when
outputis that same file, since writing it back would cut it short. convertoverwrites the output path without prompting, so make sure the destination is what you intend.
Notes¶
- Excel writes always produce
.xlsxstructure regardless of the chosen Excel extension, sincerust_xlsxwritercan't emit legacy.xls/.xlsm/.xlsb. Save those as.xlsx..odshas its own dedicated reader+writer so it round-trips natively. - Write options are the built-in defaults, not the ones saved in
the app. Parquet output is
zstd-compressed like everywhere else, but the MCP server does not readsettings.tomlfor the CSV delimiter, quoting or row-group size: a server answering an agent has no reason to inherit one desktop user's preferences. Use the CLI--convertwhen you want the saved settings honoured. - Database outputs (SQLite, DuckDB, GeoPackage) write a single
table named after the input's stem. Both
run_sql(here) andocta --sqluse ephemeral DuckDB sessions, so neither persistsCREATE TABLE/INSERTto disk; useconvertitself, or open the target database in the GUI to edit table names directly.
See also¶
octa --convertis the CLI equivalent.- Supported formats is the full read/write matrix.
- In the app: Saving