Package Fabrication Files
fab_packUse this when the user wants to get a part made: packages the fabrication files into one directory plus a zip, and returns links to public instant-quote pages. Pass { file | code } and output_dir; optional scope ('part', default — one script's files; 'bom' — the whole assembly's BOM: per-part single-body files, per-part drawings, bom.csv/json and vendor handoff texts; 'workshop' — part pack plus cut-list CSV/JSON, DXF flats.zip, and dfm_review JSON sidecar), name (default 'part'), formats (default step, stl, 3mf, pdf-drawing, bom-csv; add 'dxf' for flat/sheet; workshop also cut-list-csv/json, dfm-json, flats-zip), tolerance (requested absolute mm for mesh exports; this runtime currently refuses it before writing), and processes ('3d-print' | 'cnc' | 'sheet-cut') to filter links (bom: also narrows which fabricated rows are packed). Each file is written by the export tool, so its gates apply; a format that fails is reported in files[] and the rest still ship. Also writes manifest.json and README.txt. quote_links lists JLC3DP, JLCCNC, PCBWay, Xometry, SendCutSend and Craftcloud with the pack file to upload to each. One body per file: multi-body files are rejected by every shop. DXF is written only for flat or sheet-metal parts. The McMaster handoff text carries part numbers only, because McMaster quantities are packs and pack sizes are not in the catalog yet. These are plain web pages: nothing is uploaded or ordered. The user opens the link and uploads the file. Run dfm_review first if you have not. Hosted server: pack files are written on the kernelCAD server and returned in downloads[].url; nothing is uploaded to a fabrication service.
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": {
"output_dir": "<output_dir>"
},
"name": "fab_pack"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Inline kernelCAD script source. | |
| file | No | Path to a .kcad.ts script file. Hosted: `code`, `project:<slug>` (head), or a Studio `/p/<slug>?version=N` link (pinned); no local files. | |
| name | No | Base file name (letters, digits, '.', '_', '-'). Default 'part'. | |
| scope | No | Default 'part' (a single-part pack). 'bom' packs the whole assembly's BOM. 'workshop' packs shop files plus cut list, DXF flats zip, and DFM warnings JSON. | |
| formats | No | Files to include. Default step, stl, 3mf, pdf-drawing, bom-csv. | |
| processes | No | Only return quote links for these processes. Default: all. | |
| tolerance | No | Requested absolute mesh tolerance in mm. This runtime currently returns export.mesh.tolerance-unsupported and writes no files when this is supplied. | |
| output_dir | Yes | Directory to write the pack into (created if missing). Hosted server: only the directory name is used; the pack is written in a server-owned directory and returned as download links. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||