Plot a data file
plot_fileRead a CSV, TSV or JSON file from disk and chart its columns, returning a PNG image plus a text summary of the columns found and what was drawn. Handles large files without pasting data.
Instructions
Chart the columns of a CSV, TSV or JSON file on disk and return a PNG image plus a text summary (columns found, what was drawn).
When to use: the data is in a file the server can read, especially a large one you should not paste into a call. For data you already have in the conversation use plot, which also offers all 44 chart types; plot_file covers the common kinds below.
How: give path; JSON may be an array of objects or {column: [values]}. kind=auto (default) picks a line chart for a numeric x column, bars for a text x column and a histogram for a single numeric column; correlation draws the correlation matrix of all numeric columns. x, y and group choose columns by name.
Behavior: only reads the file; writes nothing unless output is given, and uses no network. A missing file, an unknown column or a file with no rows returns an error result whose text says which.
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": {
"path": "<path>"
},
"name": "plot_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Column for x (categories for bar). | |
| y | No | Column(s) for y: a name or a list of names (default: all numeric columns except x). | |
| kind | No | Chart kind (default auto). | |
| path | Yes | Path of the CSV, TSV or JSON file, absolute or relative to the server's working directory; the format follows the extension. | |
| group | No | Column with group names (box/violin: one box per group). | |
| image | No | Return the image (default true; false returns only the text summary). | |
| theme | No | Color theme (default light). high_contrast uses dark colors with at least 4.5:1 contrast and larger text. | |
| title | No | Figure title. | |
| width | No | Width in pixels (default 900). | |
| height | No | Height in pixels (default 600). | |
| output | No | Also save the chart to this file path; the format follows the extension (.png, .svg, .pdf, or .html for an interactive page). An existing file at that path is overwritten. Omit to write nothing. |