Skip to content

export_data

MCP tools › Databases

Export all rows of one reading statement as csv (NULL = empty field, empty string = ""), tsv (NULL = \N), psv, json, markdown (numeric columns right-aligned), html, xml, sql-insert or sql-update (need table; sql-update uses key, default the first column) or where-clause. One header setting (default on) for csv, tsv, psv, markdown and html. Returns the text (at most 5 MiB); no file is written. Needs the read-data permission.

Its results carry text from database: the client is told to treat that as data, never as instructions.

Capabilitydatabase.export_data
AreaDatabases
Accessreads only
Reachesdatabase, network
Rightsssh, database-permission, trusted-project
Dry runnone

Arguments

ArgumentTypeDescription
connectionrequiredstringConnection name from list_connections.
sqlrequiredstringOne reading statement, e.g. select * from item.
formatrequiredstringcsv, tsv, psv, json, markdown, html, xml, sql-insert, sql-update or where-clause.
tablestringTable name for sql-insert and sql-update.
keyarray of stringKey columns for sql-update (default: the first column).
headerbooleanWrite column names first (default true; csv, tsv, psv, markdown, html).

Call it from a shell

ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.

Terminal window
ferris-idea call ~/my-project export_data '{"connection":"<string>","sql":"<string>","format":"<string>"}'
Input schema as JSON
{
"type": "object",
"required": [
"connection",
"sql",
"format"
],
"properties": {
"connection": {
"description": "Connection name from `list_connections`.",
"type": "string"
},
"sql": {
"description": "One reading statement, e.g. `select * from item`.",
"type": "string"
},
"format": {
"description": "`csv`, `tsv`, `psv`, `json`, `markdown`, `html`, `xml`, `sql-insert`, `sql-update` or\n`where-clause`.",
"type": "string"
},
"table": {
"description": "Table name for `sql-insert` and `sql-update`.",
"type": [
"string",
"null"
]
},
"key": {
"description": "Key columns for `sql-update` (default: the first column).",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"header": {
"description": "Write column names first (default true; csv, tsv, psv, markdown, html).",
"type": [
"boolean",
"null"
]
}
}
}