Skip to main content
Glama
Copper

Copper

Fab order pack

fab_export
Idempotent

Generates zipped Gerbers, Excellon drill, BOM and placement CSVs for a PCB fab profile, running ERC/DRC checks first and blocking orders until blockers are fixed or waived.

Instructions

Produce the order pack for a PCB fab: Gerbers + Excellon drill zipped, a BOM CSV and a placement (centroid/CPL) CSV, all in the format of a fab PROFILE. Writes to /copper-out/fab/. profile: omit to use the project's configured profile (fab.profile in the Copper config; 'jlcpcb' out of the box). Built in: 'jlcpcb' (Protel gerbers; BOM 'Comment, Designator, Footprint, LCSC Part #'; CPL 'Designator, Mid X, Mid Y, Layer, Rotation' with JLC rotation corrections), 'pcbway', 'oshpark' (bare boards) and 'generic' (Gerber X2 + Excellon + KiCad position file + plain BOM with MPN/Manufacturer — for any other fab). Users add their own as JSON in $COPPER_HOME/fabs/ or /.copper/fabs/. profile='list' returns every available profile with its rules and notes (nothing is exported).

It first runs ERC + DRC (zones refilled, schematic parity) and REFUSES (error FAB_BLOCKED, listing blockers with fixes) for whatever the profile says blocks an order: ERC errors, DRC errors, unrouted nets, parity issues, no board outline, an empty board and — for profiles that need one per part, like jlcpcb — assembled parts without the profile's part number. Fix the blockers (each comes with the next tool call); pass waive=[codes] ONLY for things the user consciously accepts: 'erc','drc','unrouted','parity','parts','outline','empty' or 'all'. assembly=false skips BOM + placement (bare PCB order). With assembly it also asks the parts provider for live stock of every BOM part (for boards boards, default 5): parts with zero / too little stock or not listed come back in warnings (code 'stock': affected refs + a ready parts_alternatives fix per part). That never blocks; waive=['stock'] acknowledges it. Offline (or with check_stock=false), stock.not_checked and the first order note say stock was NOT checked. Every output is checked (non-empty, complete layer set, zip readable). Returns board size, layers, min track/drill, part counts, summary.assembly_fees (Basic / Preferred / Extended counts, the fee total, extended_refs = which parts cause it) when the profile has part classes, and order notes. Examples: fab_export() · fab_export(profile='generic') · fab_export(waive=['parts']) · fab_export(assembly=false)

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "fab_export"
  }
}

Input Schema

NameRequiredDescriptionDefault
waiveNo
boardsNoboards in the order, for the stock check (default 5)
layersNooverride gerber layer list (rarely needed)
out_dirNooutput folder (default <project>/copper-out/fab)
profileNofab profile name (default: the project's configured one); 'list' shows them
projectNoproject path (default: active)
assemblyNoalso write BOM + placement files (default: true when the fab assembles)
check_stockNoask the parts provider for live stock (default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations: it documents the FAB_BLOCKED error and blocker list, that stock warnings never block, the offline/check_stock=false fallback surfacing stock.not_checked, and that every output is validated (non-empty, complete layer set, zip readable). This is exactly the failure-mode and side-effect context the idempotent/destructive annotations cannot carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense but well front-loaded: purpose and output location first, then profile handling, then the blocking-check behavior, then returns, then example calls. Some parenthetical detail (profile BOM/CPL column layouts) is verbose, but nearly every sentence carries decision-relevant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter tool with no output schema, the description still covers return values (board size, layers, min track/drill, part counts, summary.assembly_fees with extended_refs, order notes) and the full failure surface. An agent has everything needed to decide whether to call it and how to react to its outcomes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 88% schema coverage the baseline is 3, but the description adds real semantics the schema lacks: the exact waive code set and that they should be used ONLY for consciously accepted issues, profile='list' as a special value, the boards default of 5 tied to stock checking, and assembly=false meaning bare-board order.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and concrete deliverables: 'Produce the order pack for a PCB fab: Gerbers + Excellon drill zipped, a BOM CSV and a placement (centroid/CPL) CSV'. That distinguishes it clearly from generic siblings like export or render, and the output location (<project>/copper-out/fab/) pins the scope further.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives strong operational guidance: when the tool refuses (ERC/DRC/unrouted/parity/outline/empty/parts) and how waive codes map to each, when to use assembly=false, and that profile='list' enumerates profiles without exporting. It never explicitly names a sibling alternative (e.g. when to prefer export or render), so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.