Query CSV & JSON Tables with SQLite
query_tabular_dataIngests 1–10 named RFC 4180 CSV/TSV or JSON row-array datasets into an ephemeral zero-retention SQLite sandbox, coerces currency columns (e.g. '$1,250.50' -> 1250.5), runs read-only SQL (JOIN, GROUP BY, CTEs, window functions), and returns typed rows, Markdown preview, inferred schemas, and optional .xlsx export. Pricing: $0.002 base (up to $0.01 max $0.002 base + $0.001 per 1,000 total input rows (capped at $0.01), x402 variable settlement). Pass ?dry_run=true on REST to validate schema free.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"tables": "<tables>",
"sql": "<sql>"
},
"name": "query_tabular_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | Read-only SQLite SELECT or WITH (CTE) query supporting JOIN, GROUP BY, HAVING, and window functions (ROW_NUMBER() OVER (...), SUM, AVG). | |
| tables | Yes | Map of 1 to 10 SQL table names (e.g. 'orders', 'customers') to CSV/TSV or JSON row-array payloads. | |
| maxRows | No | Maximum result rows returned in `rows` (1–5000, default 1000). | |
| exportXlsx | No | When true, also exports the query result set as a styled OpenXML .xlsx workbook in `xlsxBase64`. | |
| xlsxSheetName | No | Optional worksheet tab name when `exportXlsx` is true (default 'Query Results'). | |
| markdownPreviewRows | No | Maximum rows rendered in `markdownPreview` (1–100, default 20). | |
| coerceCurrencyNumbers | No | Automatically strip $, €, £, ¥ symbols, thousands commas, and accounting parentheses (e.g. '$1,250.50' -> 1250.5) when an entire column is numeric. | |
| xlsxSummaryRowFormulas | No | Optional summary row formulas keyed by output column name when `exportXlsx` is true (e.g. { total_revenue: 'SUM' }). |