pcb_export
Export PCB designs to gerber, BOM, pick-and-place, 3D, PDF, netlist, and other fabrication formats as Base64 data, with optional sub-formats and layer options.
Instructions
Export the PCB design in various formats. Returns { fileName, data (Base64), size }.
BEFORE generating any fabrication output (gerber, odbplus, drill, pick_and_place): run pcb_run_drc (and sch_run_drc) and resolve all violations. Clearance DRC alone is not sufficient — this fork exists partly because API-drawn tracks passed clearance DRC while being electrically dead to their SMD pads; only a No-Connection/connectivity check surfaced it. Include connectivity checks in the DRC run before shipping.
Formats: dsn (for FreeRouting), gerber (manufacturing), bom (bill of materials), pick_and_place (assembly), 3d (STEP/OBJ), pdf, netlist, dxf, altium, pads, odbplus (ODB++ archive with stackup+nets), ipc_d_356 (netlist test format), flying_probe, test_point, autoroute_json, autolayout_json. Use fileType for sub-formats: "xlsx"/"csv" (bom, pick_and_place, test_point), "step"/"obj" (3d).
WARNING: response is Base64 in the MCP reply — for large outputs (gerber zips, 3d STEP) prefer pcb_export_to_file which writes straight to disk.
Most formats accept extra options forwarded as-is to the underlying EasyEDA getXxxFile call. Common ones (unit values are the literal strings "mm" / "inch" / "mil"):
gerber: { unit: "mm" | "inch", colorSilkscreen, digitalFormat: {integerNumber, decimalNumber}, other: {metallicDrillingInformation, nonMetallicDrillingInformation, drillTable, flyingProbeTestingFile}, layers: [{layerId, isMirror}], objects: [...] }
odbplus: { unit: "inch", otherData: {metallizedDrilledHoles, nonMetallizedDrilledHoles, drillTable, flyingProbeTestFile}, layers: [{layerId, mirror}], objects: [{objectName}] }
pick_and_place:{ unit: "mm" | "mil" }
3d: { element: [...], modelMode: "Outfit" | "Parts", autoGenerateModels }
bom: { template, filterOptions, statistics, property, columns }
dxf: { layers: [{layerId, mirror}], objects: [...] }
Omit options to get sensible defaults. For gerber and odbplus, omitting layers exports
all enabled copper (Top, Bottom, and any Inner1..InnerN that are enabled) plus the standard
silk/mask/paste/outline aux layers — unlike EasyEDA's raw default which silently drops inner
copper even on 4L+ boards.
CAUTION: options keys cannot override the top-level document/instance_id routing fields — those always take precedence to prevent accidental cross-document export.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | Yes | Export format | |
| options | No | Format-specific options passed through to the underlying EasyEDA call. See tool description for shape per format. | |
| document | Yes | Target document UUID — auto-switches to this document before executing. Get UUIDs from list_instances or editor_get_open_tabs. | |
| fileName | No | Output file name | |
| fileType | No | Sub-format (e.g. "xlsx"/"csv" for bom, "step"/"obj" for 3d) | |
| instance_id | No | Target EasyEDA instance ID (8-char hex). Required when multiple instances are connected. Omit when only one instance is connected (auto-selected). Use list_instances to see connected instances. |