Skip to main content
Glama

Package Fabrication Files

fab_pack

Use 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

NameRequiredDescriptionDefault
codeNoInline kernelCAD script source.
fileNoPath to a .kcad.ts script file. Hosted: `code`, `project:<slug>` (head), or a Studio `/p/<slug>?version=N` link (pinned); no local files.
nameNoBase file name (letters, digits, '.', '_', '-'). Default 'part'.
scopeNoDefault '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.
formatsNoFiles to include. Default step, stl, 3mf, pdf-drawing, bom-csv.
processesNoOnly return quote links for these processes. Default: all.
toleranceNoRequested absolute mesh tolerance in mm. This runtime currently returns export.mesh.tolerance-unsupported and writes no files when this is supplied.
output_dirYesDirectory 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

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / file / description
      Previous value: -"Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."New value: +"Path to a .kcad.ts script file. Hosted: `code`, `project:<slug>` (head), or a Studio `/p/<slug>?version=N` link (pinned); no local files."
  2. Changed1 schema field changed
    • addedInput schema / properties / tolerance
      Added value: +{
      +  "description": "Requested absolute mesh tolerance in mm. This runtime currently returns export.mesh.tolerance-unsupported and writes no files when this is supplied.",
      +  "type": "number"
      +}
  3. Changed3 schema fields changed
    • changedInput schema / properties / formats / items / enum
      Previous value: -[
      -  "step",
      -  "stl",
      -  "3mf",
      -  "pdf-drawing",
      -  "bom-csv",
      -  "dxf"
      -]New value: +[
      +  "step",
      +  "stl",
      +  "3mf",
      +  "pdf-drawing",
      +  "bom-csv",
      +  "dxf",
      +  "cut-list-csv",
      +  "cut-list-json",
      +  "dfm-json",
      +  "flats-zip"
      +]
    • changedInput schema / properties / scope / description
      Previous value: -"Default 'part' (a single-part pack). 'bom' packs the whole assembly's BOM: per-part single-body files, per-part drawings, bom.csv/json, vendor handoff texts, and per-process quote links."New value: +"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."
    • changedInput schema / properties / scope / enum
      Previous value: -[
      -  "part",
      -  "bom"
      -]New value: +[
      +  "part",
      +  "bom",
      +  "workshop"
      +]
  4. Changed1 schema field changed
    • addedInput schema / properties / scope
      Added value: +{
      +  "description": "Default 'part' (a single-part pack). 'bom' packs the whole assembly's BOM: per-part single-body files, per-part drawings, bom.csv/json, vendor handoff texts, and per-process quote links.",
      +  "enum": [
      +    "part",
      +    "bom"
      +  ],
      +  "type": "string"
      +}
  5. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.