create_csv_table
Create a fully-typed table from a CSV in one call: infer column types by sampling rows, generate M declarations for every column, and refresh the table.
Instructions
Create a fully-typed import table from a (staged) CSV in ONE call: reads the header + samples rows to infer each column's type (Int64/Double/String), builds the Csv.Document M, declares EVERY column automatically, and refreshes. Removes the add_data_column-per-column grind. Pairs with stage_excel_to_csv / unpivot_weekly_csv. Pass pathExpression to control how the M references the file (e.g. 'DataFolder & "file.csv"'); omit to embed the absolute path.
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": {
"sessionId": "<sessionId>",
"table": "<table>",
"csvPath": "<csvPath>"
},
"name": "create_csv_table"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | new table name | |
| csvPath | Yes | absolute path to the CSV (read for header + type inference) | |
| sessionId | Yes | ||
| sampleRows | No | rows to sample for type inference (default 200) | |
| pathExpression | No | M File.Contents expression, e.g. DataFolder & "file.csv" (omit to embed the absolute path) |