Install Klar charts into a project
install_chartCopy selected chart components and their required files into a React project, rewrite imports, update index.ts, and report missing packages plus usage snippets.
Instructions
Copies one or more charts into the project (default /src/klar): each chart component plus exactly the files it imports, klar.css and ThemeScope. Rewrites imports to relative paths, never overwrites existing files unless overwrite is true, and adds the charts to the generated index.ts. Returns the files written, the npm packages still missing, the CSS import step, and an import line and usage snippet per chart. Does not copy the rest of the kit or any dashboard.
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": {
"project_dir": "<project_dir>",
"ids": "<ids>"
},
"name": "install_chart"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | Yes | Chart ids from list_charts, e.g. ["fin-candlestick", "sci-kaplan-meier"] | |
| dry_run | No | Report what would be written without writing | |
| overwrite | No | Replace files that already exist (discards local edits to them) | |
| target_dir | No | Folder inside the project to install into | src/klar |
| project_dir | Yes | Absolute path to the project root (the folder with package.json) |