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.
| Capability | database.export_data |
|---|---|
| Area | Databases |
| Access | reads only |
| Reaches | database, network |
| Rights | ssh, database-permission, trusted-project |
| Dry run | none |
Arguments
| Argument | Type | Description |
|---|---|---|
connectionrequired | string | Connection name from list_connections. |
sqlrequired | string | One reading statement, e.g. select * from item. |
formatrequired | string | csv, tsv, psv, json, markdown, html, xml, sql-insert, sql-update or
where-clause. |
table | string | Table name for sql-insert and sql-update. |
key | array of string | Key columns for sql-update (default: the first column). |
header | boolean | Write 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.
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" ] } }}