# MCP tools: reference

Made from the server's tool table (181 tools) at https://pcbflux.com/mcp. It changes when the tools change; reinstall the skills to get the current one (`curl -fsSL https://pcbflux.com/skills/install.sh | bash`).
**write** marks a tool that changes data (most take `dry_run`); the rest only read. Arguments marked * are required.

| Tool | Kind | What |
|---|---|---|
| [`list_projects`](#list_projects) | read | List the projects you can open (id, name, owner, your role, organisation, archived status for your account, members). |
| [`create_project`](#create_project) | write | Create a project. |
| [`share_project`](#share_project) | write | Give a user access to a project. |
| [`list_files`](#list_files) | read | List a project's files (not the KiCad store: use kicad_list for .kicad_sch, .kicad_pcb and .kicad_pro files). |
| [`read_file`](#read_file) | read | Read a project file's text content (not the KiCad store: use kicad_read for .kicad_* files). |
| [`write_file`](#write_file) | write | Create or overwrite a project file. |
| [`edit_file`](#edit_file) | write | Change part of a project file without sending it whole: `edits` is a list of { old, new, replace_all? }. |
| [`list_assets`](#list_assets) | read | List a project's assets: files kept in R2 such as datasheets, 3D models, photos and fab notes, for the whole project or one circuit. |
| [`get_asset`](#get_asset) | read | Read one asset by id. |
| [`add_asset`](#add_asset) | write | Add an asset to a project or circuit (up to 1 MB here; larger files go through the portal). |
| [`create_asset_upload`](#create_asset_upload) | write | Get a one-time upload link for a file on the caller's disk, for files too big for add_asset. |
| [`delete_asset`](#delete_asset) | write | Delete an asset by id (also removes the stored file). |
| [`delete_file`](#delete_file) | write | Delete a project file. |
| [`list_events`](#list_events) | read | Recent change events for a project (saves by people and agents), optionally after an ISO timestamp. |
| [`list_exports`](#list_exports) | read | List stored exports (circuit JSON, KiCad zip, EasyEDA PCB JSON), export job status (a done job's error field holds notes such as a partly ro |
| [`list_connectors`](#list_connectors) | read | Every connector on every exported board of the project (single-board circuits): ref, MPN, footprint, detected family (JST-GH, JST-PH, PicoBl |
| [`check_harness`](#check_harness) | read | Check the project's harness.json (board-to-board cables) against the boards' exports: every board, connector and pin exists; ground only to  |
| [`harness_document`](#harness_document) | write | Build the project's wiring-harness document from harness.json: wiring diagram (SVG), the check result, every cable's pinout table and a cabl |
| [`check_system`](#check_system) | read | Check a project as a system of linked boards: everything check_harness does for the cables in harness.json, plus direct board-to-board mates |
| [`suggest_links`](#suggest_links) | read | Propose cables between connectors of different boards that no link in harness.json uses yet: same pin count and connector family, grounds on |
| [`accept_links`](#accept_links) | write | Record the current pin-to-net table of every connector used by a cable or mate in harness.json (stored in harness.json under "accepted", wit |
| [`build_index`](#build_index) | write | Recreate index.circuit.tsx for a project of separate boards from harness.json: a <panel> of every board (the ones in harness.json plus those |
| [`board_datasheet`](#board_datasheet) | write | Make a datasheet for a circuit's board from its stored export: overview (the file's header comment), key figures (size, layers, parts, nets, |
| [`check_schematic`](#check_schematic) | read | Does a KiCad schematic read like a drawing or like a dump of labels? Read-only, in milliseconds (the sheet text alone, no KiCad run), over e |
| [`kicad_erc`](#kicad_erc) | read | Run KiCad's own electrical-rules check (kicad-cli sch erc, KiCad 10 on the VM) on the circuit's schematic in the KiCad store, following hier |
| [`kicad_copy_sheets`](#kicad_copy_sheets) | write | Copy the schematic sheets (.kicad_sch) of other circuit folders of the same project into one circuit's folder, as new revisions, so its top  |
| [`kicad_delete`](#kicad_delete) | write | Delete one file from the KiCad store (the deletion is a revision: kicad_restore with an earlier rev brings it back). |
| [`kicad_footprint_create`](#kicad_footprint_create) | write | Make a footprint (.kicad_mod) from a data-only spec and store it as _libs/<library>.pretty/<name>.kicad_mod, where kicad_sync_pcb and lib_as |
| [`kicad_drc`](#kicad_drc) | read | Run KiCad's own design-rule check (KiCad 10 on the VM) on the circuit's board. |
| [`kicad_import_zip`](#kicad_import_zip) | write | Import a KiCad project zip that is already a project asset (add_asset / create_asset_upload; list_assets gives the id) into the KiCad file s |
| [`kicad_import_exports`](#kicad_import_exports) | write | Seed the KiCad-native file store from circuits' stored KiCad exports, so existing circuits open in the browser designer: files land at <circ |
| [`kicad_list`](#kicad_list) | read | List the project's KiCad-native files (.kicad_pcb, .kicad_sch, .kicad_pro, libraries) that the browser designer and MCP share: path, kind, s |
| [`kicad_read`](#kicad_read) | read | Read a KiCad-native file as text with its revision and sha256 (rev reads an older revision). |
| [`pcb_query`](#pcb_query) | read | What is on a KiCad board in one area, on some parts or on some nets, from the store copy at any size (no need to download or strip a big boa |
| [`kicad_diff`](#kicad_diff) | read | What changed between two revisions of a KiCad store file, in design terms. |
| [`kicad_get_url`](#kicad_get_url) | read | A signed download link for one KiCad store file of any size (a board over kicad_read's 2 MB, a STEP model, a library), at its current revisi |
| [`kicad_put_url`](#kicad_put_url) | write | A signed upload link that saves one KiCad store file from the caller's disk, for files too big to pass as kicad_put content. |
| [`export_project`](#export_project) | read | The whole project as one zip behind a signed download link, for a local copy: every KiCad store file (each circuit folder, _libs/, root file |
| [`kicad_put`](#kicad_put) | write | Save a KiCad-native file (text) as the next revision. |
| [`kicad_restore`](#kicad_restore) | write | Restore an older revision of a KiCad-native file as the next revision (history is kept, nothing is rewritten). |
| [`kicad_autoroute`](#kicad_autoroute) | write | Autoroute a .kicad_pcb in the KiCad file store. |
| [`kicad_footprint_audit`](#kicad_footprint_audit) | read | Read-only footprint check of a circuit (the active one): which parts have no usable footprint (needs_footprint: no Footprint field, or a pro |
| [`kicad_set_3d_model`](#kicad_set_3d_model) | write | Show a real STEP 3D model for parts on a board (designer 3D viewer and get_3d_image). |
| [`kicad_fetch_3d_models`](#kicad_fetch_3d_models) | write | Give board parts that have no 3D model a body: for each part without a (model ...) entry it looks up the LCSC number (the part's "Supplier P |
| [`kicad_footprint_bodies`](#kicad_footprint_bodies) | write | Give the project-library footprints used on a circuit's board a 3D body. |
| [`kicad_sync_pcb`](#kicad_sync_pcb) | write | Update the board from the schematic (KiCad's Update PCB from Schematic): reads the circuit's schematic netlist, adds a footprint for every p |
| [`kicad_edit`](#kicad_edit) | write | Edit a .kicad_pcb in the KiCad file store (path e.g. |
| [`kicad_route_plan`](#kicad_route_plan) | read | Find a route before you draw it, in the web service (no KiCad run, nothing saved). |
| [`kicad_ratsnest`](#kicad_ratsnest) | read | Open connections of a KiCad board, as text, in milliseconds (no machine call): for each net still split, the fewest links that would join it |
| [`kicad_tools`](#kicad_tools) | read | List the KiCad tools that kicad_review (read-only checks and exports) and kicad_build (edits, saved as new revisions) accept, with a one-lin |
| [`kicad_review`](#kicad_review) | read | Run a read-only KiCad tool (kicad-mcp-pro, KiCad 10 on the VM) on a KiCad project in the store: DRC/ERC, quality gate, DFM, board and schema |
| [`kicad_build`](#kicad_build) | write | Run a KiCad editing tool (kicad-mcp-pro: routing, stackup, outline, schematic edits, footprint assignment, exclusions) on a KiCad project in |
| [`kicad_revisions`](#kicad_revisions) | read | Revision history of one KiCad-native file, newest first: rev, sha256, size, author, source (designer, mcp, import), note, time. |
| [`kicad_fab`](#kicad_fab) | write | Plot fabrication files with kicad-cli (KiCad 10 on the VM): Gerbers with job file, Excellon drill (PTH and NPTH) with maps, pick-and-place C |
| [`lookup_parts`](#lookup_parts) | write | Look up supplier part numbers for one circuit: matches its parts against our JLCPCB catalogue copy and puts supplier numbers and MPN/availab |
| [`prepare_analysis`](#prepare_analysis) | write | Derive <circuit>.analysis.json for a circuit in the KiCad store from its schematic netlist, so analyze_circuit is not Incomplete: rails (vol |
| [`analyze_circuit`](#analyze_circuit) | read | Static power and thermal estimate for a circuit: rail loads, regulator and resistor dissipation, estimated junction temperatures with ok/war |
| [`run_simulation`](#run_simulation) | read | Run an ngspice SPICE simulation of a circuit. |
| [`get_sim_result`](#get_sim_result) | read | The last saved SPICE result of a circuit (written by every run_simulation, op/tran/dc/ac separately): when it ran, verdict (pass, fail, none |
| [`run_montecarlo`](#run_montecarlo) | read | Tolerance analysis of a circuit on top of its run_sweep assertions: Monte Carlo (seeded random draws of resistor, capacitor, inductor and, i |
| [`validate_spice_model`](#validate_spice_model) | read | Check SPICE model text in the standard form (.subckt NAME ports ... |
| [`set_spice_model`](#set_spice_model) | write | Store a SPICE .subckt model in <circuit>.sim.json (key subckts.<library>) and optionally assign it to a part: models.<ref> = { subckt, pins, |
| [`run_sweep`](#run_sweep) | read | Verification sweep for a circuit (model estimates, operating point per case). |
| [`run_em`](#run_em) | write | Antenna EM solve with openEMS (FDTD) on the VM, from <circuit>.em.json (draft one with prepare_em): f0_ghz and fc_ghz (sweep f0 +- fc), subs |
| [`get_em`](#get_em) | read | Read an antenna EM solve. |
| [`prepare_em`](#prepare_em) | write | Draft a <name>.em.json for an antenna on a KiCad board: reads the net's top-layer copper from the board in the store (shape count, extent, w |
| [`check_zones`](#check_zones) | read | Report on every copper pour of a KiCad circuit's board, from KiCad's own fill (the zones are refilled first; nothing is saved): fill area an |
| [`check_voltage_drop`](#check_voltage_drop) | read | DC voltage drop of one net of a KiCad circuit's board, through the copper as KiCad filled it: tracks, pours, pads and via barrels become a r |
| [`simulate_board`](#simulate_board) | read | The board as it runs, in three views from the static power estimate (analyze_circuit's inputs): power = where the power goes (each supply, e |
| [`run_board_thermal`](#run_board_thermal) | read | Board-level thermal estimate of a KiCad circuit that sees copper and vias (run_thermal does not: it uses each part's thermal resistance alon |
| [`kicad_copper_view`](#kicad_copper_view) | read | Picture of the copper of a KiCad circuit's board for debugging a layout: every layer with the pours as KiCad fills them (refilled first; not |
| [`kicad_sch_view`](#kicad_sch_view) | read | Picture of one sheet of a KiCad circuit's schematic as KiCad itself draws it (kicad-cli sch export svg, rasterised on white), to look at a s |
| [`kicad_fab_preview`](#kicad_fab_preview) | read | Picture of the fabrication files themselves: reads the Gerber and drill files of the circuit's latest kicad_fab zip (not the board they came |
| [`get_checklist`](#get_checklist) | read | The design checklist of a circuit: the 12 gates of the design-to-fab skill (requirements, schematic, specs, power and SPICE, service and fir |
| [`set_checklist`](#set_checklist) | write | Mark one gate or one step of a circuit's design checklist (editor role): status done (after its tool result is clean), open, or deferred wit |
| [`get_design_spec`](#get_design_spec) | read | The design context of a circuit, kept in the portal database (D1), not in a file: requirements (the items check_requirements tests) and cont |
| [`set_design_spec`](#set_design_spec) | write | Save a circuit's requirements and/or context in the portal database (editor role). |
| [`agent_settings`](#agent_settings) | write | Agent settings of one project: the models of the agent and of the four step tiers, the cost limit of one run in cents, scripts (agent_code_c |
| [`git_config`](#git_config) | write | The project's Git repository: a Gitea repo on platform.gite2e.com that the project is pushed to, so its history is kept as commits. |
| [`git_push`](#git_push) | write | Commit the project to its Git repository (git_config first): the KiCad files, legacy files and assets (up to 64 MB each), as one commit (sev |
| [`git_log`](#git_log) | read | Recent commits on the project's Git branch (from Gitea): sha, first line of the message, author, date and a link. |
| [`get_integrations_status`](#get_integrations_status) | read | Check whether your signed-in account has connected GitE2E and Designs (OpenSCAD Cloud) OAuth integrations (remote username, scopes, token ex |
| [`list_project_repos`](#list_project_repos) | read | List all GitE2E repositories linked to a project (board push target, firmware, host software, tests, docs/datasheet sources) with each repo' |
| [`link_repo`](#link_repo) | write | Link a GitE2E repository on platform.gite2e.com to this project with a role (board, firmware, host, tests, docs, other). |
| [`unlink_repo`](#unlink_repo) | write | Remove a linked repository from a project by repo_id (from list_project_repos). |
| [`verify_commit`](#verify_commit) | read | Verify live against platform.gite2e.com (using the caller's connected GitE2E OAuth account or shared token) that commit_sha exists in a link |
| [`link_commit`](#link_commit) | write | Verify a GitE2E commit and record its association with a PCBFlux board change, evaluation, fab release, requirement, datasheet, or pinout. |
| [`list_commit_links`](#list_commit_links) | read | List recorded commit links for a project with verification status and live KiCad file drift (stale: true when schematic or board changed sin |
| [`list_project_designs`](#list_project_designs) | read | List CAD designs on designs.cogniviz.ai linked to this project (enclosure, bracket, fixture, assembly, keepout), with pinned vs latest versi |
| [`link_design`](#link_design) | write | Link a CAD design on designs.cogniviz.ai to this project (by UUID or https://designs.cogniviz.ai/p/<uuid>). |
| [`unlink_design`](#unlink_design) | write | Unlink a CAD design from a project by design_link_id (or design_id). |
| [`verify_design_links`](#verify_design_links) | read | Verify linked CAD designs against designs.cogniviz.ai using the caller's Designs OAuth token and detect version or board drift. |
| [`sync_design_asset`](#sync_design_asset) | write | Copy an exported asset (STEP, STL, PNG render) from a linked Designs project into PCBFlux permanent project_assets storage. |
| [`list_standards`](#list_standards) | read | The standards the portal knows (airborne system, assurance, environment, EMC, power, build, quality, parts, reliability, drone/UAS) and the  |
| [`check_standards`](#check_standards) | read | Optional standards check of a KiCad circuit, for the boards that need it. |
| [`get_build`](#get_build) | read | The build phase of a circuit: the steps that make the design (requirements, rules, circuit, parts, schematic, placement, vias, routing, pour |
| [`set_build_step`](#set_build_step) | write | Mark one build step of a circuit (editor role): built when its files exist (note: what was made, the revision, what a check still reports),  |
| [`run_evaluation`](#run_evaluation) | write | Evaluate a circuit (editor role): run every check on the board as it is, one after the other (erc, library, nets, intent, sim, placement, ro |
| [`get_evaluation`](#get_evaluation) | read | The latest evaluation of a circuit: status (running, done, interrupted), verdict, each check with its status (pass, fail, unknown, skipped,  |
| [`run_tests`](#run_tests) | read | Run every check a circuit has and give one verdict, like a test suite: requirements, intent, em, erc, nets, drc, sim (check_requirements, ch |
| [`suggest_tests`](#suggest_tests) | read | Draft assertions for <circuit>.sim.json (the tests run_sweep, run_montecarlo and run_tests evaluate) from what the simulator sees: one nomin |
| [`confirm_requirement`](#confirm_requirement) | write | Record that a person confirmed one manual requirement of a circuit (editor role): the item then passes in check_requirements and run_tests i |
| [`check_requirements`](#check_requirements) | read | Functional check of a KiCad circuit against its stored requirements (set_design_spec): what the board must be able to do, as items {id, text |
| [`check_intent`](#check_intent) | read | Design-intent check of a circuit against its <circuit>.intent.json: the logic level every listed control net settles to at plug-in, before a |
| [`pin_header`](#pin_header) | read | Generate the firmware pin header (C #define PIN_<signal> <gpio> per intent.mcu.pins entry, with net, mode, polarity and the level at reset i |
| [`verify_design`](#verify_design) | read | One verification report for a circuit, from the KiCad store when it holds the circuit (source kicad/auto: open connections counted from the  |
| [`get_3d_image`](#get_3d_image) | read | PNG render of a circuit's 3D board view (parts placed on the board), from the stored export (or the saved files, compiled by the engine). |
| [`batch_read`](#batch_read) | read | Several read tools in one call: saves a round trip per tool when you need the same read many times (pcb_query per net or box, get_part_spec  |
| [`check_part_footprint`](#check_part_footprint) | read | Does the part that will be bought fit the footprint on the board? Per BOM line of a KiCad circuit: the chosen LCSC part's package from the c |
| [`check_dfm`](#check_dfm) | read | Design-for-manufacture check of a KiCad circuit's board against a fab's limits, in seconds, no runner needed: copper layer count, board size |
| [`check_layout`](#check_layout) | read | Layout practice check of a KiCad circuit's board, in seconds (no DRC run): placement (P1 parts of one schematic sheet grouped together, P2 d |
| [`kicad_netlist`](#kicad_netlist) | read | The real KiCad netlist of a circuit (kicad-cli over the whole sheet hierarchy, read from the stored schematic): each net with its pins (part |
| [`kicad_sch_labels`](#kicad_sch_labels) | write | Put net labels on a KiCad schematic by PART AND PIN, so no coordinates are needed (a label connects only at the exact end of a pin or wire,  |
| [`kicad_sch_blocks`](#kicad_sch_blocks) | write | Redraw a KiCad schematic sheet as pre-wired functional blocks, the way a person draws one, instead of a label on every pin. |
| [`kicad_modules`](#kicad_modules) | write | Library of reusable schematic modules (USB-UART bridge, camera interface, power stage ...) kept in one library project (default "library") a |
| [`kicad_net_diff`](#kicad_net_diff) | read | Compare the schematic netlist with the board's pad nets of a KiCad circuit and list where they disagree: missing_label (the board names a ne |
| [`check_placement`](#check_placement) | read | Check part placement on a circuit's exported board: overlaps, parts closer than clearance_mm (default 0.3), and parts near or over the board |
| [`digikey_search`](#digikey_search) | read | Search DigiKey India (digikey.in; prices in INR, preferred supplier for orders placed in India) by manufacturer part number or keywords. |
| [`digikey_substitutions`](#digikey_substitutions) | read | DigiKey's own substitutes for one part on digikey.in (by DigiKey part number or MPN): type (direct, parametric, similar...), MPN, maker, sto |
| [`onlinecomponents_search`](#onlinecomponents_search) | read | Search onlinecomponents.com by part number (comma-separated for several): stock, on-order and factory lead time, price breaks (USD unless th |
| [`element14_search`](#element14_search) | read | Search element14 India (in.element14.com, Farnell/Newark group; prices in INR) by manufacturer part number, keywords or element14 order code |
| [`mouser_search`](#mouser_search) | read | Search Mouser by part number (mode mpn, exact; Mouser's or the manufacturer's number) or keywords: stock, lead time, minimum order, price br |
| [`search_suppliers`](#search_suppliers) | read | Search a part at every supplier that is set up (DigiKey India, element14 India, Online Components, Mouser) in one call and check stock: retu |
| [`get_sourcing`](#get_sourcing) | read | Where each component of a project is bought: per component (part_key from a make_bom line) the chosen supplier and its part number, other su |
| [`set_sourcing`](#set_sourcing) | write | Choose where to buy components (project database, not the circuit source). |
| [`get_offers`](#get_offers) | read | The last supplier answers saved for a manufacturer part number (every supplier lookup is kept): supplier, supplier part number, stock, unit  |
| [`get_components`](#get_components) | read | What a project's circuits are made of, per BOM line: part_key (as set_sourcing uses), kind, MPN, value, footprint, designators and quantity  |
| [`get_configs`](#get_configs) | read | The parsed per-circuit config files of a project from the database (analysis, sim, thermal, bom, intent, em, harness), optionally one kind. |
| [`make_bom`](#make_bom) | read | Bill of materials for a circuit scaled to an order of N boards: grouped parts, designators, LCSC numbers, order quantities, and warnings for |
| [`run_thermal`](#run_thermal) | read | Thermal check of a circuit. |
| [`check_datasheet`](#check_datasheet) | read | Compare what a circuit asks of each part with the limits in its part spec (datasheet values): LED forward current including temperature dera |
| [`set_part_spec`](#set_part_spec) | write | Add or update a part's electrical spec used by analyze_circuit. |
| [`get_project`](#get_project) | read | One project: id, name, owner, created, last update, circuits, members, archived status, archived_circuits, circuit_versions summary, and lin |
| [`highlight`](#highlight) | read | Mark parts and nets on the PCB map in the editor's agent panel so the person sees what you are talking about (a traced power path, the parts |
| [`rename_project`](#rename_project) | write | Rename a project (the display name; the id stays). |
| [`rename_circuit`](#rename_circuit) | write | Rename a KiCad-store circuit inside its project: the whole folder <circuit>/ moves to <as>/ (files named after the circuit take the new stem |
| [`delete_circuit`](#delete_circuit) | write | Delete one circuit from a project: tombstones its KiCad files (earlier revisions and stored bytes stay, so kicad_restore can bring files bac |
| [`archive_project`](#archive_project) | write | Archive or unarchive this project for your account (hides it from your active list without affecting other members or deleting any files). |
| [`archive_circuit`](#archive_circuit) | write | Archive or unarchive one circuit across the project without deleting its KiCad files, revisions, or saved versions. |
| [`list_circuit_versions`](#list_circuit_versions) | read | List saved version snapshots of a circuit (or inspect one `tag`), comparing stored file manifests against current working files. |
| [`create_circuit_version`](#create_circuit_version) | write | Save a named version snapshot of a circuit's current KiCad files so you can inspect diffs or revert later. |
| [`revert_circuit_version`](#revert_circuit_version) | write | Preview (`dry_run: true`) or revert a circuit's KiCad store files to a saved version `tag` cleanly via forward revisions (preserving full hi |
| [`delete_circuit_version`](#delete_circuit_version) | write | Delete a saved circuit version tag label (owner only; underlying KiCad files and revision history stay intact). |
| [`delete_project`](#delete_project) | write | Permanently delete a project with all its files, history, exports and members. |
| [`list_members`](#list_members) | read | Who has access to a project and with which role. |
| [`list_users`](#list_users) | read | Admin: everyone who has signed in (first and last seen, count), outside users allowed, admins, and each person's project access. |
| [`list_external_users`](#list_external_users) | read | Admin: outside (non-company) addresses allowed to sign in. |
| [`allow_external_user`](#allow_external_user) | write | Admin: allow one outside address to sign in with Google. |
| [`remove_external_user`](#remove_external_user) | write | Admin: block an outside address and drop all its project access. |
| [`remove_member`](#remove_member) | write | Remove a user's access to a project. |
| [`list_revisions`](#list_revisions) | read | Saved versions of a project (id, time, author, message), newest first, up to 100. |
| [`restore_revision`](#restore_revision) | write | Restore every file in a project to a saved version. |
| [`move_file`](#move_file) | write | Move (or copy) a text file into another project; you need edit access to both. |
| [`transfer_project`](#transfer_project) | write | Owner: hand the project to another owner (company or allowed outside address). |
| [`download_circuit_source`](#download_circuit_source) | read | A circuit's source as a zip (a circuit that lives only in the KiCad file store: every file of its folder there, board, schematic, project, l |
| [`get_rules`](#get_rules) | read | Read a circuit's board rules (<circuit>.rules.json; for a KiCad circuit they are mirrored into its .kicad_pro, which KiCad's DRC and the aut |
| [`set_rules`](#set_rules) | write | Write a circuit's board rules. |
| [`list_nets`](#list_nets) | read | Nets of a circuit (from the KiCad store schematic and board when the circuit lives there, else from its export): name, aliases, pin count, k |
| [`get_board_stackup`](#get_board_stackup) | read | START HERE before laying out, placing or connecting a board: how many copper layers it has (KiCad circuits: from the .kicad_pcb in the store |
| [`copy_circuit`](#copy_circuit) | write | KiCad-store circuits (kicad_list) are copied as their whole folder <circuit>/ (all files, sub-sheets, models, config json), as new revisions |
| [`move_circuit`](#move_circuit) | write | KiCad-store circuits: copy the folder, then mark the source files deleted (earlier revisions and stored blobs stay); needs the owner role in |
| [`rename_file`](#rename_file) | write | Rename or move a project file. |
| [`get_export`](#get_export) | read | Fetch a stored export. |
| [`list_3d_shapes`](#list_3d_shapes) | read | Catalogue of the generic 3D shapes add_3d_part can build for visual-only parts: box, cylinder, standoff, ffc_cable, zif_connector, connector |
| [`add_3d_part`](#add_3d_part) | write | Add a visual part (cable, connector housing, latch, camera module, standoff, any body) to a circuit so it shows in the 3D view and in check_ |
| [`list_3d_parts`](#list_3d_parts) | read | Visual parts added with add_3d_part in a circuit: name, shape, parameters. |
| [`remove_3d_part`](#remove_3d_part) | write | Remove a visual part added with add_3d_part, by name (from the .circuit.tsx, or from the board in the KiCad store together with its generate |
| [`get_audit`](#get_audit) | read | Audit log for a project (creates, sharing, setting changes), newest first, up to 200. |
| [`get_settings`](#get_settings) | read | Admin switches (agent, simulations, part lookup, new UI) and agent requests in the last 24 hours. |
| [`set_setting`](#set_setting) | write | Change an admin switch. |
| [`list_part_specs`](#list_part_specs) | read | All part specs (mpn, type, verified flag, datasheet URL). |
| [`get_part_spec`](#get_part_spec) | read | One part spec in full, with its note. |
| [`list_datasheets`](#list_datasheets) | read | Datasheet library: stored manufacturer PDFs (part numbers, revision, pages, fetch date). |
| [`search_components`](#search_components) | read | Search our own copy of the JLCPCB component catalogue (about 500K parts) by MPN, LCSC number or words from the parametric description (volta |
| [`get_component`](#get_component) | read | One component from the catalogue copy by lcsc (C12345) or mpn: record, same-package alternatives, the datasheets in our library for that MPN |
| [`search_datasheets`](#search_datasheets) | read | Full-text search over stored datasheet pages. |
| [`get_datasheet_page`](#get_datasheet_page) | read | Text of one datasheet page (tables in layout form). |
| [`get_datasheet_pdf`](#get_datasheet_pdf) | read | A download link to a stored datasheet's original PDF, by id (list_datasheets) or part number: works for 15 minutes and a few downloads, no s |
| [`import_datasheet`](#import_datasheet) | write | Admins: add a manufacturer datasheet PDF to the library (original kept in the portal's storage, every page's text searchable with search_dat |
| [`delete_datasheet`](#delete_datasheet) | write | Admins: remove one datasheet from the library (row, page texts, search index and the PDF) by id from list_datasheets. |
| [`delete_part_spec`](#delete_part_spec) | write | Remove a part spec. |

## list_projects

List the projects you can open (id, name, owner, your role, organisation, archived status for your account, members). Set include_archived: false to hide projects you archived, or archived_only: true to list only archived projects.

| Argument | Type | What |
|---|---|---|
| `include_archived` | boolean | Include projects archived by your account (default true) |
| `archived_only` | boolean | Return only projects archived by your account (default false) |

## create_project

Create a project. Use template "kicad-blank" for an empty KiCad schematic, board and project file in the KiCad store (then add parts with kicad_build sch_* tools); the other templates (blank, temperature-lcd) are legacy .circuit.tsx. Returns its id.

| Argument | Type | What |
|---|---|---|
| `name` * | string |  |
| `template` | string |  |
| `org` | string | Organisation id (list_projects shows them); default: your only organisation where you may create |
| `owner` | string | Owner email (service token only; default: first admin) |

## share_project

Give a user access to a project.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `email` * | string |  |
| `role` * | one of `viewer` \\| `editor` |  |

## list_files

List a project's files (not the KiCad store: use kicad_list for .kicad_sch, .kicad_pcb and .kicad_pro files).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |

## read_file

Read a project file's text content (not the KiCad store: use kicad_read for .kicad_* files).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string |  |

## write_file

Create or overwrite a project file. For a circuit in the KiCad store use it for config JSON only (<circuit>.analysis.json, .sim.json, .bom.json, .intent.json, .em.json, harness.json: saved in the store next to the schematic); change .kicad_* files with kicad_edit, kicad_build or kicad_put, and the agent cannot create a .circuit.tsx for a KiCad circuit. The rest of this text is for legacy .circuit.tsx projects. Open editors update live and the change is recorded in history; circuit files are re-exported (circuit JSON, KiCad, EasyEDA). For .circuit.tsx files the reply lists source hints for the design-check warnings the export would carry (refdes convention, pinAttributes, <schematicsheet />, courtyards, connector insertionDirection): fix them and write again. Rules: <schematicsheet /> in every <board>; <resistor>/<capacitor>/<inductor>/<transistor>/<pinheader>/<testpoint> instead of <chip> for R/C/L/Q/J/TP parts; every <chip> with pinAttributes marking its power (requiresPower) and ground (requiresGround) pins; custom <footprint>s with a <courtyardrect>; connector footprints with insertionDirection; named <trace>s.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string |  |
| `content` * | string |  |

## edit_file

Change part of a project file without sending it whole: `edits` is a list of { old, new, replace_all? }. Each `old` must occur exactly once in the file (or set replace_all); all edits apply in order or none do, and a miss says which edit failed and why. Saved like write_file (history, live editors, re-export of circuits and of the circuits that import a changed module). Use for large files; read_file first if you do not have the exact text.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string |  |
| `edits` * | array of object |  |

## list_assets

List a project's assets: files kept in R2 such as datasheets, 3D models, photos and fab notes, for the whole project or one circuit.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` | string | Only this circuit's assets |

## get_asset

Read one asset by id. Text files come back as text, small binaries as base64; over 1 MB it returns metadata and a signed download link (url, curl command; 15 minutes, 5 fetches, no sign-in).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `id` * | string |  |

## add_asset

Add an asset to a project or circuit (up to 1 MB here; larger files go through the portal). Allowed types: pdf, png, jpg, webp, txt, md, csv, json, obj, glb, gltf, step, stp, stl, zip. Give base64 for binary files or text for text files.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `name` * | string | File name with extension |
| `circuit` | string |  |
| `note` | string |  |
| `base64` | string |  |
| `text` | string |  |

## create_asset_upload

Get a one-time upload link for a file on the caller's disk, for files too big for add_asset. Returns a URL (valid 10 minutes, one use, fixed file name, up to 25 MB) and a curl command: run `curl -fsS -T <file> <url>` yourself, do not paste the file into this chat. Same allowed types as add_asset.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `name` * | string | File name with extension, as it should be stored |
| `circuit` | string |  |
| `note` | string |  |

## delete_asset

Delete an asset by id (also removes the stored file).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `id` * | string |  |

## delete_file

Delete a project file.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string |  |

## list_events

Recent change events for a project (saves by people and agents), optionally after an ISO timestamp.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `since` | string |  |

## list_exports

List stored exports (circuit JSON, KiCad zip, EasyEDA PCB JSON), export job status (a done job's error field holds notes such as a partly routed board or a skipped KiCad zip) and part-lookup job status for a project.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |

## list_connectors

Every connector on every exported board of the project (single-board circuits): ref, MPN, footprint, detected family (JST-GH, JST-PH, PicoBlade, Micro-Fit, DF13, 2.54 mm header, terminal block...), pitch, pin count, and each pin's label, net, kind (power/ground/signal/nc) and rail voltage from the board's analysis.json. The input for writing harness.json.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `boards` | array of string | Only these circuits (default: all single-board circuits) |

## check_harness

Check the project's harness.json (board-to-board cables) against the boards' exports: every board, connector and pin exists; ground only to ground; power to power with matching rail voltages; one supply per power wire (regulator outputs supply, analysis.json sources are fed, or the wire's supply field); housing family, pin count and pitch mate with the board connector; wire gauge and contact rating against the estimated load; no pin wired twice; board connector pins with a net but no wire. Returns verdict ok/warn/fail, findings per cable and the resolved pinout. harness.json format: {cables:[{id, label, from:{board, connector, housing:{mpn, family, pins, pitch_mm, lcsc}, crimp:{mpn, lcsc}} \| {external, pins}, to:{...}, gauge_awg, length_mm, twisted_pairs:[[a,b]], shield, wires:[{from_pin, to_pin, net, color, gauge_awg, supply:'from'\|'to'}]}]}; pins are numbers or labels.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |

## harness_document

Build the project's wiring-harness document from harness.json: wiring diagram (SVG), the check result, every cable's pinout table and a cable BOM (housings and crimps per end, given or suggested from the connector family, wire length per gauge and colour). Stored as the export harness/harness_html (self-contained HTML, print to PDF); returns the BOM and a download link. Each board's datasheet also gets a Cables section from harness.json.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |

## check_system

Check a project as a system of linked boards: everything check_harness does for the cables in harness.json, plus direct board-to-board mates (harness.json "mates": [{ id, label, from: { board, connector }, to: { board, connector }, map: same \| reverse \| swap_rows \| [[fromPin, toPin]] }], connectors that plug into each other with no cable: pin count, pitch and every pin pair), signals across each link (CAN_H to CAN_L, SDA to SCL, MOSI to MISO, D+ to D- swaps; TX wired to TX; mixed signal types; logic levels from wire from_level_v / to_level_v, "boards": { name: { io_volts } }, a _3V3 style net suffix or a pull-up rail), differential pairs (both lines present and listed in twisted_pairs), buses across boards (two CAN terminators per bus, I2C pull-ups present, not too strong, one voltage), power (what each supplying rail feeds on the other boards against "boards": { name: { supply_ma: { NET: mA } } }, and the voltage drop in each cable from gauge, length and load) and connector pins whose net changed since accept_links. Returns verdict ok/warn/fail, state (accepted, changed pins), boards and links with their own verdict, the power budget and findings tagged by check (harness, mate, signal, bus, power, stale). include_boards: true also runs verify_design on every linked board (slow) and adds board_checks and a combined project_verdict. A project without harness.json returns verdict none and its boards. Estimates only: roles come from net names, currents from each board's analysis.json; pin direction, I2C addresses and the mechanical fit of mated boards are not checked.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `include_boards` | boolean | Also run verify_design on every linked board (default false) |

## suggest_links

Propose cables between connectors of different boards that no link in harness.json uses yet: same pin count and connector family, grounds on grounds, power on power at the same voltage, signals with the same name or a matching role (TX to RX), tried pin 1 to pin 1 and reversed. Returns candidates with a score, best first, each with from, to and wires ready to paste into harness.json cables (add id, gauge_awg, length_mm, housings). A starting point to review, not a decision: generic two-pin power connectors match many others.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `limit` | number | Most candidates to return (default 20, max 60) |

## accept_links

Record the current pin-to-net table of every connector used by a cable or mate in harness.json (stored in harness.json under "accepted", with time and author). From then on check_system warns when a board edit changes one of those pins, so links that went out of date are seen. Run it after check_system is clean and the links were reviewed. Refuses when a linked board or connector cannot be read.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |

## build_index

Recreate index.circuit.tsx for a project of separate boards from harness.json: a <panel> of every board (the ones in harness.json plus those the index already imports), most-cabled board first, the existing description kept, a generated layout map (a grid of the boards as the PCB view shows them with row, column, centre, size and cables per board) and a generated comment block listing every cable with its ends, wire count, gauge and length and the check_harness verdict. A panel that already has its own attributes (width, cells, gap) or a label list is kept as it is: only missing boards are added and the generated header blocks rewritten. Refuses when the index is itself a board composed of blocks (one PCB, no cables between its blocks) unless force is true. Writes the file (an export follows); returns the new source.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `force` | boolean | Replace an index that is a composed <board> |

## board_datasheet

Make a datasheet for a circuit's board from its stored export: overview (the file's header comment), key figures (size, layers, parts, nets, rules), a dimensioned mechanical / footprint drawing (outline, mounting holes, connector pads with pin 1, origin bottom-left) with hole and connector coordinates for a mating board, KiCad's top and bottom plots, connector pinouts with nets and voltages, power rails from analyze_circuit, main parts with MPN and LCSC, BOM and design-check summary. Stored as the export board_datasheet (self-contained HTML, print to PDF); returns a download link. Electrical figures are estimates.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name without .circuit.tsx |

## check_schematic

Does a KiCad schematic read like a drawing or like a dump of labels? Read-only, in milliseconds (the sheet text alone, no KiCad run), over every sheet of the circuit or one (path). Per sheet and in total: parts, wires, junctions, labels (local, global, hierarchical), power symbols, flags, text notes, and wires, labels and power symbols per part (hand-drawn sheets run about 2.7-4.1, 0.5-0.95 and 0.7-1.1; a label dump has no wires and 3-5 labels per part). Findings, each with severity, a fix naming the tool, and evidence with sheet, refs and mm coordinates (up to 20): label_dump (wires/part under 1.5 with labels/part over 2: fail), power_as_labels (rails such as GND, +3V3, VBUS or nets on power input pins drawn only as labels: fix with kicad_sch_labels labels_to_power), off_grid (wire ends and label anchors off 1.27 mm), dangling_labels (on no wire end or pin end), overlaps (symbol on symbol, label or power symbol on a part), outside_paper (fail), margin (15 mm) and title_block, orientation (two-pin R/C/L/D/F/FB against their role: a pin on a rail = shunt, stands vertical; series lies horizontal; low unless most are), no_text (over 15 parts and no text), visible_fields (Footprint, Datasheet, MPN, LCSC, Description shown), sheetfile_climbs ('..' to no sheet of the store: fail) and sheetfile_path. verdict: fail, review or pass. kicad_erc stays the judge of connections.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `path` | string | One .kicad_sch of the circuit (default: all its sheets) |

## kicad_erc

Run KiCad's own electrical-rules check (kicad-cli sch erc, KiCad 10 on the VM) on the circuit's schematic in the KiCad store, following hierarchical sub-sheets. Takes seconds even for a sheet with hundreds of parts, where kicad_review run_erc (through kicad-mcp-pro) stops at 150 s on a big one. Returns counts by severity, a by_type table (count and two examples per type) and the first `limit` findings (default 30) with sheet path, position (x_mm, y_mm: the sheet's own mm, as in the .kicad_sch) and, when a finding has two sides (two pins in conflict, a flag and the wire it touches), the second one as other / other_x_mm / other_y_mm. rev (and sheet_revs) say which revision of each file was checked. Library findings (lib_symbol_issues, lib_symbol_mismatch, footprint_link_issues: the server has no KiCad libraries installed) are counted under set_aside, not as violations; include_library: true lists them. Run it after every kicad_build / sch_* change.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name without .circuit.tsx |
| `include_library` | boolean | List the library findings with the rest (default false: set aside) |
| `summary_only` | boolean | Counts and the by_type table only |
| `severity` | one of `error` \\| `warning` \\| `exclusion` |  |
| `types` | array of string | Finding types, e.g. ["pin_not_connected","power_pin_not_driven"] |
| `limit` | number |  |
| `offset` | number |  |

## kicad_copy_sheets

Copy the schematic sheets (.kicad_sch) of other circuit folders of the same project into one circuit's folder, as new revisions, so its top sheet can use them as sub-sheets (the KiCad tools only load sheets that sit in the circuit's own folder). The bytes are copied inside the server: nothing passes through the chat. from: circuit folder names; files: optional sheet file names to take (default every .kicad_sch in each folder); an existing different sheet is kept unless overwrite is true; dry_run lists what would be copied. Afterwards add each sheet to the destination's top sheet (Sheetfile = the copied name) and run kicad_review run_erc on it. Needs edit access.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `from` * | array of string | Source circuit folders, e.g. ["cam-core","cam-io"] |
| `to` * | string | Destination circuit folder, e.g. carrier |
| `files` | array of string |  |
| `overwrite` | boolean |  |
| `dry_run` | boolean |  |

## kicad_delete

Delete one file from the KiCad store (the deletion is a revision: kicad_restore with an earlier rev brings it back). Use it for leftovers such as old split sub-sheets after merging them into one sheet. Refuses a circuit's root files (<circuit>/<circuit>.kicad_sch, .kicad_pcb, .kicad_pro). base_rev is the rev from kicad_list.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string | Store path, e.g. my-board/power.kicad_sch |
| `base_rev` * | number | The file's rev from kicad_list |
| `note` | string |  |

## kicad_footprint_create

Make a footprint (.kicad_mod) from a data-only spec and store it as _libs/<library>.pretty/<name>.kicad_mod, where kicad_sync_pcb and lib_assign_footprint-by-field find it (set the schematic Footprint field to <library>:<name>). For parts the stock KiCad libraries lack: M.2 or mini-PCIe sockets, SIM slots, card edges. spec: { name, description?, pads: [{ number, type: smd\|thru_hole\|np_thru_hole (default smd), shape: rect\|roundrect\|circle\|oval (default rect), x, y, w, h, drill (thru_hole), rratio (roundrect), layers? }], courtyard_margin?, silk?, pin1?, body? } in mm, origin at the part centre. A generic 3D block body (from the pad extent, estimated height by name; body: { height_mm } sets it, body: false leaves it off) is saved as <circuit>/3dmodels/<name>.wrl and referenced by the footprint, so the 3D viewer shows the part (a stand-in, not a manufacturer model). Silkscreen outline (clear of the pads), a pin 1 mark, fab and courtyard outlines are drawn from the pads (silk:false leaves the silkscreen off; pin1: pad number to mark, default the first pad). Check the pad positions against the manufacturer's drawing: this tool draws what you give it. overwrite:true replaces an existing footprint of that name (running it again also lists the library in the circuits' fp-lib-table, which the designer's footprint editor reads). The library is added to the fp-lib-table of every circuit folder with a board (or just `circuit`), so the editor lists it.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `library` * | string | Library name, e.g. myparts (stored as _libs/myparts.pretty) |
| `circuit` | string | Only list the library in this circuit folder's fp-lib-table (default: every circuit with a board) |
| `spec` * | object |  |
| `overwrite` | boolean |  |
| `dry_run` | boolean | Return the footprint text without saving |

## kicad_drc

Run KiCad's own design-rule check (KiCad 10 on the VM) on the circuit's board. source: kicad = the circuit's .kicad_pcb in the KiCad store (the files the designer and kicad_edit change, run through kicad-mcp-pro run_drc), tsx = the circuit's stored KiCad export (kicad-cli, the legacy pipeline), auto (default) = kicad when the store has the board, else tsx (kicad_error says why a kicad run fell back). Checks: clearance, edge clearance, track width, annular ring, holes, courtyards, silk, text, unconnected items. Returns counts, a by_type table (count and two examples per finding type) and the first `limit` findings (default 30) with positions (mm, KiCad coordinates); the raw result can be 80,000 characters, so narrow it: summary_only, severity, types, copper_only, limit/offset. The KiCad project carries the circuit's <circuit>.rules.json (net classes, silk and clearance limits), so KiCad judges by the board's own rules (source tsx; source kicad uses the rules in the stored .kicad_pro). Open connections: unconnected.total is the complete count and unconnected.by_net lists every net with its count (never capped; the item list is only a sample), counted with the zones refilled for the check (the refill is not saved). Footprint-library findings are set aside (set_aside). A second opinion next to verify_design; source tsx needs a finished export.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name without .circuit.tsx |
| `source` | one of `auto` \\| `kicad` \\| `tsx` | kicad = the KiCad store, tsx = the stored KiCad export, auto (default) = kicad when the store has the board, else tsx |
| `summary_only` | boolean | Counts and the by_type table only |
| `severity` | one of `error` \\| `warning` \\| `exclusion` |  |
| `types` | array of string | Finding types, e.g. ["clearance","silk_overlap"] |
| `copper_only` | boolean | Only copper findings (clearance, shorts, track width, annular ring, unconnected, zones...) |
| `limit` | number |  |
| `offset` | number |  |

## kicad_import_zip

Import a KiCad project zip that is already a project asset (add_asset / create_asset_upload; list_assets gives the id) into the KiCad file store as one circuit, server side, so large boards need no pasting through kicad_put. Files land at <circuit>/<name in the zip> (one wrapping folder is dropped; backups, .ses/.dsn and logs are not stored). circuit defaults to the asset's name without .zip. Identical files are skipped; a file edited since an import is kept unless overwrite is true. dry_run lists what would be stored. Safe to call again: files already stored with the same content are left alone and listed in already_stored with their rev (a call that ended in a gateway error may still have saved, retry_note says so).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `asset` * | string | Asset id from list_assets |
| `circuit` | string |  |
| `overwrite` | boolean | Replace files someone edited. Lists them in `replaced`; combine with base_revs so a concurrent edit is refused, not undone |
| `base_revs` | object | { "<circuit>/<path>": rev } the revision you built the zip from; a file whose current revision differs is not written and comes back in `conflicts` |
| `dry_run` | boolean | Report what would be imported, replaced or refused, write nothing |

## kicad_import_exports

Seed the KiCad-native file store from circuits' stored KiCad exports, so existing circuits open in the browser designer: files land at <circuit>/<name from the export zip>, which for a tscircuit export is <circuit>/<circuit>.circuit.kicad_pcb, <circuit>/<circuit>.circuit.kicad_sch, <circuit>/<circuit>.circuit.kicad_pro and so on (kicad_list shows them; the reply's roots says which .kicad_pro, board and schematic the store takes as each circuit's root). A circuit is one KiCad project folder: its root is the .kicad_pro stem and the board and root schematic of that stem (the .circuit infix is optional; both naming styles work); other .kicad_sch files are hierarchical sub-sheets, not circuits. circuits defaults to every circuit with a finished KiCad export. Identical files are skipped; a file changed since the import (a designer or MCP edit) is kept unless overwrite is true. Run dry_run first.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuits` | array of string |  |
| `overwrite` | boolean |  |
| `dry_run` | boolean |  |

## kicad_list

List the project's KiCad-native files (.kicad_pcb, .kicad_sch, .kicad_pro, libraries) that the browser designer and MCP share: path, kind, size, sha256, rev, who saved it last. Paths look like 01-atmega328p-arduino/01-atmega328p-arduino.circuit.kicad_pcb (the board of circuit 01-atmega328p-arduino); pass them to kicad_read, kicad_edit and kicad_review. A project can hold hundreds of files (about 55 KB of JSON for the demo), so the list is paged: circuit (a circuit name, or a path prefix containing a slash) narrows it, kind filters (pcb, sch, pro, lib, model, other), limit (default 200, max 1000) and offset page it. A circuit is a top-level folder with a .kicad_pro or .kicad_pcb; sub-sheets (other .kicad_sch files, any folder depth up to 4 segments) belong to it. The project-level folder _libs/ holds shared libraries a circuit's fp-lib-table/sym-lib-table reach as ${KIPRJMOD}/../_libs/<x> (it is not a circuit; circuit "_libs" lists it); total is the match count before paging and more the number beyond this page.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `kind` | one of `pcb` \\| `sch` \\| `pro` \\| `lib` \\| `model` \\| `other` |  |
| `circuit` | string | Circuit name (files under <circuit>/) or a path prefix such as 01-atmega328p-arduino/ |
| `limit` | integer |  |
| `offset` | integer |  |

## kicad_read

Read a KiCad-native file as text with its revision and sha256 (rev reads an older revision). path is from kicad_list, e.g. 01-atmega328p-arduino/01-atmega328p-arduino.circuit.kicad_pcb. Refuses files over 2 MB: without_fills: true leaves out the zones' fill polygons (usually most of a big board; outlines and settings stay) and the limit applies to what is left; kicad_get_url gives a download link for any size, pcb_query reads part of a board. Text read without fills is for reading: do not kicad_put it back (refill_zones would restore the fills, but a put of it saves a board with empty zones). Pass the returned rev as base_rev to kicad_put.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string |  |
| `rev` | integer |  |
| `without_fills` | boolean | Leave out zone fill data (filled_polygon, fill_segments) |

## pcb_query

What is on a KiCad board in one area, on some parts or on some nets, from the store copy at any size (no need to download or strip a big board): footprints (ref, value, footprint, position, angle, side, box, pads with net and size), tracks (net, layer, width, start, end, length, id), vias (net, position, size, drill, id), zones (net, layers, priority, filled, outline, settings) and graphics. Filters combine: bbox [x0, y0, x1, y1] (mm, KiCad frame y down: the coordinates kicad_edit takes) keeps items that touch the box; refs (globs, U1, J*) keeps those parts and, given alone, also the tracks, vias and zones of the nets on their pads; nets (globs); layers (F.Cu, In1.Cu ...); kinds (footprints, tracks, vias, zones, graphics). Each kind is capped at limit (default 200); counts gives the full numbers. With no filter it reads the whole board, footprints without their pads (pads: true adds them): good for a first look, then ask by refs, nets or bbox. rev reads an older revision.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string | A .kicad_pcb path from kicad_list |
| `rev` | integer |  |
| `bbox` | array of number | [x0, y0, x1, y1] mm, KiCad frame |
| `refs` | array of string |  |
| `nets` | array of string |  |
| `layers` | array of string |  |
| `kinds` | array of string |  |
| `limit` | integer | Per kind, default 200, max 1000 |
| `pads` | boolean | List each footprint's pads (default true) |

## kicad_diff

What changed between two revisions of a KiCad store file, in design terms. Board: parts added, removed, moved (distance), edited (value, footprint, pad nets); tracks and vias added or removed per net (with length); zones added, removed or changed (outline, settings, fill); nets added or removed; other items; bytes_by_item says which kind of item made the file grow or shrink (zone fill, tracks ...). Schematic: symbols added, removed, edited (value, footprint, lib_id, position), and wires, labels, junctions added or removed. Other files: changed lines. Identifiers (uuid) and ordering are ignored. rev_b defaults to the current revision, rev_a to the one before rev_b; kicad_revisions lists them.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string |  |
| `rev_a` | integer |  |
| `rev_b` | integer |  |

## kicad_get_url

A signed download link for one KiCad store file of any size (a board over kicad_read's 2 MB, a STEP model, a library), at its current revision or at rev. Returns url and a curl command (curl -fsSL -o <file> <url>), the rev and sha256 it serves, and the expiry: 15 minutes, 5 fetches, no sign-in (the link is the credential, keep it private). Keep the rev: kicad_put_url needs it as base_rev to send the file back. For a whole folder or project use download_circuit_source or export_project.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string | Store path from kicad_list |
| `rev` | integer | An older revision (kicad_revisions); default the current one |

## kicad_put_url

A signed upload link that saves one KiCad store file from the caller's disk, for files too big to pass as kicad_put content. curl -fsS -T <file> <url> saves it as a new revision only if the file is still at base_rev (0 = a new file); otherwise the upload answers HTTP 409 with the current rev and nothing is saved. Single use, 10 minutes. The upload's JSON answer gives the new rev and sha256. Needs edit access.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string | Store path, e.g. payload-5/payload-5.kicad_sch |
| `base_rev` * | integer | The rev the local copy started from (kicad_get_url, kicad_list or export_project's PROJECT.json); 0 for a new file |
| `note` | string | Revision note, e.g. what changed |

## export_project

The whole project as one zip behind a signed download link, for a local copy: every KiCad store file (each circuit folder, _libs/, root files) at its current revision, the project's other files (config JSON, legacy .circuit.tsx, harness.json), and the data that lives only in the portal's database as portal/*.json: design spec and checklist with their history, sourcing and the parts each circuit uses, part specs, the last power/thermal estimate, and the kept SPICE, Monte Carlo and antenna EM results. PROJECT.json lists every store file with its rev and sha256 (the base_rev for kicad_put_url). models: false leaves out 3D models (.step .stp .wrl .glb), which are often most of the size; include / exclude take globs ("*.kicad_*", "payload-5/*"); assets: true adds uploaded assets. Up to 300 MB of files and 900 files. Returns url, curl command, size and what was left out; the link lasts 15 minutes (5 fetches).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuits` | array of string | Only these circuits (their folders, the libraries they use, their config files); default all |
| `models` | boolean | Include 3D model files (default true) |
| `include` | array of string | Only paths matching one of these globs |
| `exclude` | array of string | Leave out paths matching these globs |
| `assets` | boolean | Add uploaded assets under assets/ (default false) |
| `portal_data` | boolean | Add portal/*.json (default true) |

## kicad_put

Save a KiCad-native file (text) as the next revision. base_rev must be the revision you read (0 for a new file); a stale base_rev is refused with the current revision so nothing is overwritten. The designer shows the change after a refresh.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string |  |
| `content` * | string |  |
| `base_rev` * | integer |  |
| `note` | string |  |

## kicad_restore

Restore an older revision of a KiCad-native file as the next revision (history is kept, nothing is rewritten). Reads rev N (kicad_revisions) and saves it with the note "restore of rev N". base_rev must be the file's current revision (0 if it was deleted), as for kicad_put; a stale base_rev is refused with the current revision. Identical to the current bytes: nothing is saved.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string |  |
| `rev` * | integer |  |
| `base_rev` * | integer |  |
| `note` | string |  |

## kicad_autoroute

Autoroute a .kicad_pcb in the KiCad file store. The routed board is saved as the next revision (source mcp) and the reply carries the DRC counts and first findings of the result and the track counts before and after. Place the parts first (kicad_edit move_footprint) and set net classes (set_net_class): the routers follow the board's net classes and rules from the .kicad_pro. engine "tracemaker" (default): TraceMaker, a GPU router (CUDA) on a router machine of the organisation (Settings > Job runners; 503 when none is online). It runs a portfolio of differently tuned routers and keeps the best board, routes differential pairs (KiCad _P/_N names) as coupled pairs (diff_pairs, default true), routes critical nets (clocks, crystals, USB, Ethernet, PCIe, DDR, pairs) first (critical, default true), fills zones in memory so plane nets drop vias into their planes, keeps the copper that is there, and widens power tracks after routing up to their class width and towards net_widths where there is room. Options: pitch_um 10..500 (lattice pitch; default automatic; a coarser pitch such as 50 needs much less memory on a dense board), first_nets (nets routed first, never ripped by others), no_tracks_on (copper layers that get no new tracks, e.g. inner planes), relax (route under reduced clearance first, then legalise: helps very dense boards), via_in_pad (allow vias in enclosed pads; needs filled, capped vias). The reply carries engine_version and router_summary (connections, routed, open, completion_pct, tracks, vias, pitch, seconds, the variant that won, failures: the connections left open and why, pairs: coupling and skew per differential pair). engine "freerouting" (on the service machine): max_passes 1..100 (default 20), keep_copper; without keep_copper it clears the board and routes every net with no zone fills. time_limit_s 60..3600 (default 1800): the run's wall-clock budget; TraceMaker stops a little before it and returns the best board it has, Freerouting stops at its own timeout and writes its board; the reply then has partial: true and route_note, and drc.unconnected_by_net is the complete list of what is still open, by net. bbox [x1, y1, x2, y2] in mm (both engines) routes only inside that rectangle: the router gets a cut-out of the board with all copper in it fixed, tracks that cross the edge stay as the places to connect to, only connections that are open inside are routed (nets that own a zone are left alone in a cut-out), and the new copper is added to the full board with nothing else changed (reply: crop, merge). protect_nets (names or globs, both engines) are never touched: their copper is fixed and any new copper on them or within 0.2 mm of them is left out and listed in merge.dropped_on_protected; locked tracks are always fixed. dry_run routes and reports without saving. A run is a background job kept 60 minutes after it ends, so a caller that was cut off can come back with the job id: the call waits about 70 s, and if routing is still going it returns status running with a job id, base_rev and the router's last log line (progress), so call again with them. base_rev as in kicad_edit. Autorouted boards need a human look before fabrication, the high-speed pairs above all. Before saving, the result is compared with the board's own rules (.kicad_pro net classes and minimums): when the run added tracks or vias smaller than those, nothing is saved and below_rules lists them by net, size and rule; call again with the same job and base_rev and allow_below_rules: true to save that route as it is. Freerouting writes some segments at 75 % of the width it was given: the service sets those back when the board is no worse for it (widths_repaired in the reply; widths_note when it could not).

| Argument | Type | What |
|---|---|---|
| `allow_below_rules` | boolean | Save a route that has new tracks or vias smaller than the board rules (see below_rules in the reply); default false |
| `project` * | string | Project id, from list_projects |
| `path` * | string | A .kicad_pcb path from kicad_list |
| `engine` | one of `tracemaker` \\| `freerouting` |  |
| `max_passes` | integer | freerouting only |
| `pitch_um` | number | tracemaker: lattice pitch in micrometres (default automatic) |
| `diff_pairs` | boolean | tracemaker: route differential pairs as coupled pairs (default true) |
| `critical` | boolean | tracemaker: route clocks, crystals and high-speed links first (default true) |
| `first_nets` | array of string | tracemaker: nets routed first and never ripped up by others |
| `no_tracks_on` | array of string | tracemaker: copper layers that get no new tracks, e.g. ["In1.Cu", "In2.Cu"] |
| `relax` | boolean | tracemaker: route under reduced clearance first, then legalise (very dense boards) |
| `via_in_pad` | boolean | tracemaker: allow minimum vias in enclosed pads (needs filled, capped vias) |
| `soft_zones` | boolean | tracemaker: saved zone fills (planes) do not block new tracks and vias; the zones are refilled after the route (default true). Without it a signal via must find a gap in every filled plane |
| `fast_bends` | boolean | tracemaker: approximate bend costs, about a ninth of the router memory, so the runner can run more variants on a big board (default false) |
| `net_widths` | object | Width in mm per net name or glob, e.g. {"+3V3": 0.6, "VBUS*": 1.0}. freerouting: the route width (written into the DSN as net classes; net_widths_applied says which nets matched). tracemaker: routed at the class width, then widened towards this width where there is room |
| `time_limit_s` | integer |  |
| `require_complete` | boolean | Save only if this very run has no unconnected items (routing is not deterministic, so a clean dry run does not mean the next run is clean). Leave it out to keep a partial route: the reply says open_connections. A run it refused can still be kept: call again with its job, the same base_rev and require_complete false |
| `bbox` | array of number | [x1, y1, x2, y2] in mm: route only inside this rectangle (at least 2 x 2 mm) |
| `protect_nets` | array of string | Net names or globs the router must not touch or come near (RF lines) |
| `keep_copper` | boolean | freerouting: keep the existing copper and route only what is open |
| `job` | string | Job id from a reply with status running: follow that run instead of starting another |
| `base_rev` | integer |  |
| `dry_run` | boolean |  |
| `note` | string |  |

## kicad_footprint_audit

Read-only footprint check of a circuit (the active one): which parts have no usable footprint (needs_footprint: no Footprint field, or a project library entry whose file is missing; each with value, MPN and LCSC number from the schematic fields, grouped by identical request), which are not on the board yet (not_on_board), which board parts carry another footprint than the schematic names (footprint_swaps) and which differ from their project-library footprint (stale_footprints: pads or silkscreen changed) and which board parts carry another Value than the schematic (value_mismatches: placement files and assembly drawings take the board's). Use it first, then import what is missing: PcbParts cse_get_kicad / jlc_get_part by LCSC number (or another supplier API, or the datasheet drawing with kicad_footprint_create), kicad_put into _libs/<lib>.pretty, kicad_build lib_assign_footprint, then kicad_sync_pcb.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit (folder) name, e.g. core |

## kicad_set_3d_model

Show a real STEP 3D model for parts on a board (designer 3D viewer and get_3d_image). Workflow: get the maker's .step/.stp (Bourns, Wuerth etc. publish them; KiCad's stock library already covers common parts), upload it with create_asset_upload (or add_asset), then call this with the asset id and the reference designators. The file is stored at <circuit>/3dmodels/<name>.step and each named part's (model ...) entry is set in the board (stock or project-library footprints), and in the project-library footprint file too (update_library, default true) so an update from the library keeps it. STEP models are in mm in the footprint frame; if the body sits wrong set offset [x,y,z] mm, rotate [x,y,z] degrees or scale [x,y,z] and run again. Without asset it moves the model the parts already have (offset / rotate / scale replace the old placement; the model file stays). Try a placement without saving first: get_3d_image with refs and try_place. Check with get_3d_image.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit folder name |
| `refs` * | array of string | Reference designators, e.g. ["L1","L2"] |
| `asset` | string | Asset id of the .step/.stp file (list_assets) |
| `name` | string | File name to store under 3dmodels/ (default: the asset's name) |
| `offset` | array of number |  |
| `rotate` | array of number |  |
| `scale` | array of number |  |
| `update_library` | boolean |  |
| `dry_run` | boolean |  |

## kicad_fetch_3d_models

Give board parts that have no 3D model a body: for each part without a (model ...) entry it looks up the LCSC number (the part's "Supplier Part Number" field, or lcsc {ref: "C123"}), fetches the real STEP model from the EasyEDA / LCSC open library (source: JLCEDA/EasyEDA Official Library), stores it under <circuit>/3dmodels/easyeda/<LCSC>.step and sets the part's model entry placed by the library's own origin relative to the pads. Parts with no LCSC number, no library model, a STEP over max_mb (default 1.5) or over the render budget (budget_mb, default 40, up to 200: each model file goes to the render server on its own, gzipped, and is cached there by hash) get a generic block from the footprint outline unless blocks is false. To find missing LCSC numbers search with PcbParts jlc_search by MPN and pass them in lcsc. EasyEDA models are user-contributed: check with get_3d_image; a part sitting rotated or offset is fixed with rotate {ref:[x,y,z]} here or kicad_set_3d_model. dry_run lists what would happen. Works on stock and project-library footprints alike (board text only, no pcbnew run).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit folder name |
| `refs` | array of string | Only these reference designators (default: every part without a model) |
| `lcsc` | object | LCSC number by reference designator, e.g. { "U1": "C431631" }; wins over the part's field |
| `rotate` | object | Model rotation in degrees by reference designator, e.g. { "U1": [0, 0, 90] } |
| `max_mb` | number | Largest STEP file to store per part (default 1.5, up to 32; connectors such as RJ45, USB and HDMI are 3 to 12 MB) |
| `budget_mb` | number | Total STEP size for this run (default 40, up to 200) |
| `max_parts` | integer | Parts per run (default 60, up to 200); run again for the rest |
| `blocks` | boolean | Generic block for parts without a library model (default true) |
| `replace` | boolean | Also replace models parts already have |
| `dry_run` | boolean |  |

## kicad_footprint_bodies

Give the project-library footprints used on a circuit's board a 3D body. The 3D viewer and KiCad's renderer draw a part only when its footprint has a (model ...) entry; a footprint made from pads alone (kicad_footprint_create before bodies, imported or hand-written ones) shows as bare board. For each project-library footprint on the board without a model this writes a generic block body (VRML, from the footprint's fab outline or pad extent, height estimated from the name or given in `heights`) to <circuit>/3dmodels/<name>.wrl, adds the model entry to the library footprint, and refreshes the board's copies from the library (kicad_edit update_footprint; position, nets and values kept) so the board carries it. Stock-library footprints are left alone. Stand-in bodies, not manufacturer models: replace with a STEP/WRL from the maker when you have one. dry_run lists what it would do.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit folder name |
| `library` | string | Only this library nickname |
| `heights` | object | Body height in mm by footprint name, e.g. { "RJ45_USAKRO_DGUK111Q340AB2A1D2_2.5G": 13.5 } |
| `overwrite` | boolean | Replace a model the footprint already has |
| `board_refresh` | boolean | Default true: refresh the board's footprints from the library |
| `dry_run` | boolean |  |

## kicad_sync_pcb

Update the board from the schematic (KiCad's Update PCB from Schematic): reads the circuit's schematic netlist, adds a footprint for every part the board does not have yet (the part's assigned footprint, from KiCad's stock libraries or the project's _libs/<lib>.pretty), gives every pad its schematic net, and reports parts that are not in the schematic. New parts are laid out in a grid at origin (default 10,10 mm, 6 per row): place them afterwards with kicad_edit move_footprint. Optional outline {width,height,x?,y?} replaces the Edge.Cuts rectangle; remove_orphans removes board parts that are not in the schematic. dry_run shows what would change, including DRC before and after (drc_before, drc_after) and the nets it could not match (nets.unmatched: left as they are), matched under another spelling (nets.aliased) or had to create (nets.created). A sync that would add copper errors or open items is refused (saved: false, refused: true) unless force: true, so a net-name mismatch cannot silently split nets from their tracks. Parts without an assigned footprint are listed in no_footprint_assigned (use kicad_build lib_assign_footprint). Footprints stay in step with the schematic and the library: a part whose schematic Footprint field names another footprint than the board part carries is swapped (footprints_swapped; nets by the new pad numbers), and board parts that differ from their project-library footprint (_libs/<lib>.pretty: pads or silkscreen changed) are listed in stale_footprints; refresh_footprints: true takes the library version for them (position, angle, side, value and nets kept). Every footprint is linked to its schematic symbol (symbol_links_set says how many links were missing), which is what the designer's own Update PCB from Schematic matches on. A board that carries a reference more than once is reported (duplicate_refs: each copy's position and whether it is inside the outline; in_sync is then false): remove_duplicates: true keeps the copy inside the outline and removes the others. Saved as the next revision of the .kicad_pcb (a stale base_rev comes back as { saved: false, conflict }).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit (folder) name, e.g. my-board |
| `dry_run` | boolean |  |
| `origin` | object |  |
| `outline` | object |  |
| `remove_orphans` | boolean |  |
| `remove_duplicates` | boolean | Remove the extra copies of parts the board carries twice (duplicate_refs), keeping the copy inside the board outline; a part with no single copy inside is left and listed |
| `force` | boolean | Save even if DRC after the sync is worse than before (check nets.unmatched first) |
| `diagnose_nets` | boolean | Read-only: list the pads whose schematic net and board net differ (beyond the sheet path), without planning a sync |
| `footprints_only` | boolean | Only swap and refresh footprints: no pad nets are set, no parts added or removed (use when the net sync is not safe yet) |
| `refresh_footprints` | boolean | Replace board parts that differ from their project-library footprint by the library version (default: only report them in stale_footprints) |
| `skip_missing` | boolean | Leave out parts whose footprint is in no library (listed under missing_footprints) and place the rest, instead of failing the whole run |
| `base_rev` | integer |  |

## kicad_edit

Edit a .kicad_pcb in the KiCad file store (path e.g. my-board/my-board.kicad_pcb) with KiCad's own pcbnew on the VM, from a data-only list of ops (no code). Ops run in order; the first failure stops the run and nothing is saved. Result: one entry per op, the new revision (saved as source mcp; base_rev defaults to the revision just loaded, a stale base_rev comes back as { saved: false, conflict } and nothing is written) and, if run_drc is an op, a DRC summary of the final board. dry_run applies the ops and returns the op results without saving. Lengths mm, angles degrees, KiCad coordinates (y down); layers F.Cu, B.Cu, In1.Cu.... Ops: add_footprint {ref,lib,name,value?,x,y,angle?,nets?:{pad:net},mod?} (lib:name is found in the project's _libs/<lib>.pretty first, made with kicad_footprint_create; otherwise in the VM's stock libraries; mod = inline .kicad_mod text wins over both), read_footprint {lib,name,text?} (read-only, never saves: a STOCK library footprint as data: pad_list with type, at, size and drill, min_drill_mm; text: true adds its .kicad_mod text, the base for a corrected project-library copy stored with kicad_put; a project-library footprint is read with kicad_read instead), update_footprint {lib,name,refs?,mod?} (Update Footprints from Library: replaces the board footprints with the project library version _libs/<lib>.pretty/<name>.kicad_mod, e.g. after editing it with kicad_put or the designer; keeps position, angle, side, value, locked and pad nets; refs omitted = every part with id lib:name; stops if a netted pad is missing in the new footprint), set_pad_nets {ref,nets:{pad:net\|""}}, place_footprints {parts:[{ref,x,y,angle?,side?:"F"\|"B"}]} (up to 1000 parts in one op: use it for the FIRST CUT of a whole board; side B flips the part to the bottom, which mirrors its pads left to right, so a part placed by the top-side pad map lands with its pads swapped: dry_run first; a two-pad part is put back by turning it 180 degrees, others need their pad positions re-checked; then fine-tune with move_footprint, add_track, add_via, add_zone), move_footprint {ref}, set_outline {x,y,width,height,corner_radius?} or {polygon:[[x,y],...],corner_radius?} (replaces Edge.Cuts; corner_radius rounds every corner with an arc: set the outline with its radius before any copper), set_copper_layers {count} (even 2..32: enables the inner layers In1.Cu..; refused while copper is on layers that would go; stackup thicknesses are not edited: set_stackup writes them), scale_board {factor,about?:[x,y],outline?,scale_tracks?} (factor 1.1 = 10% bigger about the outline centre: moves part origins, outline, drawings and text; pads and sizes stay; scale_tracks also moves tracks, vias and zone outlines, otherwise follow with clear_tracks and kicad_autoroute), clear_tracks {layers?,nets?,include_vias?} (removes all tracks and vias matching the filters; none = all), set_text_layer {field:Reference\|Value,to:silk\|fab,max_height?,refs?} (e.g. small reference designators to fab to clear silkscreen height DRC), move_footprint {ref,x,y,angle?}, flip_footprint {ref}, set_field {ref,name,value}, set_net_class {name,track_width?,clearance?,via_diameter?,via_drill?,nets?:[pattern]} (edits the sibling .kicad_pro, saved as its own revision), add_track {net,layer,width,points}, remove_track {net\|id,layer?,include_vias?}, set_track_width {net,width,layer?}, set_via_size {diameter,drill,below_drill?,nets?,ids?} (resizes vias where they are, net and position kept: those with a drill under below_drill, on the nets (globs) or by id from pcb_query; the way to bring small vias up to the house drill rule, with dry_run and max_new_errors:0 to see which ones then clash), set_pad_drill {drill,below_drill?,refs?,pads?} (plated through-hole pads of the board's footprints with a drill under below_drill (default 0.25) get drill `drill` (0.25 up to under 6 mm), the copper grown to keep the ring, at least 0.1 mm; NPTH and SMD pads untouched; the fix for stock footprints whose holes are under the house drill rule, e.g. the 0.2 mm thermal vias of an ESP32-WROOM pad or a QFN's ThermalVias, where set_via_size does nothing because they are pads; afterwards DRC reports lib_footprint_mismatch for those parts, expected since the board copy now differs from the library), set_stackup {preset,finish?} (writes the physical stackup into the board's setup from a JLCPCB 1.6 mm preset: jlc_2layer_1.6mm, jlc_4layer_1.6mm (JLC04161H-7628), jlc_6layer_1.6mm, jlc_8layer_1.6mm; finish ENIG (default), HASL, HASL lead-free or OSP; the preset's copper layer count must be the board's (set_copper_layers first); figures approximate, check against the fab's current stackup; then get_board_stackup and the impedance checks use it), add_via {net,x,y,diameter,drill,protection?} (protection tent\|plug\|fill\|open: how the fab finishes it; fill = filled and capped, for via-in-pad), via_array {ref,pad,pitch,diameter,drill,margin?,rows?,columns?,max?,protection?} (a centred grid of thermal vias inside one pad, on the pad's net: the exposed pad of a regulator or FET), stitch_vias {net,where:zones\|edge\|polygon,pitch,diameter,drill,polygon?,inset?,clearance?,hole_gap?,min_layers?,stagger?,max?,protection?} (ties a net's pours together: a grid over its zones, a via fence along the board edge, or a grid inside a polygon; a via is placed only where it sits in the net's filled copper on min_layers layers (default 2), clears other nets and holes and no-via keepouts; the reply counts what was skipped and why; follow with refill_zones), add_zone {net,layer,polygon,clearance?,min_width?,thermal?,thermal_gap?,thermal_spoke?,priority? (0..1000: the higher fills first where zones overlap)}, remove_zone {name?,net?,layer?,rule_area?}, add_keepout {polygon,layers,no_copper?,no_vias?,no_tracks?}, set_silk_text_size {min_height,layers?}, refill_zones {}, run_drc {types?,severities? (or severity: error, or a list of them),copper_only?,max_items?}, route_pads {from:"U1.3"\|{ref,pad}\|[x,y],to,net?,layer?,to_layer?,width?,via?:[x,y],waypoints?:[[x,y]...],style?:"45"\|"90"\|"straight",bend?:"auto"\|"start"\|"end",via_diameter?,via_drill?} (manual routing without coordinates: the pad centres are looked up, the path gets 45 degree bends (bend auto picks the side with fewer clearance problems), width and via size come from the net class, and a via is placed near the far pad when the pads are on different layers; it becomes add_track/add_via ops, listed in the reply as expanded). At most 500 ops. Manual routing loop: kicad_ratsnest (what is open), route_pads in batches, precheck, then run_drc once per batch. precheck (default report, for calls with add_track, add_via or route_pads): the new copper is checked in the web service, in milliseconds, against other nets' pads, tracks and vias (net class clearance) and the board edge; reply precheck {conflicts with gap_mm and need_mm, loose_ends: track ends on no copper of their net} and open_connections_estimate {before, after}. precheck only: expand and check, nothing sent to KiCad, nothing saved (free; use it to try paths); refuse: send nothing when there is a conflict; off: skip. Guards: max_new_errors N refuses (saves nothing) an edit that adds more than N DRC errors; on ONE set_track_width op add fit: true and it tries the width, then 85/70/55/40 % of it, and uses the widest that adds no more than max_new_errors (default 0) DRC errors (the reply guard.fit lists what was tried).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string | A .kicad_pcb path from kicad_list, e.g. 01-atmega328p-arduino/01-atmega328p-arduino.circuit.kicad_pcb |
| `circuit` | string | In place of path: the circuit folder, its board is edited |
| `ops` * | array of object |  |
| `base_rev` | integer |  |
| `dry_run` | boolean |  |
| `max_new_errors` | integer | Guard: DRC errors of the edited board minus those of the board now must be at most this, else nothing is saved (saved: false, refused: true, guard). 0 = the edit may not make DRC worse. Costs one extra DRC run. |
| `precheck` | one of `report` \\| `refuse` \\| `only` \\| `off` | Clearance check of new tracks and vias in the web service before KiCad runs (default report). only = check and expand route_pads without sending or saving. |
| `note` | string |  |

## kicad_route_plan

Find a route before you draw it, in the web service (no KiCad run, nothing saved). mode path (default): the shortest track for net from a pad ("U1.3" or {ref, pad}) or point [x, y] to another, on layer (or the first of layers that works; default the layers both ends share), around other nets' pads, tracks and vias at net class clearance and the board edge: corner points, length, net_length_mm {existing, new, total}, a ready add_track op and its precheck. follow: a net whose tracks the path should stay near (the other half of a differential pair). When there is no way, walled_in says which end is shut in and walled_in_by lists the pads, tracks and vias around it (what to move or reroute). mode via_spots: where a via of net fits near at (a point or pad), every layer checked, nearest first, each with pour_layers (where it lands in the net's own filled pour); with escape_from (a pad) also the short track from that pad to each spot (breakouts, shortest first, each with ready ops), or what walls the pad in. mode pair: p and n ({net?, from, to} each, e.g. the vias of a differential pair) on one layer, both orders tried (the second follows the first): both paths, net lengths and skew_mm (n minus p, track length like KiCad), ready ops; when each routes alone but not together, crosses: true (the vias sit on the other sides at one end: move one end's vias). mode ripup: for escape_from (a walled-in pad), what to remove until a breakout appears (greedy; each removal is one net's copper near the pad or one via; up to max_remove; never pads or keep_nets; radius default 2): removed, remove_ops, breakouts and reroute_nets (the nets to route again). It runs many via searches: seconds, not milliseconds. after_ops: kicad_edit ops (add_track, add_via, remove_track, clear_tracks) taken as already done, so you can plan a reroute or a sequence of routes before saving any (route the net with the fewest options first). Search box: box [x0, y0, x1, y1] or margin mm around the ends (default 10); grid mm (default 0.05, coarser on a big box). Approximate like precheck (pads by their box, other nets' zones ignored as they step back on refill): send the ops with kicad_edit and check with run_drc.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` | string | A .kicad_pcb path from kicad_list |
| `circuit` | string | In place of path: the circuit folder |
| `rev` | integer |  |
| `mode` | one of `path` \\| `via_spots` \\| `pair` \\| `ripup` |  |
| `p` | object | pair: {net?, from, to} of the P net |
| `n` | object | pair: {net?, from, to} of the N net |
| `max_remove` | integer | ripup: removals at most (a net near the pad, or one via), default 4, max 8 |
| `keep_nets` | array of string | ripup: nets (globs) never removed |
| `net` | string |  |
| `from` | any | "REF.PAD", {ref, pad} or [x, y] |
| `to` | any | "REF.PAD", {ref, pad} or [x, y] |
| `layer` | string |  |
| `layers` | array of string |  |
| `width` | number |  |
| `follow` | string | Net whose tracks the path should keep near |
| `box` | array of number |  |
| `margin` | number |  |
| `grid` | number |  |
| `at` | any | via_spots: a point [x, y] or pad |
| `escape_from` | any | via_spots: a pad to break out from |
| `radius` | number | via_spots: mm, default 1.5, max 5 |
| `step` | number |  |
| `via_diameter` | number |  |
| `via_drill` | number |  |
| `limit` | integer |  |
| `after_ops` | array of object |  |

## kicad_ratsnest

Open connections of a KiCad board, as text, in milliseconds (no machine call): for each net still split, the fewest links that would join it (shortest first), each from a pad, via or track end to another with board coordinates (mm, KiCad frame, the ones kicad_edit takes), the layers both ends share (needs_via when none) and the distance, plus the net's rules (class, track width, clearance, via size). The input for manual routing: route each link with kicad_edit route_pads {from: "U1.3", to: "R2.1"}. Filters: nets (globs), refs (the nets on those parts), bbox (links with an end inside), limit (links listed, default 100). Estimated from the board text (zones by their stored fill islands, by their outline when unfilled): kicad_drc stays the check of record, but KiCad stops listing unconnected items at about 500, so on a mostly unrouted board this count is the complete one.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` | string | A .kicad_pcb path from kicad_list |
| `circuit` | string | In place of path: the circuit folder, its board is read |
| `rev` | integer |  |
| `nets` | array of string |  |
| `refs` | array of string |  |
| `bbox` | array of number | [x0, y0, x1, y1] mm, KiCad frame |
| `limit` | integer | Links listed, default 100, max 1000 |

## kicad_tools

List the KiCad tools that kicad_review (read-only checks and exports) and kicad_build (edits, saved as new revisions) accept, with a one-line description and mode each. Names are the standard kicad-mcp-pro tool names. Works on every connection, also those bound to a project or circuit.

No arguments.

## kicad_review

Run a read-only KiCad tool (kicad-mcp-pro, KiCad 10 on the VM) on a KiCad project in the store: DRC/ERC, quality gate, DFM, board and schematic summaries, BOM, and exports (Gerber, drill, pick-and-place, STEP, GLB, IPC-2581; the outputs zip is stored as a project asset when you can edit). Design files are never changed. path is a .kicad_pcb, .kicad_sch or .kicad_pro from kicad_list; its folder is the KiCad project. tool must be one of kicad_tools.kicad_review; arguments are the tool's own parameters (object, up to 64 KB). path example: 01-atmega328p-arduino/01-atmega328p-arduino.circuit.kicad_pcb. The reply text is narrowed on the Worker (run_drc and run_erc return about 55 KB raw): by default the summary lines plus the first 30 findings, at most about 20,000 characters, with truncated: true and a hint when anything was left out. summary_only gives the counts and summary lines, limit and offset page the findings, max_chars (1,000 to 60,000) raises the cap.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string | e.g. 01-atmega328p-arduino/01-atmega328p-arduino.circuit.kicad_pcb |
| `tool` * | one of `run_drc` \\| `run_erc` \\| `validate_design` \\| `project_quality_gate` \\| `validate_footprints_vs_schematic` \\| `dfm_run_manufacturer_check` \\| `pcb_get_board_summary` \\| `pcb_get_stackup` \\| `pcb_get_design_rules` \\| `sch_get_symbols` \\| `sch_get_connectivity_graph` \\| `sch_get_bounding_boxes` \\| `lib_get_bom_with_pricing` \\| `get_unconnected_nets` \\| `get_courtyard_violations` \\| `export_gerber` \\| `export_drill` \\| `export_pick_and_place` \\| `export_bom` \\| `export_step` \\| `export_glb` \\| `export_ipc2581` |  |
| `arguments` | object |  |
| `summary_only` | boolean | Counts and summary lines only, no individual findings |
| `limit` | integer | Findings to return (default 30) |
| `offset` | integer | Findings to skip |
| `max_chars` | integer | Cap on the text returned (default 20000) |

## kicad_build

Run a KiCad editing tool (kicad-mcp-pro: routing, stackup, outline, schematic edits, footprint assignment, exclusions) on a KiCad project in the store. Files the tool changes are saved as new revisions (source mcp; base_rev defaults to the revision just loaded, a stale one returns { saved: false, conflict }). dry_run runs the tool and saves nothing. tool must be one of kicad_tools.kicad_build.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string |  |
| `tool` * | one of `sch_add_symbol` \\| `sch_add_wire` \\| `sch_add_label` \\| `sch_add_power_symbol` \\| `sch_move_symbol` \\| `sch_delete_symbol` \\| `sch_update_properties` \\| `sch_annotate` \\| `sch_build_circuit` \\| `lib_assign_footprint` \\| `drc_add_exclusion` |  |
| `arguments` | object |  |
| `base_rev` | integer |  |
| `dry_run` | boolean |  |

## kicad_revisions

Revision history of one KiCad-native file, newest first: rev, sha256, size, author, source (designer, mcp, import), note, time.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` * | string |  |
| `limit` | integer |  |

## kicad_fab

Plot fabrication files with kicad-cli (KiCad 10 on the VM): Gerbers with job file, Excellon drill (PTH and NPTH) with maps, pick-and-place CSV (both sides, DNP excluded), an IPC-D-356 netlist and, for the KiCad store, a JLCPCB placement file (CPL). Source: a circuit in the KiCad file store (<circuit>/<circuit>.kicad_pcb, what kicad_edit and the designer save) is plotted from that board and the zip is stored as a project asset (the reply has the asset and a download link); a TSX circuit with a stored export is plotted from that export (the legacy kicad_zip) and stored as the export fab_zip. source auto uses the TSX export when there is one, else the store; kicad / tsx force one. Returns the file list, size, sha256 and a download link. Check the files in a Gerber viewer before ordering; this never places an order.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name without .circuit.tsx (the folder name in the KiCad store) |
| `source` | one of `auto` \\| `kicad` \\| `tsx` | kicad = the board in the KiCad store, tsx = the stored TSX export. Default auto. |

## lookup_parts

Look up supplier part numbers for one circuit: matches its parts against our JLCPCB catalogue copy and puts supplier numbers and MPN/availability warnings onto the stored circuit JSON. With a stored export it skips the routed compile (a few seconds, copper unchanged); a save still being exported is re-queued so that export carries the numbers too. Runs on the VM; follow progress (done/total) with list_exports. Exports never do this on their own. A circuit that has only KiCad files (no .circuit.tsx): reads its parts from the schematic netlist, keeps LCSC numbers the symbols or board footprints carry, searches the catalogue for the rest (chip resistors and capacitors by value and size, other parts by exact MPN), saves the matches as the project's LCSC choice and lists looser candidates; answers at once. dry_run: true saves nothing.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name without .circuit.tsx |
| `dry_run` | boolean | KiCad circuits only: report what would be saved |

## prepare_analysis

Derive <circuit>.analysis.json for a circuit in the KiCad store from its schematic netlist, so analyze_circuit is not Incomplete: rails (voltage from a fixed-output part name such as AP2112K-3.3, then the net name, each reported with its source), sources, and, for chips with no part spec, an entry in the config's spec_estimates marked UNVERIFIED ESTIMATE (never a datasheet value; replace with set_part_spec from a datasheet page). Existing values in the config are kept, so it is safe to run again. dry_run true returns the report and the result without saving (viewers may do that); otherwise the config is saved as a new revision (editor role). Returns the report (what came from where, unresolved items), coverage before and after, and a brief analysis. Estimates only.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name without .circuit.tsx |
| `dry_run` | boolean | Preview only, save nothing |

## analyze_circuit

Static power and thermal estimate for a circuit: rail loads, regulator and resistor dissipation, estimated junction temperatures with ok/warn/fail, or incomplete when regulators were not analysed or more than a quarter of the chips have no part spec (see coverage: what was left out and why; fill the analysis config and part specs, then run again). Needs the circuit's exported JSON (or, without one, its KiCad schematic: source) and <circuit>.analysis.json (rails, sources, loads) in the project. Estimates only, no SPICE.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name without .circuit.tsx, e.g. 06-lm317-bench-supply |
| `source` | one of `kicad` \\| `tsx` | Where the circuit comes from: tsx = the TSX export (circuit-json), kicad = the circuit's KiCad schematic and board in the store (netlist by KiCad; no traces or courtyards). Default: tsx while an export exists, else kicad. |

## run_simulation

Run an ngspice SPICE simulation of a circuit. analysis: op (operating point: node voltages), tran (transient, stop = end time e.g. 10m), dc (sweep the first source from 0 to stop volts), ac (frequency sweep up to stop Hz, first source gets 1 V AC). Needs the circuit's exported JSON, or its KiCad schematic when there is none (source); sources and options come from <circuit>.sim.json or <circuit>.analysis.json. Passives, fuses/PTCs (series resistance), diodes (Schottky, bridge, TVS/ESD guessed from the part name), LEDs (a part spec of type led gives a power LED its real Vf), NPN transistors, N/P MOSFETs (known part numbers or a spec of type mosfet with polarity, vth, rds) and regulators are modelled; other ICs are only constant supply loads. Rails declared in analysis.json get a 5 % band check; a rail made inside an IC is driven by a stand-in when the IC's part spec (or sim.json internal_rails {ref: {pin: volts}}) has internal_rails, and nets listed in sim.json not_checked {net: why} are reported as not checked instead of failing. Returns node voltages or downsampled waveforms plus what was left out.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `analysis` | one of `op` \\| `tran` \\| `dc` \\| `ac` |  |
| `stop` | string | End time, volts or Hz, e.g. 10m, 12, 100k |
| `source` | one of `kicad` \\| `tsx` | Where the circuit comes from: tsx = the TSX export (circuit-json), kicad = the circuit's KiCad schematic and board in the store (netlist by KiCad; no traces or courtyards). Default: tsx while an export exists, else kicad. |

## get_sim_result

The last saved SPICE result of a circuit (written by every run_simulation, op/tran/dc/ac separately): when it ran, verdict (pass, fail, none = no rail checks), node voltages, rail checks, which pins fail, warnings. Read-only; run run_simulation to refresh it. Use it to report or compare without simulating again.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `analysis` | one of `op` \\| `tran` \\| `dc` \\| `ac` | Default op |

## run_montecarlo

Tolerance analysis of a circuit on top of its run_sweep assertions: Monte Carlo (seeded random draws of resistor, capacitor, inductor and, if asked, DC source values within their tolerances; one operating-point run per sample) or worst_case (each toleranced part high and low on its own, summed linearly and as root-sum-square). Evaluates every `assert` of <circuit>.sim.json (and extra `probes` such as v(V3V3)) on each sample and returns per expression the mean, sigma, min/max, percentiles, a 10-bin histogram, the yield (share of samples inside min/max), Cpk and the parts whose tolerance drives the result most. Settings come from the optional sim.json block montecarlo { samples, seed, dist: gauss\|uniform, mode, tolerances: { R: 0.01, C: 0.1, L: 0.2, sources: 0, R12: 0.05 }, probes, exclude } and are overridden by the arguments. A tolerance is the +/- bound (3 sigma for gauss). Long runs resume: while the answer says done: false, call again with the returned state. Not varied: regulator references, part specs, temperature, ageing. Model estimates, not a statistical guarantee about real parts.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `mode` | one of `monte_carlo` \\| `worst_case` |  |
| `samples` | integer | Monte Carlo samples, 2 to 500 (default 100) |
| `seed` | integer | Same seed, same samples (default 1) |
| `dist` | one of `gauss` \\| `uniform` |  |
| `tolerances` | object | Fractions or percent strings by class (R, C, L, sources) or by reference (R12), for example { "R": "1%", "C": 0.2, "sources": 0.02 } |
| `probes` | array of string | Extra expressions to track, v(NET), v(a,b), i(NET) |
| `exclude` | array of string | Netlist name prefixes to keep at nominal, for example R_FB |
| `state` | object | The state returned by the previous call of the same run (seed and mode must match); omit to start |
| `source` | one of `kicad` \\| `tsx` |  |

## validate_spice_model

Check SPICE model text in the standard form (.subckt NAME ports ... .ends, .model, .param, X lines to other subcircuits in the same text) before using it: returns the subcircuits with their ports, params and element counts, errors with line numbers and warnings. Refused (not just warned): .include, .lib, .control, shell/file words, nested .subckt, unknown X targets, recursion. Writes nothing.

| Argument | Type | What |
|---|---|---|
| `text` * | string | The model text (a vendor .subckt, a .model line, or a few of them) |

## set_spice_model

Store a SPICE .subckt model in <circuit>.sim.json (key subckts.<library>) and optionally assign it to a part: models.<ref> = { subckt, pins, params }. `pins` lists the part's pin names (or numbers) in the subcircuit's port order, one per port, null for a port left open; params override the subcircuit's .param defaults. The text is validated first (see validate_spice_model); nothing is saved when it has errors. The simulator then netlists the part as an X instance instead of its normal model. Needs the VM sim service built after 2026-11-08 (X lines).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `library` * | string | Name for the stored text, e.g. lm358 |
| `text` | string |  |
| `ref` | string | Part reference to assign the model to, e.g. U3 (optional) |
| `subckt` | string | Which subcircuit of the text to use (default: the first) |
| `pins` | array of string,null |  |
| `params` | object |  |
| `remove` | boolean | Delete the library (and unassign parts that used it) instead of storing |

## run_sweep

Verification sweep for a circuit (model estimates, operating point per case). Reads <circuit>.sim.json blocks: sweeps (named cases laying new source voltages, model settings or params over the base run; peak: true makes every chip draw its part spec's i_peak_ma, and load_ma: {"U1": 345} sets the supply current of single chips in mA for that case, for a transmit burst or a heater: the way to check a rail, a fuse or a regulator at peak load), assert (probe expressions such as v(NET), i(SOURCE_NET), i(R11), abs/min/max and + - * /, with min, max and at: all, sweeps, faults or case names) and faults (open or short a part, or short a net to ground, applied to the generated netlist only). Runs the nominal case, every sweep and every fault one VM call at a time; at most 4 cases per call, so repeat with cases = the returned remaining list. Returns per case probe values and pass/fail with margin, per assertion worst case, and which faults violate which assertions. Without an assert block it only reports the cases it could run.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `cases` | array of string | Case names to run (nominal, sweep and fault names). Default: all, in order. |
| `source` | one of `kicad` \\| `tsx` | Where the circuit comes from: tsx = the TSX export (circuit-json), kicad = the circuit's KiCad schematic and board in the store (netlist by KiCad; no traces or courtyards). Default: tsx while an export exists, else kicad. |

## run_em

Antenna EM solve with openEMS (FDTD) on the VM, from <circuit>.em.json (draft one with prepare_em): f0_ghz and fc_ghz (sweep f0 +- fc), substrate {er, tand, h, x, y}, copper ({rect: [x0,y0,x1,y1]}, {poly: [[x,y],...]} in mm, or {net} = that net's top-layer pads, tracks, arcs and pours; with ref: "ANT_TX1" only that footprint's pads, so the antenna is picked by name instead of a coordinate box), one driven lumped port {x, y, r} or {at: min_y\|max_y\|min_x\|max_x, net, ref}, optional ports [{name, net, ref, at}] (up to 7 listening antennas: the reply gives the coupling from the driven port into each, e.g. transmit-to-receive leakage), conductor {sigma, thickness_um} for copper loss, mesh {res_lambda, air_lambda}, air, boundary, max_timesteps, farfield and expect {band_ghz, s11_max_db, gain_min_dbi, eff_min, isolation_min_db}. A net is read from the circuit's KiCad board in the store (the board that gets made); from: "export" reads the old tscircuit export; sources in the reply says which file and revision. Returns S11 (minimum, the continuous -10 dB band around resonance, input impedance), gain, directivity, efficiency, -3 dB beamwidths, and pass/fail against expect (incomplete = a check had no data, e.g. the wanted band is outside the sweep). The result is kept: the same em.json on the same copper is answered from the kept result (cached: true) unless force is set. Waits up to wait_s (default 50); an array takes minutes, so expect a job id and read it with get_em. The mesh is fine at the copper and coarser in the air (the VM allows 8 million cells). Checklist gate 9 follows the verdict only when all copper was read from the KiCad board (real_copper: true). Planar antennas only, top layer over a ground plane. Estimates of an idealised geometry: no connector, housing, solder mask or surface finish.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Name of the em.json without the suffix, e.g. radar-core-tx |
| `wait_s` | number | Seconds to wait for the result before returning the job id (default 50, max 85) |
| `force` | boolean | Solve again even when a result of this exact spec is kept |

## get_em

Read an antenna EM solve. With job: the status of a run_em job (queued, running, done, failed) and, when done, the summary (jobs stay on the VM for two hours; a finished one is kept in the project when read). With circuit and no job: the last kept solve of that em.json, with stale: true when the em.json or the antenna copper changed since; history: true lists the kept solves (one per distinct spec) to compare designs. detail "full" adds the S11, impedance and pattern curves.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `job` | string |  |
| `circuit` | string | Name of the em.json without the suffix (when no job is given) |
| `history` | boolean |  |
| `detail` | one of `summary` \\| `full` |  |

## prepare_em

Draft a <name>.em.json for an antenna on a KiCad board: reads the net's top-layer copper from the board in the store (shape count, extent, what cannot be modelled) and the dielectric under the top layer from the board's stackup (thickness, Dk, loss tangent), and fills in mesh, air and expect defaults for the frequency. Returns the draft and a review list of what a person must confirm (feed end, substrate figures when the board has no stackup block, the wanted band). write: true saves it (editor role); then run_em with that name. Nothing is solved here.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | The board's circuit name |
| `net` * | string | Antenna net, e.g. RF_TX1 |
| `f0_ghz` * | number | Centre frequency in GHz |
| `band_ghz` | array of number | [lo, hi] band the antenna must cover (default f0 +- 1 %) |
| `name` | string | File stem (default <circuit>-<net in lower case>) |
| `ref` | string | The antenna's footprint reference (e.g. ANT_TX1): only its pads are taken, which leaves out the IC pin and the feed line. The reply's copper.parts_on_net lists the footprints on the net with their boxes. |
| `within` | array of number | [x0, y0, x1, y1] box (board centre origin, y up, mm) that holds the antenna copper; ref is the easier way |
| `port_at` | one of `min_y` \\| `max_y` \\| `min_x` \\| `max_x` | Side of the copper where the feed enters (default min_y) |
| `write` | boolean |  |

## check_zones

Report on every copper pour of a KiCad circuit's board, from KiCad's own fill (the zones are refilled first; nothing is saved): fill area and percent, pieces, pieces that touch no pad, via or track of the net (floating copper), narrow necks (two wider parts of a pour joined only through a strip narrower than neck_mm, default 0.5, with the place and the areas it joins), pads the pour reaches through one spoke only or not at all, and stretches of fast nets that run over a gap in the plane on the neighbouring layer (longer than split_mm, default 1). Fast nets are picked by name (clocks, USB, Ethernet, MIPI, QSPI, RF, both halves of a differential pair) unless fast_nets lists names or patterns. verdict ok (no high or medium finding) closes the checklist step pours; review reopens it. Takes 10 to 40 s. Neck widths and spoke counts are good to about one grid cell; kicad_drc stays the final word on clearances. image adds a picture: every pour in the colour of its net, floating pieces red, plane gaps under fast nets magenta, with numbered marks (F floating piece, N neck, P pad, G gap) that the result lists with their coordinates.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `neck_mm` | number |  |
| `split_mm` | number |  |
| `fast_nets` | array of string | Net names or patterns (* and ?) to check for plane gaps, in place of the name-based pick |
| `image` | object or boolean | Also return a picture of the result (true for the default). view: all (every layer as tiles, default), stack (the layers as an exploded 3D stack), one copper layer such as F.Cu (largest, with mm axes), or layers (one bare picture per layer). box [x0, y0, x1, y1] mm zooms in; px 300..2000; scale [low, high] fixes the colour scale so two runs compare; grid false hides the mm grid lines. |

## check_voltage_drop

DC voltage drop of one net of a KiCad circuit's board, through the copper as KiCad filled it: tracks, pours, pads and via barrels become a resistor network, the current enters at sources (the regulator output or connector pin: [{ref, pad?}]) and leaves at loads ([{ref, pad?, current_a}]). Returns the drop at every load (mV, and percent of rail_v), the loss, tracks and vias above their IPC-2221 current for a rise_c (default 10 K) temperature rise, the busiest tracks and vias, and the places in the pours with the highest current density. verdict: fail when a load has no copper path to a source or the worst drop is over max_drop_mv (or 3 % of rail_v), review when a track or via is over its current, pass, or info when no limit was given. Only this net's copper counts: a series part (fuse, ferrite, sense resistor) splits the path into two nets, run each. An estimate on a grid (cell_mm, chosen from the board size), copper at copper_temp_c (default 40), via plating plating_um (default 20). Takes 10 to 60 s. image adds a picture of the net's copper coloured by the drop from the source (or by current density with show current): thin copper and necks show as hot colours, copper with no path to a source is pink, sources and loads are marked.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `net` * | string |  |
| `sources` * | array of object |  |
| `loads` * | array of object |  |
| `rail_v` | number |  |
| `max_drop_mv` | number |  |
| `rise_c` | number |  |
| `copper_temp_c` | number |  |
| `plating_um` | number |  |
| `cell_mm` | number |  |
| `image` | object or boolean | Also return a picture of the result (true for the default). view: all (every layer as tiles, default), stack (the layers as an exploded 3D stack), one copper layer such as F.Cu (largest, with mm axes), or layers (one bare picture per layer). box [x0, y0, x1, y1] mm zooms in; px 300..2000; scale [low, high] fixes the colour scale so two runs compare; grid false hides the mm grid lines. show: drop (default, mV from the source) or current (A/mm2 in pours and tracks). |

## simulate_board

The board as it runs, in three views from the static power estimate (analyze_circuit's inputs): power = where the power goes (each supply, each regulator's in, out, loss and efficiency, each rail, and the parts drawing from it), typical and full load together; copper = the DC voltage drop of every rail that carries current, solved through the copper KiCad filled with the estimate's currents (sources: the regulator output, the inductor after a switcher, the inlet connector; loads: the parts on the rail), with the worst drop per rail and a picture of one rail (net, or the one losing the largest share); heat = the board's temperature with each part's estimated power (run_board_thermal), next to what the part's package alone would reach. load: typical (default) or full (every part at its peak). Rails the estimate cannot place are listed under skipped with the reason. Estimates: part specs are approximate and the copper is a grid model. copper and heat take 10 to 60 s.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `view` | one of `power` \\| `copper` \\| `heat` |  |
| `load` | one of `typical` \\| `full` |  |
| `net` | string | copper: the rail to draw (default: the one losing the largest share of its voltage) |
| `show` | one of `drop` \\| `current` | copper picture: drop (default) or current density |
| `layer` | string | picture: all, stack, layers or one copper layer such as F.Cu (heat default F.Cu, copper default all) |
| `px` | integer |  |
| `image` | boolean | false leaves the picture out |
| `source` | one of `kicad` \\| `tsx` |  |

## run_board_thermal

Board-level thermal estimate of a KiCad circuit that sees copper and vias (run_thermal does not: it uses each part's thermal resistance alone). Each part's power enters the board through its pads; heat spreads in the copper of every layer as KiCad filled it and in the FR4, crosses the board through FR4 and via barrels, and leaves from both faces at h_w_m2k (default 10, still air; 25 to 50 with a fan). parts: [{ref, power_w, theta_jb?, tj_max?}]; left out, the parts and powers of run_thermal are used. Per part: board temperature under it, the other side, the drop through the board, the number of vias under it, and what the vias are worth (the same solve without any via: vias_lower_it_by_c), plus junction temperature and margin when theta_jb (junction to board, from the datasheet) is given. Use it to decide and to check heatsink vias (kicad_edit via_array) and copper area. A steady-state estimate on a grid, no enclosure or heatsink: compare layouts with it, measure before trusting a margin of a few kelvin. Takes 10 to 60 s. image adds a heat map of the board per layer (view stack shows all layers as a 3D stack) with the copper pattern visible, the powered parts framed and labelled and the hottest point marked.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `parts` | array of object |  |
| `ambient_c` | number |  |
| `h_w_m2k` | number |  |
| `plating_um` | number |  |
| `compare_without_vias` | boolean |  |
| `cell_mm` | number |  |
| `image` | object or boolean | Also return a picture of the result (true for the default). view: all (every layer as tiles, default), stack (the layers as an exploded 3D stack), one copper layer such as F.Cu (largest, with mm axes), or layers (one bare picture per layer). box [x0, y0, x1, y1] mm zooms in; px 300..2000; scale [low, high] fixes the colour scale so two runs compare; grid false hides the mm grid lines. |

## kicad_copper_view

Picture of the copper of a KiCad circuit's board for debugging a layout: every layer with the pours as KiCad fills them (refilled first; nothing is saved), tracks, pads, vias and holes. color_by net (default: the nets with the most copper get the first colours, listed in the legend), class (net class) or width (track width as a colour scale); highlight [net names or patterns] shows only those nets in colour and everything else grey, and lists their tracks per layer, vias, pours and pads. view: all (every layer as tiles, default), one layer such as F.Cu (largest, with mm axes), stack (an exploded 3D stack of the layers; the vias of highlighted nets are drawn as lines between them) or layers (one bare picture per layer). box [x0, y0, x1, y1] in mm zooms in; part names are written where they fit (labels false hides them). All layers are drawn as seen from the top in board coordinates (mm, y down), so a place read off the axes can be used in kicad_edit and pcb_query. For the fabrication files themselves use kicad_fab_preview; for the parts in 3D use get_3d_image. A few seconds.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `view` | string | all (default), stack, layers, or a copper layer name |
| `color_by` | one of `net` \\| `class` \\| `width` |  |
| `highlight` | array of string | Up to 16 net names or patterns (* and ?) |
| `box` | array of number |  |
| `px` | integer |  |
| `grid` | boolean |  |
| `labels` | boolean |  |

## kicad_sch_view

Picture of one sheet of a KiCad circuit's schematic as KiCad itself draws it (kicad-cli sch export svg, rasterised on white), to look at a schematic after changing it (kicad_build sch_* tools, kicad_sch_labels, kicad_put). path picks the sheet file (a .kicad_sch of this circuit; default the root sheet), page the page number (a sheet used twice has one page per use). box [x0, y0, x1, y1] in mm zooms in: the sheet's own coordinates (origin at the top-left of the paper, y down), as in the .kicad_sch and in kicad_erc positions. px is the picture width (600..3000, default 1600). Returns the picture with sheet, page, paper, width, height, mm_per_px and every sheet of the hierarchy with its file and page. Nothing is saved. A few seconds.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name without .circuit.tsx |
| `path` | string | A .kicad_sch of the circuit, e.g. <circuit>/power.kicad_sch (default: the root sheet) |
| `page` | string or integer | Page number, as in the sheets list |
| `box` | array of number | [x0, y0, x1, y1] mm on the sheet |
| `px` | integer |  |

## kicad_fab_preview

Picture of the fabrication files themselves: reads the Gerber and drill files of the circuit's latest kicad_fab zip (not the board they came from) and draws them, so the last look before ordering is at what gets sent. view: top or bottom (copper under mask, mask openings, silkscreen, holes, the board cut from the outline; bottom is mirrored, as seen from below), or one layer (F.Cu, In1.Cu, B.Cu, F.Mask, F.Silkscreen, F.Paste, Edge.Cuts ...). box [x0, y0, x1, y1] in mm zooms in. Also returns every file with what it is and how much it holds, the drill table with the smallest drill, and checks: no or open outline, pads plotted into the outline file, copper or holes outside the outline, silkscreen on exposed pads, a missing copper, mask or drill file. Run kicad_fab first. This tool never places orders.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `view` | string | top (default), bottom, or a layer name from the files list |
| `box` | array of number |  |
| `px` | integer |  |

## get_checklist

The design checklist of a circuit: the 12 gates of the design-to-fab skill (requirements, schematic, specs, power and SPICE, service and firmware access, placement, rules and stackup, route, DRC, antenna EM, functional, fab output), each open, done, deferred or stale. Five gates hold steps, each with its own state: 1 schematic (library, schematic), 3 power (circuit, spice), 5 placement (placement, models_3d), 7 route (routing, thermal_vias, pours), 8 DRC (drc, dfm). Such a gate is done only when every step is done or deferred, so a finished route does not close gate 7 while the heatsink vias and the pours are still to do. A gate is set stale automatically when a saved file touches it (a schematic edit reopens 1,2,3,4,5,7,8,10,11; a moved antenna part reopens 9; a config file reopens its own gate), with the reason and revision, so every revision shows exactly what has to be redone and nothing else. Returns next: the first gate that is not done or deferred, with its first open step, and progress (gates and steps closed). Also returns agents: one entry per step (and per gate without steps) in the order they are worked (rules before the circuit, heatsink vias before routing), each with its state, its tier (design, hard, standard, light) and the model an admin set for that tier, and next_agent, the first of them still to do. A client that can start sub-agents gives each item to its own agent on that model, one after the other, and starts the next only when get_checklist shows the item done or deferred.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |

## set_checklist

Mark one gate or one step of a circuit's design checklist (editor role): status done (after its tool result is clean), open, or deferred with a reason (only for what can be added later or does not apply: a missing 3D model, an unavailable part, no part that needs heatsink vias). Give gate (0..11) or step (library, schematic, circuit, spice, placement, models_3d, routing, thermal_vias, pours, drc, dfm; or "7.3"). A gate that has steps cannot be marked done directly: mark its steps. Tool results decide their own step: kicad_erc schematic, check_placement placement, kicad_autoroute routing, check_zones pours, kicad_drc drc; check_requirements closes or reopens gate 10. Never mark anything done without the tool output that supports it; put that result in note.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `gate` | integer |  |
| `step` | string | A step key (pours) or gate.n (7.3), in place of gate |
| `status` * | one of `open` \\| `done` \\| `deferred` |  |
| `note` | string | The evidence (tool result, revision) or the reason for a deferral |

## get_design_spec

The design context of a circuit, kept in the portal database (D1), not in a file: requirements (the items check_requirements tests) and context (free facts: the main board it links to, the camera or part that must fit, firmware tool, owner decisions, the part numbers the requirements depend on). Also returns the gate history (who closed or reopened which gate, when, why).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `history` | integer | Gate history rows to return (default 30) |

## set_design_spec

Save a circuit's requirements and/or context in the portal database (editor role). requirements = the array of items {id, text, check, defer?} described in check_requirements (replaces the stored list); context = an object of facts, merged into the stored one (a key set to null is removed). Every save is logged. Changing requirements marks gate 10 stale.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `requirements` | array of object |  |
| `context` | object |  |
| `note` | string |  |

## agent_settings

Agent settings of one project: the models of the agent and of the four step tiers, the cost limit of one run in cents, scripts (agent_code_calls) and tool subsets (agent_tool_subsets). Without key it lists each one: the admin's value, the project's own value (null = follows the admin) and what applies. With key and value the project's owner (or an admin) sets it for this project only; value null clears it. A project stays within the admin's settings: a model from the admin's list, a cost limit no higher than the admin's, and scripts or tool subsets can only be switched off. Audited.

| Argument | Type | What |
|---|---|---|
| `project` * | string |  |
| `key` | string |  |
| `value` | any |  |

## git_config

The project's Git repository: a Gitea repo on platform.gite2e.com that the project is pushed to, so its history is kept as commits. Without repo_url it returns the current setting (repo_url, branch, last push, whether the shared API token is set). With repo_url (https://platform.gite2e.com/owner/repo, owner role) it sets the repository, and branch (default main) names the branch; an empty repo_url removes the link. The API token is one shared secret an admin sets in Settings (gitea_api_key), never per project, and is only sent to platform.gite2e.com. Create the (empty) repository in Gitea first; the token needs write access to it.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `repo_url` | string | https://platform.gite2e.com/owner/repo, or empty to unlink |
| `branch` | string | Default main |

## git_push

Commit the project to its Git repository (git_config first): the KiCad files, legacy files and assets (up to 64 MB each), as one commit (several for a very large project) holding only what changed since the repository's last state. Files the project removed since its last push are removed in the repo; files only added in Gitea are never touched. message is the commit message (a default summary is used otherwise), with the pusher's email as author. dry_run lists what would change and sends nothing. Large binaries (3D models STEP/WRL, PDFs, images, anything over 5 MB) are uploaded to Git LFS and the commit holds pointer files, with a generated .gitattributes (lfs false keeps them out). A push that cannot finish in about 40 seconds commits what is ready and returns incomplete: call it again, it carries on. Returns the commit sha and link, file counts and any skipped files. Editor role.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `message` | string | Commit message (first line, up to 200 characters) |
| `dry_run` | boolean |  |
| `lfs` | boolean | Store large binaries (3D models, PDFs, images, any file over 5 MB) in Git LFS, default true; false keeps them out of the repository |

## git_log

Recent commits on the project's Git branch (from Gitea): sha, first line of the message, author, date and a link. limit 1 to 100, default 20.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `limit` | number |  |

## get_integrations_status

Check whether your signed-in account has connected GitE2E and Designs (OpenSCAD Cloud) OAuth integrations (remote username, scopes, token expiry, shared fallback availability; never exposes tokens).

No arguments.

## list_project_repos

List all GitE2E repositories linked to a project (board push target, firmware, host software, tests, docs/datasheet sources) with each repo's latest linked commit and drift status.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` | string | Optional circuit filter |

## link_repo

Link a GitE2E repository on platform.gite2e.com to this project with a role (board, firmware, host, tests, docs, other). One project can link multiple repositories (and multiple subpaths in a monorepo). sync_mode push_board (owner only) also sets it as the board push target.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `repo_url` * | string | https://platform.gite2e.com/owner/repo |
| `role` | one of `board` \\| `firmware` \\| `host` \\| `tests` \\| `docs` \\| `other` |  |
| `branch` | string | Default main |
| `circuit` | string | Optional circuit this repo belongs to |
| `subpath` | string | Optional folder inside a monorepo, e.g. firmware/ or docs/datasheet |
| `sync_mode` | one of `link_only` \\| `push_board` |  |
| `label` | string |  |
| `note` | string |  |

## unlink_repo

Remove a linked repository from a project by repo_id (from list_project_repos). Removing a push_board repo requires the owner role.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `repo_id` * | string |  |

## verify_commit

Verify live against platform.gite2e.com (using the caller's connected GitE2E OAuth account or shared token) that commit_sha exists in a linked repository, which branches/tags hold it, and (for agent-enabled repos) its message, author, changed files, and optional expect_paths match. For E2EE-only repos returns metadata_only when the SHA matches a branch or tag head.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `repo_id` * | string | Linked repo id, URL, or owner/repo |
| `commit_sha` * | string | 7 to 40 hex commit SHA |
| `expect_paths` | array of string | Paths or prefixes expected to be touched by this commit |

## link_commit

Verify a GitE2E commit and record its association with a PCBFlux board change, evaluation, fab release, requirement, datasheet, or pinout. Snapshots the current KiCad file revisions so later schematic/PCB edits flag the link as stale.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `repo_id` * | string | Linked repo id, URL, or owner/repo |
| `commit_sha` * | string |  |
| `summary` * | string | What changed and how it matches the board (up to 300 chars) |
| `circuit` | string |  |
| `ref_name` | string | Branch or tag name |
| `target_kind` | one of `change` \\| `evaluation` \\| `fab_release` \\| `requirement` \\| `datasheet` \\| `pinout` |  |
| `target_ref` | string | Optional evaluation id, requirement id, or asset id |
| `changed_items` | array of string | Pins, nets, files, or items affected |
| `expect_paths` | array of string | Paths expected to be modified in this commit |
| `verify` | boolean | Default true: verify against GitE2E before saving |

## list_commit_links

List recorded commit links for a project with verification status and live KiCad file drift (stale: true when schematic or board changed since). Pass verify_fresh: true to re-verify the latest commits against GitE2E.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` | string |  |
| `repo_id` | string |  |
| `verify_fresh` | boolean |  |
| `limit` | integer |  |

## list_project_designs

List CAD designs on designs.cogniviz.ai linked to this project (enclosure, bracket, fixture, assembly, keepout), with pinned vs latest version and drift status.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` | string |  |

## link_design

Link a CAD design on designs.cogniviz.ai to this project (by UUID or https://designs.cogniviz.ai/p/<uuid>). Optionally stores an AES-GCM sealed signed view-only link (from Designs cloud_create_link) opened via PCBFlux RBAC without exposing the raw token.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `design_id` * | string | Designs UUID or https://designs.cogniviz.ai/p/<uuid> |
| `role` | one of `enclosure` \\| `bracket` \\| `fixture` \\| `assembly` \\| `keepout` \\| `other` |  |
| `circuit` | string |  |
| `pinned_version` | integer |  |
| `signed_view_url` | string | Optional view-only link on designs.cogniviz.ai (sealed at rest; empty string clears) |
| `name` | string |  |
| `note` | string |  |
| `verify` | boolean | Default true: verify design metadata via the caller's Designs OAuth token |

## unlink_design

Unlink a CAD design from a project by design_link_id (or design_id).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `design_link_id` * | string |  |

## verify_design_links

Verify linked CAD designs against designs.cogniviz.ai using the caller's Designs OAuth token and detect version or board drift.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` | string |  |
| `design_link_id` | string |  |

## sync_design_asset

Copy an exported asset (STEP, STL, PNG render) from a linked Designs project into PCBFlux permanent project_assets storage.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `design_link_id` * | string | Linked design id or design UUID |
| `asset_name` * | string | Exact asset file name or id in Designs |
| `circuit` | string |  |
| `note` | string |  |

## list_standards

The standards the portal knows (airborne system, assurance, environment, EMC, power, build, quality, parts, reliability, drone/UAS) and the check profiles built from them: vibration, airborne-build, emc, power-input, derating, thermal-altitude, coating-cleanliness, drone-docs. Each standard says which profiles draw on it (none: listed for information only) and the edition confirmed or 'check'. area narrows by area, profile by profile. Choose profiles for a circuit with check_standards (profiles or standards in the call) or save them with set_design_spec context.standards.profiles. Editions are for the owner to confirm against the contract.

| Argument | Type | What |
|---|---|---|
| `area` | string |  |
| `profile` | string |  |

## check_standards

Optional standards check of a KiCad circuit, for the boards that need it. Profiles (list_standards shows what each draws on): vibration (friction-only connectors, heavy parts without staking, BGA/LGA underfill, mounting holes and span, ceramic capacitors near edges, motion sensors, crystals, vibration spec), airborne-build (IPC class, solder alloy, derating policy, part numbers, complex hardware), emc (ESD/surge on connectors, reference planes, switching-regulator filtering, EMC/lightning/ESD levels), power-input (supply spec, surge clamp, fuse or eFuse, hold-up), derating (policy, capacitor voltage ratio, tantalum, reliability prediction), thermal-altitude (temperature range, altitude, cold-limit parts, high voltage at altitude, thermal config), coating-cleanliness (coating, cleanliness test, whiskers, masked areas), drone-docs (DGCA category and status, flight termination, geofence, NPNT, remote ID, battery safety, watchdog). Choose with profiles (ids) and/or standards (ids such as DO-160G, MIL-STD-461, DGCA UAS Rules 2021: they expand to profiles); without either, the circuit's saved context.standards.profiles are used. Declarations the rules read are saved with set_design_spec as context.standards = {profiles, vibration_spec, locking_refs, staked_refs, isolated_refs, mounting_ok, ipc_class, solder_alloy, derating_policy, reliability_prediction, emc_spec, lightning_level, esd_level, power_input_spec, holdup_ms, temp_range_c, altitude_m, conformal_coating, cleanliness_test, uas_category, dgca_status, flight_termination, geofence, npnt, remote_id, datalink_spec, battery_safety, watchdog, notes}. Reads the netlist, board, analysis and thermal config. A pass means no finding from these rules, not certification; rail voltages are guessed from net names when no analysis config exists. list:true returns the catalogue.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `profiles` | array of string |  |
| `standards` | array of string |  |
| `list` | boolean |  |

## get_build

The build phase of a circuit: the steps that make the design (requirements, rules, circuit, parts, schematic, placement, vias, routing, pours) in work order, each open, built or blocked, with its note, and the next step. Built means the files of the step exist; it is not a verdict. The verdict is the evaluation's (run_evaluation, get_evaluation).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |

## set_build_step

Mark one build step of a circuit (editor role): built when its files exist (note: what was made, the revision, what a check still reports), blocked when it cannot be made without the person (note: the question), or open to redo it. It records progress of the build and judges nothing.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `step` * | string | The step's number (1.2, 0) or key (schematic) |
| `status` * | one of `built` \\| `blocked` \\| `open` |  |
| `note` | string |  |

## run_evaluation

Evaluate a circuit (editor role): run every check on the board as it is, one after the other (erc, library, nets, intent, sim, placement, routing, pours, em, drc, dfm, requirements), edit nothing, and record one result per check with one verdict: pass, fail, incomplete (a check has no evidence) or waiting (only a person's confirmation is missing). It runs on the server and this call returns at once with the evaluation's id: read the result with get_evaluation. A later save marks the checks it reaches as needing a redo, and the evaluation is then outdated. kicad_fab makes fab files only from a board whose latest evaluation passed and is not outdated. Refused while an agent or another evaluation works on the circuit.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |

## get_evaluation

The latest evaluation of a circuit: status (running, done, interrupted), verdict, each check with its status (pass, fail, unknown, skipped, pending), reason, summary and findings, whether a later change made it outdated and which checks need a redo (affected), and current (passed and not outdated: fab files may be made).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |

## run_tests

Run every check a circuit has and give one verdict, like a test suite: requirements, intent, em, erc, nets, drc, sim (check_requirements, check_intent, the kept get_em solve, kicad_erc, kicad_net_diff, kicad_drc, run_sweep over the sim.json assert/sweeps/faults blocks). Each stage calls the existing tool, so checklist gates move as usual, and is pass, fail, unknown or skipped. unknown = no evidence (the tool could not run, the tests are not written, a person must confirm, the result is stale, time ran out) and blocks like fail: verdict is pass only when every stage that ran passed and none is unknown. A stage is skipped only with a recorded reason: its checklist gate is deferred (set_checklist), or skip: { stage: reason } on this call; skipped stages are listed. only: [stages] runs a subset (the report says partial). The em stage reads this board's em.json files by itself: its own and those naming it in their circuit field (antenna.em.json with circuit: "radar-core"); em: [names] picks among them. Takes up to about 75 s; stages that did not fit come back unknown (time_budget) with the call to run next. Simulation and EM results are model estimates.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name without .circuit.tsx |
| `only` | array of string |  |
| `skip` | object | { stage: reason } for stages to leave out of this run |
| `em` | array of string |  |
| `firmware_header` | string | Text of the firmware's board.h, passed to check_intent |
| `source` | one of `auto` \\| `kicad` \\| `tsx` | Passed to run_sweep |
| `budget_s` | number |  |

## suggest_tests

Draft assertions for <circuit>.sim.json (the tests run_sweep, run_montecarlo and run_tests evaluate) from what the simulator sees: one nominal operating point and its netlist. Drafts: each rail declared in <circuit>.analysis.json that the circuit has to produce (not the driven sources) within the band, and each two-resistor divider from a declared voltage to ground at V x Rbottom / (Rtop + Rbottom). Every draft states its basis (which file or which parts and values), the expected value, the nominal simulated value and whether they agree; a draft that disagrees carries a warning instead of being adjusted to fit. Nothing is guessed: shapes it does not recognise get no draft, and not_covered names what it could not derive and why. Nothing is saved: add the ones you accept to the assert block with write_file. tolerance_pct sets the band (default 5). Derived from the design's own values, so they check wiring and models, not whether the values were the right choice.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name without .circuit.tsx |
| `tolerance_pct` | number |  |
| `source` | one of `auto` \\| `kicad` \\| `tsx` |  |

## confirm_requirement

Record that a person confirmed one manual requirement of a circuit (editor role): the item then passes in check_requirements and run_tests instead of needs_human, with who, when and the note shown. Call it only when the person has said so in this conversation; note says how it was confirmed (what was looked at or measured), never a guess. holds: "revision" (default) ties it to the present schematic and board, so any later save makes it needs_human again; "text" keeps it until the requirement is reworded (for facts no board edit changes, such as an agreed supplier). revoke: true removes it. Only manual items can be confirmed; a tool-checked item passes by its check. Needs a signed-in user: the service token is refused. Each confirmation and revocation is written to the checklist log.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `id` * | string | The requirement id from get_design_spec |
| `note` | string | How it was confirmed, 5..500 characters |
| `holds` | one of `revision` \\| `text` |  |
| `revoke` | boolean |  |

## check_requirements

Functional check of a KiCad circuit against its stored requirements (set_design_spec): what the board must be able to do, as items {id, text, check, defer?}. Check types: part {match,count:[min,max?]}, net {net,min_pins?,refs_match?}, connector {ref,nets}, test_access {nets,via?} (firmware/debug port, test points), pitch {refs,axis,mm:[min,max]} (antenna element spacing), config {kind} (analysis, sim, intent, em, harness exist), repo_commit {role?,repo_id?,require_fresh?} (verified GitE2E commit), design_link {role?,design_id?,require_current?} (verified CAD design), manual (a person confirms: needs_human until confirm_requirement records it, and again after the design or the wording changes). Each item is pass, fail, deferred (failed but marked defer: only for what can be added later, such as a missing 3D model or datasheet) or needs_human; verdict fail if any item fails. DRC says the board can be made, this says it is the board that was asked for. Requirements and context are stored in the portal database: save them with set_design_spec. Reads the schematic netlist and the board; no export needed.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |

## check_intent

Design-intent check of a circuit against its <circuit>.intent.json: the logic level every listed control net settles to at plug-in, before any firmware runs (rails, pull-ups and pull-downs, open-drain and push-pull buffers by part number or intent.parts; MCU pins high-Z), compared with the power_up expectations (low, high, floating, not_low, not_high); and the MCU pin map (intent.mcu.pins: pin -> net, signal) against the netlist and, when firmware_header is passed (the text of the firmware's board.h), against its #define PIN_<signal> numbers. Write the intent file first: rails, parts, mcu, power_up (see docs/API.md). Refuses while the export is stale.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `firmware_header` | string | Optional: contents of the firmware pin header to compare (#define PIN_X n lines) |

## pin_header

Generate the firmware pin header (C #define PIN_<signal> <gpio> per intent.mcu.pins entry, with net, mode, polarity and the level at reset in a comment) from the circuit's export and its <circuit>.intent.json, so firmware includes the board instead of retyping it.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |

## verify_design

One verification report for a circuit, from the KiCad store when it holds the circuit (source kicad/auto: open connections counted from the schematic netlist and KiCad's unconnected items, so a board with no traces reports every net open; copper and placement from KiCad DRC; schematic ERC; stress is not derived there) or from the legacy circuit-json export (source tsx). The tsx report: continuity (unrouted ports per net, autorouter state, floating IC power pins, one-pin nets), copper (possible net-to-net shorts from trace, via and pad geometry), placement (check_placement plus courtyard errors) and stress (analyze_circuit, check_datasheet and a rail-voltage check against a part spec's optional v_max). Each finding has a severity, evidence and a confidence. Refuses with the reason when the stored export is older than the last save of the circuit file or of a file it imports, or while the export job is queued. All stress numbers are estimates from the part specs and the analysis config. See not_checked for what it does not cover.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `clearance_mm` | number |  |
| `edge_mm` | number |  |
| `source` | one of `auto` \\| `kicad` \\| `tsx` | kicad = from the KiCad store (netlist, KiCad DRC and ERC), tsx = from the legacy circuit-json export, auto (default) = kicad when the store has the circuit's .kicad_pcb and .kicad_sch, else tsx |

## get_3d_image

PNG render of a circuit's 3D board view (parts placed on the board), from the stored export (or the saved files, compiled by the engine). A few seconds. camera: top-left (default, angled), top-down, top-down-ortho, top-right, top-left-corner, top-right-corner, left-sideview, right-sideview, front, top-center-angled. Call it again with another camera for a second view. A circuit that lives only in the KiCad file store (no .circuit.tsx, no export) is rendered by KiCad 10 from its board and the 3D models stored with it (.step / .wrl / .glb; footprints without a model file show as bare board); source kicad forces that, tsx forces the other path.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name without .circuit.tsx |
| `camera` | one of `top-left` \\| `top-down` \\| `top-down-ortho` \\| `top-right` \\| `top-left-corner` \\| `top-right-corner` \\| `left-sideview` \\| `right-sideview` \\| `front` \\| `top-center-angled` |  |
| `source` | one of `auto` \\| `kicad` \\| `tsx` | kicad = render the board in the KiCad store, tsx = the TSX export or source. Default auto: TSX while an export or source exists, else the store. |
| `refs` | array of string | KiCad store only: a close view of these parts (4 mm around their pads), e.g. ["J12"] to check a 3D model against its footprint |
| `box` | array of number | KiCad store only: a close view of the area [x0, y0, x1, y1] in board mm |
| `try_place` | object | KiCad store only, with refs: draw the parts' models at this placement without saving anything: { offset: [x, y, z] mm, rotate: [x, y, z] degrees }. Save a placement that fits with kicad_set_3d_model. |

## batch_read

Several read tools in one call: saves a round trip per tool when you need the same read many times (pcb_query per net or box, get_part_spec per part, a supplier search per BOM line) or a set of checks together (kicad_drc summary, check_layout, check_zones, check_dfm). calls: up to 12 of { tool, args } (args as for the tool itself; project is filled in from this call's project). Each answer comes back as text cut at max_chars (default 4000, up to 20000), or, with pick, as only those top-level fields of a JSON answer (e.g. pick: ["verdict", "counts"]). A failed call gives its error and does not stop the others. Only tools that read and answer in text: no writes, no pictures (kicad_copper_view, get_3d_image), no download links, no long jobs. Calls run one after the other, so the time is the sum of theirs.

| Argument | Type | What |
|---|---|---|
| `project` | string | Project id, from list_projects |
| `calls` * | array of object |  |
| `max_chars` | integer |  |

## check_part_footprint

Does the part that will be bought fit the footprint on the board? Per BOM line of a KiCad circuit: the chosen LCSC part's package from the catalogue copy against the footprint's name, pad count and pad span. Verdict per line: match, mismatch (another chip size or package family, fewer pads than pins, a body much smaller or larger than the land pattern), check (cannot be told by name: compare with the maker's drawing) or no_supplier_part. Overall ok / review / fail. It compares names and sizes, not land patterns: a match is not a sign-off. Run it after sourcing and again before fab files; a mismatch is fixed with set_sourcing (another part) or the symbol's Footprint field and kicad_sync_pcb (another footprint). 2 to 10 s. Read-only.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |

## check_dfm

Design-for-manufacture check of a KiCad circuit's board against a fab's limits, in seconds, no runner needed: copper layer count, board size, narrowest track, closest gap between tracks and vias of different nets, via hole / pad / annular ring, blind and micro vias (an HDI order), drilled-pad holes and rings, copper to board edge, silkscreen text height and stroke, fiducials when fine-pitch parts are fitted. Limits come from the call's limits, then the circuit's rules.json dfm section (set_rules: { dfm: { profile, fab, microvia_ok, min_track_mm, min_clearance_mm, min_via_hole_mm, min_via_diameter_mm, min_annular_ring_mm (vias), min_pad_ring_mm (parts' plated holes), min_hole_mm, max_hole_mm, min_copper_edge_clearance_mm, silk_text_min_mm, silk_text_thickness_min_mm, max_copper_layers, min_board_mm, max_board_mm } }), then rules.json board, then the profile: standard (conservative, no HDI options), hdi, or a fab's own sheet: jlcpcb_2l and jlcpcb_multi (JLCPCB rigid FR-4 minimums on the date in the profile label; vias under its no-surcharge size are a low finding, not a fault). With dfm.fab naming JLCPCB and no profile, the JLCPCB sheet for the board's layer count is used. standard and hdi are generic, not a fab's sheet: for another fab put its figures in rules.json dfm. Setup gaps are findings too, never high: dfm:setup-fab (low: no fab named), dfm:setup-stackup (low: no stackup block in the board; kicad_edit set_stackup), dfm:setup-net-classes (low: power nets carrying parts and no class but Default takes them; set_rules preset or kicad_edit set_net_class). Returns verdict pass / review / fail, measured minimums, findings with the limit and where it came from, and what it does not check (pad and zone clearances: kicad_drc; mask slivers; the fab's own Gerber DFM). A pass closes checklist step 8.2 (dfm); a fail reopens it.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `profile` | one of `standard` \\| `hdi` \\| `jlcpcb_2l` \\| `jlcpcb_multi` |  |
| `limits` | object | Overrides for this call, same keys as rules.json dfm |

## check_layout

Layout practice check of a KiCad circuit's board, in seconds (no DRC run): placement (P1 parts of one schematic sheet grouped together, P2 decoupling capacitors within 5 mm of their chip and connected parts close, P3 heat sources away from crystals, sensors, references, electrolytics and batteries, P4 switching regulators and inductors away from clocks and RF), routing (R2 detours, R3 corners sharper than 135 degrees, R4 sensitive nets beside switch/clock nets, R6 parallel runs stacked on adjacent signal layers, R7 differential pair and length-group skew, R8 thermal relief spoke >= 0.5 mm long and >= 0.13 mm wide, solid only above 5 A, R9 tracks within 5 mm of the edge (ground excepted), R10 ground and power planes, R11 a test point on each rail) and width/spacing (W1 signal tracks >= 0.2 mm and one width per net, W2 track impedance from the board's stackup for nets with a target in rules.json impedance: [{ nets, ohm, tol_pct }] and, at 50 ohm, for nets named like RF or antenna lines (RF_*, ANT*): an off-target track is a finding with the width that would meet it, W3 power tracks >= 0.3 mm and the IPC-2221 width for the rail current, inner layers at half density, W4 IPC-2221B spacing for nets above 30 V). It does not repeat KiCad's DRC limits (kicad_drc does those). Thresholds: <circuit>.rules.json layout {...}; currents and voltages: <circuit>.analysis.json rails, loads and currents. Findings carry group, rule, severity and evidence; the placement group closes or reopens checklist gate 5, routing or width problems reopen gate 7. verify_design includes the same check as its layout section. groups narrows the reply to placement, routing and/or width.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `groups` | array of string |  |

## kicad_netlist

The real KiCad netlist of a circuit (kicad-cli over the whole sheet hierarchy, read from the stored schematic): each net with its pins (part, pin number, pin function, sheet). Use it, not list_nets or get_components (which read the stored export), to see which net a pin is really on. KiCad joins a pin to a wire only at the wire's end, never along its length, so a wire drawn over a pin connects nothing: read the netlist, not the drawing. Net names KiCad made itself (Net-(U212-P6)) mean nobody labelled that net; a name with a sheet path (/cam-core/ALS_INT) is a sheet-local label. Filters: net (exact name, else substring), ref (nets touching a part), sheet, unnamed (only unlabelled nets), single (only one-pin nets), limit (100, max 500), offset.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `net` | string |  |
| `ref` | string |  |
| `sheet` | string |  |
| `unnamed` | boolean |  |
| `single` | boolean |  |
| `limit` | integer |  |
| `offset` | integer |  |

## kicad_sch_labels

Put net labels on a KiCad schematic by PART AND PIN, so no coordinates are needed (a label connects only at the exact end of a pin or wire, to 4 decimals; this reads the pin position from the sheet's own symbol geometry). Ops: label_pin {ref, pin (number like "3" or name like "ALERT"), net, scope? "global" (default; spans sheets, and joins a power net of that name), "local" (this sheet only) or "hierarchical" (a sheet port: the interface of a module; shape? input\|output\|bidirectional\|passive), path?}, globalize {nets: [names] or "all", path?} (turns local labels into global labels in place: the fix for a net that is split because a sheet-local label is invisible to the other sheets), rename_net {from, to, path?} (renames label texts; not power symbols), no_connect {ref, pins: [numbers or names] or "unused", path?} (no-connect flags on pin ends: the fix for ERC pin_not_connected and pin_not_driven on pins left open on purpose; "unused" flags every pin of the part that is alone on its net, bare or with only a label; a pin that shares its net with another pin is refused; pins of type NC need none), remove_label {net, ref+pin or at: [x, y] or all: true, path?} (the fix for label_dangling), remove_wire {at: [x1, y1, x2, y2], path?} (a dangling stub), remove_power_flag {ref, path?} (a second PWR_FLAG on a net: ERC pin_to_pin between two power outputs), remove_no_connect {ref, pins: [numbers or names] or "all", or at: [x, y], path?} (takes no-connect flags off: the fix for ERC no_connect_connected, and for a pin that gets wired after all; give the pin or the x_mm/y_mm ERC reports: a flag that sits elsewhere on that net is found along the sheet's wires and labels), pin_names {ref, pins: {"<number>": "<name>"}, path?} (other names for pins of one part that is drawn with a pin-compatible symbol of another part, for example an XC6220 on the AP2112K symbol: the wiring is untouched and the part gets its own copy of the symbol; check the pin numbers against the datasheet first), labels_to_power {nets: [names] or "power", path?} (labels, local or global, of rail nets become power symbols at the same anchor: the stock power:GND, +3V3, +5V, VCC, VBUS ... of that name, else a stock symbol whose value is the net name, as KiCad does for a custom rail; upright, supplies up and grounds down, turned along the label when upright would run into the part; "power" = every net check_schematic calls a rail: by name, by a power symbol, or by a power input pin on it; a local label only when KiCad's netlist shows its net would meet no other net of that name; skipped labels are listed with the reason; the fix for check_schematic power_as_labels), power_flag {net, path?} (a power:PWR_FLAG on a pin end or wire end of the net, with a short wire when there is no room: the fix for ERC power_pin_not_driven on a rail fed from a connector or a part ERC does not see as a source; refused when the net has no pin on that sheet or a power output pin already drives it, and nothing happens when a flag is already on it). Coordinates are the x_mm/y_mm kicad_erc reports. path = a .kicad_sch from kicad_list, on the call or on each op (a net crossing sheets takes one op per sheet). Ops run in order, the first failure stops and nothing is saved; a pin that already carries another label is refused. dry_run shows what would change. After saving it reads KiCad's real netlist again and reports verify (each labelled pin: the net it is on now), nets_joined (a label that merged separate nets) and nets_split (a removal that took a net apart) with the revision to go back to. Flags and removals of dangling items leave the netlist as it was: run kicad_erc after to see the errors gone. Use kicad_net_diff to find the nets that need a label, kicad_netlist to see which sheet a part is on.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `path` | string | Default .kicad_sch path for ops that give none |
| `ops` * | array of object |  |
| `base_rev` | integer | Only when all ops are on one sheet |
| `dry_run` | boolean |  |
| `note` | string |  |

## kicad_sch_blocks

Redraw a KiCad schematic sheet as pre-wired functional blocks, the way a person draws one, instead of a label on every pin. Give the blocks by part: each block's parts are moved and turned, the labels, stubs and power symbols that hung only on their pins are removed, the block is wired (orthogonal, on the 1.27 mm grid), supply and ground become power symbols (supply up, ground down), labels stay only on nets that leave the block, a PWR_FLAG goes on a rail with power inputs and no driver, and a bold heading goes over the block. Blocks are packed in the order given with 12.7 mm gutters, the parts in no block are kept as they are (packed after the blocks), and the paper is set (A4 to A0) with a 15 mm margin clear of the title block. Motifs (parts / nets roles): decoupling {caps: [refs]} {rail, gnd} (rail bus on top, caps every 7.62 mm, GND bus below); ldo {reg, cin?: [refs], cout?: [refs]} {vin, vout, gnd} (the regulator's VIN pins must be on the left of its symbol and VOUT on the right; EN tied to VIN is wired in); divider {top, bottom} {in, out?, gnd}; pullup {r: [refs]} {rail} (each resistor's other pin keeps or gets its signal label); led {r, led} {in?, out? (or gnd)} (series resistor and LED in a vertical stack, either order); rc_filter {r, c} {in?, out?, gnd?} (R horizontal, C vertical to ground); crystal {xtal, caps: [2 refs]} {in?, out?, gnd?}. Nets are names already on the sheet (labels or power symbols); an optional net role is found from the parts, and a name given for a net that has none yet becomes its label. values {ref: value} sets Value fields, lib_ids {ref: "Lib:Item"} swaps to another symbol embedded in the sheet with the same pin numbers. The netlist must not change: the builder checks its own connectivity pin by pin, and before saving it asks KiCad for the netlist of the new sheet and compares it with the stored one (same pins on the same nets, no nets joined); otherwise nothing is saved. Nets that lose their only label get KiCad's Net-(...) name (listed in names_dropped; kicad_sync_pcb carries that to the board). dry_run returns the plan (blocks with bbox, wires per part, labels, power symbols, flags; paper; counts) without KiCad. Afterwards run kicad_erc and kicad_net_diff; kicad_restore undoes it. Single-unit parts only; sheets with buses are refused.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` | string | Circuit name; its root sheet is used unless path is given |
| `path` | string | .kicad_sch from kicad_list (a sheet of the circuit) |
| `blocks` * | array of object |  |
| `base_rev` | integer | The sheet's rev you read (kicad_list / kicad_read); refused if it changed since |
| `dry_run` | boolean |  |
| `note` | string |  |

## kicad_modules

Library of reusable schematic modules (USB-UART bridge, camera interface, power stage ...) kept in one library project (default "library") and COPIED into boards with a version stamp; a live link would change a board that was already sent to fab. A module is a folder <module>/ with module.json (name, version, license, source, ports, rails, tags) and its .kicad_sch sheets; its interface is its hierarchical labels. Actions: list (modules in the library); publish {circuit, module, version, license, title?, description?, source?, rails?, tags?, files?, top?, ports?} (turns a circuit of this project into a library module: ports are read from the top sheet's hierarchical labels, a library version is never changed in place, footprints named by the sheets are copied to the library's _libs/); use {circuit, module} (copies the module's sheets and footprints into the circuit folder, writes <circuit>/<module>.module.json, and returns sheet_symbol = the Sheetfile and pins to add to the top sheet); status {circuit} (which modules the circuit uses, whether the library has a newer version, whether the local copy was edited). overwrite replaces sheets that exist and differ; dry_run shows the plan. Needs edit access to project (publish: and to the library). The library is the project named "library" unless `library` (a project id) or env MODULE_LIBRARY says otherwise.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `action` * | one of `list` \\| `publish` \\| `use` \\| `status` |  |
| `circuit` | string | Circuit folder: the source of publish, the destination of use/status |
| `module` | string |  |
| `library` | string | Library project id (default library) |
| `version` | string | publish: 1.0.0 |
| `license` | string | publish: SPDX id, e.g. CERN-OHL-P-2.0, CC-BY-SA-4.0, MIT |
| `title` | string |  |
| `description` | string |  |
| `source` | array of string | publish: URLs the design comes from |
| `rails` | array of object |  |
| `tags` | array of string |  |
| `files` | array of string | publish: sheet file names in the circuit folder (first = top); default all |
| `top` | string |  |
| `ports` | array of object | publish: optional; must match the top sheet's hierarchical labels |
| `overwrite` | boolean |  |
| `dry_run` | boolean |  |

## kicad_net_diff

Compare the schematic netlist with the board's pad nets of a KiCad circuit and list where they disagree: missing_label (the board names a net the schematic leaves unnamed: add a global label with the board's name), split (one board net is several schematic nets: a sheet-local label or a label missing on one sheet), merged (two board nets are one net in the schematic: a short or wrong label), renamed (same pins, different name). Finds nets lost when sheets were split or labels were local, in one call; run it after editing labels or sheets. Read-only.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |

## check_placement

Check part placement on a circuit's exported board: overlaps, parts closer than clearance_mm (default 0.3), and parts near or over the board edge (edge_mm, default 0.5). Uses pad boxes grown to the 3D body where the part has one. Also reports courtyard/placement errors the export carries (export_errors), including 'autorouting skipped'; any of them makes the verdict fail. Pair it with get_3d_image.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `clearance_mm` | number |  |
| `edge_mm` | number |  |
| `ignore` | array of string | Refs to skip, for example antenna copper |
| `source` | one of `kicad` \\| `tsx` | Where the circuit comes from: tsx = the TSX export (circuit-json), kicad = the circuit's KiCad schematic and board in the store (netlist by KiCad; no traces or courtyards). Default: tsx while an export exists, else kicad. |

## digikey_search

Search DigiKey India (digikey.in; prices in INR, preferred supplier for orders placed in India) by manufacturer part number or keywords. Returns DigiKey part number, manufacturer, package, stock, minimum order, unit price and price breaks, status and link. Needs the DigiKey credentials an admin sets in Settings. A snapshot from the API, not a quote.

| Argument | Type | What |
|---|---|---|
| `query` * | string | MPN or keywords, e.g. "RP2040" or "100nF 0402 X7R 16V" |
| `limit` | integer | Results (default 5) |
| `refresh` | boolean | Ask the supplier again instead of using the saved answer. Only when the user asked to reconfirm; saved answers (see saved_at) are otherwise what to use. |

## digikey_substitutions

DigiKey's own substitutes for one part on digikey.in (by DigiKey part number or MPN): type (direct, parametric, similar...), MPN, maker, stock, INR price, link. Use it for a part that is out of stock or missing; check value, package, ratings and pinout against the datasheet before swapping.

| Argument | Type | What |
|---|---|---|
| `part_number` * | string | DigiKey part number or MPN |
| `refresh` | boolean | Ask the supplier again instead of using the saved answer. Only when the user asked to reconfirm; saved answers (see saved_at) are otherwise what to use. |

## onlinecomponents_search

Search onlinecomponents.com by part number (comma-separated for several): stock, on-order and factory lead time, price breaks (USD unless the result says otherwise), minimum order, datasheet and product links, and alternative parts. Needs the API key and name an admin sets in Settings. A snapshot, not a quote.

| Argument | Type | What |
|---|---|---|
| `query` * | string | Part number, e.g. "RP2040" |
| `exact` | boolean | Only parts whose number equals the query |
| `in_stock_only` | boolean |  |
| `limit` | integer | Results (default 5) |
| `refresh` | boolean | Ask the supplier again instead of using the saved answer. Only when the user asked to reconfirm; saved answers (see saved_at) are otherwise what to use. |

## element14_search

Search element14 India (in.element14.com, Farnell/Newark group; prices in INR) by manufacturer part number, keywords or element14 order code: stock, lead time in days, minimum order, price breaks, datasheet and link. Needs the API key an admin sets in Settings. A snapshot, not a quote.

| Argument | Type | What |
|---|---|---|
| `query` * | string |  |
| `mode` | one of `mpn` \\| `keyword` \\| `sku` | mpn (default), keyword or sku (element14 order code) |
| `in_stock_only` | boolean |  |
| `limit` | integer | Results (default 5) |
| `refresh` | boolean | Ask the supplier again instead of using the saved answer. Only when the user asked to reconfirm; saved answers (see saved_at) are otherwise what to use. |

## mouser_search

Search Mouser by part number (mode mpn, exact; Mouser's or the manufacturer's number) or keywords: stock, lead time, minimum order, price breaks (in the currency the result states), datasheet and link. Needs the Search API key an admin sets in Settings (about 30 calls a minute). A snapshot, not a quote.

| Argument | Type | What |
|---|---|---|
| `query` * | string |  |
| `mode` | one of `mpn` \\| `keyword` | mpn (default) or keyword |
| `in_stock_only` | boolean |  |
| `limit` | integer |  |
| `refresh` | boolean | Ask the supplier again instead of using the saved answer. Only when the user asked to reconfirm; saved answers (see saved_at) are otherwise what to use. |

## search_suppliers

Search a part at every supplier that is set up (DigiKey India, element14 India, Online Components, Mouser) in one call and check stock: returns, per supplier, the top matches (part number, stock, lead time, price with currency, link) and whether the stock covers `quantity` (counted only for a part whose manufacturer part number equals the query: exact_mpn; other matches are look-alikes, shown for reference); a supplier that is not set up or whose key is refused is listed with the reason instead of failing the call. Use it before swapping a part. Snapshots, not quotes; prices are in different currencies.

| Argument | Type | What |
|---|---|---|
| `query` * | string | Manufacturer part number (exact where the supplier supports it) or keywords |
| `quantity` | integer | Units needed (default 1): marks which suppliers have enough |
| `limit` | integer | Matches per supplier (default 3) |
| `refresh` | boolean | Ask the supplier again instead of using the saved answer. Only when the user asked to reconfirm; saved answers (see saved_at) are otherwise what to use. |

## get_sourcing

Where each component of a project is bought: per component (part_key from a make_bom line) the chosen supplier and its part number, other suppliers noted, a stock/price snapshot and a note. Kept in the project database apart from the circuit source, which only says what a part is.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |

## set_sourcing

Choose where to buy components (project database, not the circuit source). Each item: part_key (from a make_bom line) or mpn, supplier (digikey, element14, mouser, lcsc, onlinecomponents), part_number, optional note and offer {stock, unit_price, currency, url} from the supplier search, preferred (default true: the one the BOM buys from), remove: true to delete that supplier's row. An LCSC choice replaces the line's LCSC number in the BOM. Use this instead of editing supplierPartNumbers in the circuit; change the circuit only when the part itself (MPN, value, footprint) changes.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` | string | The circuit the items come from: lets an item name designators (refs) instead of part_key, and rejects a part_key that is not on that circuit's BOM |
| `items` * | array of object |  |

## get_offers

The last supplier answers saved for a manufacturer part number (every supplier lookup is kept): supplier, supplier part number, stock, unit price with currency, lead time, link, when it was fetched and, in details, everything else the supplier said (all price breaks, datasheet, lifecycle, alternatives); history lists each time stock or price changed. Use it before searching again; the numbers are snapshots and can be old.

| Argument | Type | What |
|---|---|---|
| `mpn` * | string |  |

## get_components

What a project's circuits are made of, per BOM line: part_key (as set_sourcing uses), kind, MPN, value, footprint, designators and quantity per board. Refreshed whenever a circuit's BOM is made.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` | string |  |

## get_configs

The parsed per-circuit config files of a project from the database (analysis, sim, thermal, bom, intent, em, harness), optionally one kind. A queryable copy kept in step on every save; the files remain what write_file edits. For a circuit in the KiCad store the files are <circuit>/<circuit>.<kind>.json there (harness.json at the store root) and those win.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `kind` | one of `analysis` \\| `sim` \\| `thermal` \\| `bom` \\| `intent` \\| `em` \\| `rules` \\| `harness` |  |

## make_bom

Bill of materials for a circuit scaled to an order of N boards: grouped parts, designators, LCSC numbers, order quantities, and warnings for parts without a supplier number. Returns totals, warnings, the parts without a supplier number and one short text line per part group (compact, so it fits in a reply). Pass digikey: true to add DigiKey India (digikey.in, INR) stock, price and part number per line. Pass csv "jlcpcb", "lcsc", "generic" or "digikey" (DigiKey list upload) to also get that one file as CSV text for JLCPCB BOM upload, LCSC cart import or other suppliers. Does not place an order. Overrides go in <circuit>.bom.json as {"parts":{"U1":{"lcsc":"C12345"}}}.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `boards` | integer | Number of boards to build (default 1) |
| `source` | one of `kicad` \\| `tsx` | Where the parts come from: kicad = the circuit's .kicad_sch in the KiCad store (netlist by KiCad), tsx = the circuit-json export of the TSX source. Default: kicad when the store has the schematic, else tsx. Use both to compare. |
| `csv` | one of `jlcpcb` \\| `lcsc` \\| `generic` \\| `digikey` | Also return this one file as CSV text (digikey implies digikey: true) |
| `mouser` | boolean | Also check each line with an MPN on Mouser: stock and price (first 30 lines) |
| `element14` | boolean | Also check each line with an MPN on element14 India: stock and INR price (first 60 lines) |
| `onlinecomponents` | boolean | Also check each line with an MPN on onlinecomponents.com: stock and price (first 60 lines) |
| `digikey` | boolean | Also check each line with an MPN on DigiKey India: DigiKey part number, stock, INR price (first 60 lines) |
| `refresh` | boolean | Ask the supplier again instead of using the saved answer. Only when the user asked to reconfirm; saved answers (see saved_at) are otherwise what to use. |

## run_thermal

Thermal check of a circuit. Every part with a power and a thermal resistance gets a steady junction temperature in parts_steady: the regulators and ICs analyze_circuit estimates from part specs, plus any part listed in <circuit>.thermal.json parts {"D15": {vf_v, current_ma, duty?} or {power_mw} or {v_drop, current_ma}, theta_ja or theta_jc + theta_ca, tj_max, note} (diodes, PAs, FETs), with Tj, margin and ok/warn/fail; altitude_m (thermal.json, overrides, or the design spec's context.standards.altitude_m) grows the convective resistance as the air thins. Boards with power LEDs also get a transient run for a chosen time. Applies power and shows the junction temperature of every LED over time, the board, the heatsink and ballast resistors, the heat in versus heat out, time to steady state, which LEDs would burn out and when, and the heatsink thermal resistance needed. Needs LEDs whose part number has an led spec. Config comes from <circuit>.thermal.json; override per call with overrides: {ambient_c, board:{material mcpcb\|fr4}, heatsink:{r_sa K/W, mass_g, fan, x,y,w,h contact rectangle in board mm}, drive:{mode cc\|cv, current_ma, volts_per_led, duty}, schedule:[{from_s,current_ma,duty}]}. Estimates from lumped thermal resistances: compare designs, then measure a real board.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `minutes` | number | How long to run, in minutes (default 30, up to 1440) |
| `overrides` | object |  |
| `detail` | one of `summary` \\| `full` |  |
| `source` | one of `kicad` \\| `tsx` | Where the circuit comes from: tsx = the TSX export (circuit-json), kicad = the circuit's KiCad schematic and board in the store (netlist by KiCad; no traces or courtyards). Default: tsx while an export exists, else kicad. |

## check_datasheet

Compare what a circuit asks of each part with the limits in its part spec (datasheet values): LED forward current including temperature derating, pulse current, duty and width, junction temperature, reverse voltage, power, driver output window, resistor power. Each row says whether the spec was verified against a datasheet and gives its source URL; rows marked unverified use estimates. Runs the thermal model first for temperatures.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `minutes` | number |  |
| `overrides` | object | Same shape as run_thermal; also reverse_v and driver:{series,vout_min,vout_max} |
| `source` | one of `kicad` \\| `tsx` | Where the circuit comes from: tsx = the TSX export (circuit-json), kicad = the circuit's KiCad schematic and board in the store (netlist by KiCad; no traces or courtyards). Default: tsx while an export exists, else kicad. |

## set_part_spec

Add or update a part's electrical spec used by analyze_circuit. sources: [{mpn, page}] are the datasheet library pages the numbers came from (search_datasheets / get_datasheet_page); they are checked to exist and stored with the spec (ds_pages, library_backed), so list_part_specs shows which specs rest on a stored page. spec: {type: ic\|linear\|buck\|boost\|led\|tvs\|mosfet\|diode\|bjt (bjt: polarity n\|p, bf, optional r1_ohm in series with the base and r2_ohm base to emitter for bias-resistor transistors; diode: vf V at if_ma, rs_ohm default 0.03, n default 1.05, for Schottky and rectifier diodes; regulators may also give vref, fb_pin and vout for fixed parts; mosfet: polarity n\|p, vth in V, rds in ohm), tvs: vbr, vc (clamp V at ipp), ipp (A); model (ic): led_buck\|comparator_oc\|opto\|and_gate\|dac\|gpio\|rs485 with pins/channels/gates/outputs, see worker/spice.mjs; led: vf (V at if_ma), if_ma, rs_ohm (default 0.3), n (default 2); v_max (absolute maximum volts on any pin whose net has a voltage in the analysis config; verify_design flags above 80 %), internal_rails (ic: {pin name: volts} for a rail the chip makes on its own pin, e.g. an MCU core LDO {"VCAP": 1.2}; run_simulation drives that net from an ideal stand-in behind 1 ohm, which checks the wiring, not the regulator), supply (regex over supply pin names, for ic), i_typ_ma, i_peak_ma, in_pin/out_pin/iq_ma/dropout_v/eta/imax_ma (regulators), theta_ja, tj_max, pkg}. Use datasheet values.

| Argument | Type | What |
|---|---|---|
| `mpn` * | string |  |
| `spec` * | object |  |
| `note` | string |  |
| `sources` | array of object |  |

## get_project

One project: id, name, owner, created, last update, circuits, members, archived status, archived_circuits, circuit_versions summary, and linked GitE2E repos, commits and Designs.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |

## highlight

Mark parts and nets on the PCB map in the editor's agent panel so the person sees what you are talking about (a traced power path, the parts of one function block). Give component names (U1, C3) and/or net names (VCC, CAN_H); traces and pads of a net light up. Returns at once; no file changes. For a circuit in the KiCad store the names are checked against its schematic and board and the reply says where each part and net pin sits (board mm) and which names do not exist.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` | string | KiCad circuit to resolve the names in (default: the project's only KiCad circuit) |
| `components` | array of string | Component names to highlight |
| `nets` | array of string | Net names to highlight (their traces and pads) |
| `note` | string | Short caption shown with the highlight |

## rename_project

Rename a project (the display name; the id stays). Owner only.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `name` * | string | New name, up to 80 characters |

## rename_circuit

Rename a KiCad-store circuit inside its project: the whole folder <circuit>/ moves to <as>/ (files named after the circuit take the new stem), its SPICE result, design gates and config rows follow. History of the old files stays. Fails if the new name exists. Needs edit access. To move a circuit to another project use move_circuit.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `as` * | string | New circuit name (letters, digits, . _ -) |

## delete_circuit

Delete one circuit from a project: tombstones its KiCad files (earlier revisions and stored bytes stay, so kicad_restore can bring files back), removes its TSX source and its SPICE result, design gates and parsed configs. Uploaded assets are kept. Owner only. Pass confirm equal to the circuit name.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `confirm` * | string | Must equal the circuit name |

## archive_project

Archive or unarchive this project for your account (hides it from your active list without affecting other members or deleting any files).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `archived` * | boolean | true to archive, false to unarchive |

## archive_circuit

Archive or unarchive one circuit across the project without deleting its KiCad files, revisions, or saved versions. Needs edit access.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name (letters, digits, . _ -) |
| `archived` * | boolean | true to archive, false to unarchive |
| `note` | string | Optional reason for archiving (up to 300 chars) |

## list_circuit_versions

List saved version snapshots of a circuit (or inspect one `tag`), comparing stored file manifests against current working files.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `tag` | string | Optional exact version tag to inspect with its file list |
| `include_files` | boolean | Include per-file manifest status on every returned version |

## create_circuit_version

Save a named version snapshot of a circuit's current KiCad files so you can inspect diffs or revert later. NEVER auto-generate or guess `tag`: always ask the user explicitly for the version tag first.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `tag` * | string | Explicit version tag chosen by the user (e.g. rev-a, v1.0-proto). NEVER auto-generate or guess a tag; always ask the user what version tag they want first. |
| `note` | string | Optional short release or milestone note (up to 300 chars) |

## revert_circuit_version

Preview (`dry_run: true`) or revert a circuit's KiCad store files to a saved version `tag` cleanly via forward revisions (preserving full history and tombstoning files added after the tag). Requires `confirm` equal to `tag` when not dry_run.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `tag` * | string | Target version tag from list_circuit_versions |
| `confirm` | string | Must equal `tag` when executing the revert (omit for dry_run) |
| `dry_run` | boolean | Preview files that would be restored, removed, or unchanged without writing |

## delete_circuit_version

Delete a saved circuit version tag label (owner only; underlying KiCad files and revision history stay intact).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `tag` * | string |  |

## delete_project

Permanently delete a project with all its files, history, exports and members. Irreversible. Pass confirm equal to the project id.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `confirm` * | string | Must equal the project id |

## list_members

Who has access to a project and with which role.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |

## list_users

Admin: everyone who has signed in (first and last seen, count), outside users allowed, admins, and each person's project access.

No arguments.

## list_external_users

Admin: outside (non-company) addresses allowed to sign in. They see only projects shared with them, and not settings, the datasheet library or project creation.

No arguments.

## allow_external_user

Admin: allow one outside address to sign in with Google. Then give access with share_project (viewer or editor). Set can_create true to let them start their own projects (default: only open projects shared with them). Call again to change it.

| Argument | Type | What |
|---|---|---|
| `email` * | string |  |
| `can_create` | boolean |  |

## remove_external_user

Admin: block an outside address and drop all its project access.

| Argument | Type | What |
|---|---|---|
| `email` * | string |  |

## remove_member

Remove a user's access to a project.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `email` * | string |  |

## list_revisions

Saved versions of a project (id, time, author, message), newest first, up to 100.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |

## restore_revision

Restore every file in a project to a saved version. Recorded as a new save, so it can be undone by restoring the revision before it.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `revision` * | integer | Revision id from list_revisions |

## move_file

Move (or copy) a text file into another project; you need edit access to both. Inside one project (leave to_project out, or give the same project) it renames the file to to_path, or copies it with copy: true. Fails if the target path exists unless overwrite is true. For a whole circuit (its config files and imported modules) use move_circuit or copy_circuit.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `file` * | string |  |
| `to_project` | string | Another project; omit to move within this project |
| `to_path` | string | Defaults to the same path (required within one project) |
| `copy` | boolean |  |
| `overwrite` | boolean |  |

## transfer_project

Owner: hand the project to another owner (company or allowed outside address). The previous owner stays on as editor.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `owner` * | string |  |

## download_circuit_source

A circuit's source as a zip (a circuit that lives only in the KiCad file store: every file of its folder there, board, schematic, project, libraries and 3D models, plus SOURCE.json): its .circuit.tsx, its config files (analysis, sim, thermal, bom, intent, em), the modules it imports (followed through their own imports), package.json, SOURCE.json (manifest) and sourcing.json (where its parts are bought). circuits: several names, or "all", for one zip of many circuits. Returns the file list, size and sha256 and the portal path to download it (signed in: /api/projects/<project>/source/<circuit>.zip, add ?exports=1 for the stored exports). save_asset: true also stores the zip as a project asset (needs edit access; Assets page, circuit folder) so it can be downloaded later or by others; inline: true returns the zip itself as base64 when it is small (up to 150 KB). Large zips are never put in the reply. For circuits in the KiCad store the reply carries a signed download link (url, curl command, 15 minutes) unless inline or save_asset is asked for; models: false leaves out 3D models and include / exclude take globs, so a folder over the size limit can still come down.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `models` | boolean | Include 3D model files (default true) |
| `include` | array of string | Only paths matching one of these globs |
| `exclude` | array of string | Leave out paths matching these globs |
| `circuit` | string | One circuit, without .circuit.tsx (a folder path like radar/radar-core works) |
| `circuits` | array of string | Several circuits, or ["all"] |
| `dependencies` | boolean | Include imported modules (default true) |
| `configs` | boolean | Include the circuit's config files (default true) |
| `sourcing` | boolean | Include sourcing.json (default true) |
| `exports` | boolean | Include the stored exports: circuit JSON, KiCad zip, EasyEDA JSON (default false) |
| `save_asset` | boolean | Also store the zip as a project asset |
| `inline` | boolean | Return the zip as base64 (small zips only) |

## get_rules

Read a circuit's board rules (<circuit>.rules.json; for a KiCad circuit they are mirrored into its .kicad_pro, which KiCad's DRC and the autorouter use): net classes (own trace width, clearance and via size per group of nets), keep-out areas, and later pairs, fan-out and pours. Shows the file, whether it validates, which net falls in which class (from the export) and which rules the router honoured. Call before routing a board with power nets or antennas; use set_rules to change them, list_nets for the net names.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |

## set_rules

Write a circuit's board rules. Give `rules` to replace the whole file, or `merge` to add or replace entries by name (net_classes, keepouts, ...) and `remove: { net_classes: ["power"] }` to delete by name. Validated before saving (the error names the path of the mistake); dry_run only checks. A save re-exports the circuit so the router uses the new rules (routing must be on: a board with routingDisabled has no copper to apply them to). net_classes: [{ name, nets: ["GND", "VIN*"], width, min_width, clearance, via_od, via_hole }] in mm, first matching class wins, wide classes route first. keepouts: [{ name, shape: "rect"\|"circle"\|"polygon", center:{x,y}, width, height \| radius \| points, layers:["top","bottom"] }] keep traces and vias out (and become KiCad rule areas). impedance: [{ name, nets: "RF_*" or a list, ohm (50), tol_pct (10) }] declares single-ended impedance targets that check_layout holds the routed tracks to (ohm 0 = not a controlled line). preset "standard" (alone, or with merge / remove applied on top) gives the board the fab-friendly set in one call: Default class track 0.20, clearance 0.15, via 0.6 / drill 0.3; a Power class track 0.5, clearance 0.2, via 0.8 / drill 0.4 on the board's power nets (kind power as list_nets has it; ground nets stay in Default and the reply names them); board minimum hole 0.30 (JLCPCB's no-surcharge drill); dfm.fab JLCPCB unless a fab is named; layout.edge_clearance_mm 0.3 unless set. preset "dense" adds a Dense class (track 0.15, clearance 0.127, via 0.45 / drill 0.25) on the nets in dense_nets (BGA or fine-pitch QFN fan-out; without them the class goes into the .kicad_pro with no nets), Default clearance 0.127 and track 0.15, and board minimum hole 0.25. A preset never narrows a class the board already has wider: per figure the larger stays (reply preset.kept). Board minimums that would overrule the classes come down to them (preset.board). The reply lists every class before and after (preset.classes) and the Power nets (preset.power); dry_run returns that without saving.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `rules` | object |  |
| `merge` | object |  |
| `remove` | object |  |
| `preset` | one of `standard` \\| `dense` | Lay a fab-friendly rule set on the stored rules (merge and remove apply on top) |
| `dense_nets` | array of string | preset dense: net names or globs for the Dense class (fine-pitch fan-out) |
| `dry_run` | boolean |  |

## list_nets

Nets of a circuit (from the KiCad store schematic and board when the circuit lives there, else from its export): name, aliases, pin count, kind (power, ground, signal: a guess from the names and flags) and the net class it falls in. Use it to write net_classes for set_rules. Largest nets first.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `kind` | one of `power` \\| `ground` \\| `signal` |  |
| `limit` | number |  |

## get_board_stackup

START HERE before laying out, placing or connecting a board: how many copper layers it has (KiCad circuits: from the .kicad_pcb in the store; legacy TSX: <board layers={N}>, 2 by default), their names, what is on each (parts by side, pads, trace length, vias, pours) and plain rules for connecting a board of that layer count (what the inner layers are for, what a bottom-side part costs, what the portal's engine does and does not do with planes). Reads the stored export; without one it reads layers={N} from the source. For a KiCad board with a stackup block it also gives, per copper layer, the estimated track impedance (microstrip on outer layers, stripline inside): the width for 50 ohm (or `ohm`) and the impedance of common widths. verify_design, check_placement and list_connectors also report the layer count.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name without .circuit.tsx |
| `ohm` | number | Single-ended target for the width table (default 50) |

## copy_circuit

KiCad-store circuits (kicad_list) are copied as their whole folder <circuit>/ (all files, sub-sheets, models, config json), as new revisions in the destination (source mcp); as renames the top-level <circuit>.* files; the bytes are copied, history is not. A circuit with both a TSX source and a KiCad folder copies both. Copy a whole circuit into another project: its .circuit.tsx, its config files (analysis, sim, thermal, bom, intent, em), the source modules it imports (followed through their own imports; index.circuit.tsx is never taken) and its sourcing choices (supplier numbers; the destination's own choices are kept). You need edit access to both projects. Saved to the destination as one version, so its exports are queued. Conflicts (a different file already at that path) stop it unless overwrite is true; dry_run only shows the plan. Not copied: uploaded assets (3D models, STEP files) and the destination's index: run build_index there afterwards.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name without .circuit.tsx |
| `to_project` * | string |  |
| `as` | string | Name in the destination (default: the same, folder included; give a plain name to flatten radar/radar-core into radar-core) |
| `dependencies` | boolean | Also copy imported source modules (default true) |
| `sourcing` | boolean | Also copy sourcing choices (default true) |
| `overwrite` | boolean |  |
| `dry_run` | boolean |  |

## move_circuit

KiCad-store circuits: copy the folder, then mark the source files deleted (earlier revisions and stored blobs stay); needs the owner role in the source project. Move a whole circuit into another project: as copy_circuit, then remove it from this project: the circuit and its config files, and the imported modules nothing else here still imports (the generated index does not count; run build_index in both projects afterwards). Refuses when the destination copy could not be saved; nothing is removed unless the copy succeeded. dry_run shows what would move and what would be removed.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `to_project` * | string |  |
| `as` | string |  |
| `dependencies` | boolean |  |
| `sourcing` | boolean |  |
| `overwrite` | boolean |  |
| `dry_run` | boolean |  |

## rename_file

Rename or move a project file.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `from` * | string |  |
| `to` * | string |  |

## get_export

Fetch a stored export. format circuit-json and easyeda_json (EasyEDA Standard PCB document) return the (decompressed) JSON text; kicad_zip (and other binary formats) return JSON { total_bytes, offset, length, next_offset, base64 }: the whole file in pieces of about 0.7 x max_bytes bytes (max_bytes up to 1000000), call again with offset = next_offset until it is null and join the decoded pieces. JSON formats are cut at max_bytes (default 200000); use `types` to filter them. For a circuit that lives only in the KiCad file store, kicad_zip is built from the files of the circuit's folder (board, schematic, project, libraries, 3D models) and fab_zip is the latest kicad_fab result; there is no easyeda_json for it.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `format` * | one of `circuit-json` \\| `kicad_zip` \\| `easyeda_json` \\| `fab_zip` \\| `board_datasheet` \\| `harness_html` |  |
| `max_bytes` | integer |  |
| `offset` | integer | binary formats: byte offset of the piece (from next_offset) |
| `types` | array of string | circuit-json only: return just elements whose type contains one of these, e.g. ["error"] or ["pcb_board","source_component"] |

## list_3d_shapes

Catalogue of the generic 3D shapes add_3d_part can build for visual-only parts: box, cylinder, standoff, ffc_cable, zif_connector, connector_housing, latch, camera_module, terminal_block, with their parameters (mm) and defaults. Shapes are stand-ins for looks and the placement check, not manufacturer models.

No arguments.

## add_3d_part

Add a visual part (cable, connector housing, latch, camera module, standoff, any body) to a circuit so it shows in the 3D view and in check_placement. It writes a <chip> with a pad-less footprint and a generated cadModel into <circuit>.circuit.tsx (replacing a part of the same name), so it also appears in the BOM like any chip (pass mpn to name it). Place it with x_mm/y_mm (board coordinates, mm, optional rotation_deg and z_mm lift), or attach it to a placed component: attach { ref: "J1", side: "right\|left\|top\|bottom\|on", gap_mm?, offset_mm? } puts it touching that side, front (+x of the shape: where a cable leaves, a connector opens) facing away. attach needs the stored export, so save the circuit and wait a few seconds first. View the result with get_3d_image. For a circuit that lives only in the KiCad file store the part is a board-only footprint with a generated VRML body (.wrl) saved beside the board as new revisions (x_mm / y_mm are KiCad board coordinates, y down; it is not in the schematic, BOM or pick-and-place); source kicad forces that.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string | Circuit name without .circuit.tsx |
| `source` | one of `auto` \\| `kicad` \\| `tsx` | kicad = edit the board in the KiCad store, tsx = the .circuit.tsx. Default auto: TSX when the file exists, else the store. |
| `shape` * | string | A shape from list_3d_shapes |
| `params` | object | Shape parameters, see list_3d_shapes |
| `name` | string | Part name, default M1, M2 ... Reusing a name replaces that part |
| `x_mm` | number |  |
| `y_mm` | number |  |
| `rotation_deg` | number | Counter-clockwise; with attach it defaults to facing away from the component |
| `z_mm` | number | Lift above the board surface |
| `attach` | object | { ref, side, gap_mm?, offset_mm? } |
| `courtyard` | boolean | Add a courtyard the size of the shape (default true; false for ffc_cable and latch, which overlap their connector on purpose) |
| `mpn` | string | Manufacturer part number for the BOM line |

## list_3d_parts

Visual parts added with add_3d_part in a circuit: name, shape, parameters. For a circuit in the KiCad file store it also lists the (model ...) entries of the board's footprints and whether each model file is in the store (in_store).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `source` | one of `auto` \\| `kicad` \\| `tsx` | Default auto: TSX when the .circuit.tsx exists, else the KiCad store. |

## remove_3d_part

Remove a visual part added with add_3d_part, by name (from the .circuit.tsx, or from the board in the KiCad store together with its generated model file; history keeps both).

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |
| `circuit` * | string |  |
| `name` * | string |  |
| `source` | one of `auto` \\| `kicad` \\| `tsx` | Default auto: TSX when the .circuit.tsx exists, else the KiCad store. |

## get_audit

Audit log for a project (creates, sharing, setting changes), newest first, up to 200.

| Argument | Type | What |
|---|---|---|
| `project` * | string | Project id, from list_projects |

## get_settings

Admin switches (agent, simulations, part lookup, new UI) and agent requests in the last 24 hours.

No arguments.

## set_setting

Change an admin switch. Keys and values as returned by get_settings (booleans, an integer, or an allowed model name). Audited.

| Argument | Type | What |
|---|---|---|
| `key` * | string |  |
| `value` * | any |  |

## list_part_specs

All part specs (mpn, type, verified flag, datasheet URL).

No arguments.

## get_part_spec

One part spec in full, with its note. A part number that is not stored under that exact name gets the spec the estimate would use for it (matched by prefix, said in `matched`); when there is none the error says so and names what to do, so there is no need to call this for a part you have just found to be new.

| Argument | Type | What |
|---|---|---|
| `mpn` * | string |  |

## list_datasheets

Datasheet library: stored manufacturer PDFs (part numbers, revision, pages, fetch date). Originals are in R2; text is searchable.

No arguments.

## search_components

Search our own copy of the JLCPCB component catalogue (about 500K parts) by MPN, LCSC number or words from the parametric description (voltage, current, package, function). Returns LCSC number, MPN, package, description, category and basic/preferred class. Stock and prices are NOT included (they would be out of date): use digikey_search, search_suppliers or get_offers for live availability and price. Narrow with package (e.g. 0402, SOT-23-5), category text and basic_only. Read-only, any role.

| Argument | Type | What |
|---|---|---|
| `query` * | string | MPN, LCSC number (C12345) or description words, 2 to 120 characters |
| `package` | string |  |
| `category` | string | Text that must appear in category, subcategory or description, e.g. ldo, crystal |
| `basic_only` | boolean | JLCPCB basic parts only (no extended-part fee) |
| `limit` | integer |  |

## get_component

One component from the catalogue copy by lcsc (C12345) or mpn: record, same-package alternatives, the datasheets in our library for that MPN and whether a part spec exists. No stock or price (they age); use digikey_search, search_suppliers or get_offers for those. Read-only, any role.

| Argument | Type | What |
|---|---|---|
| `lcsc` | string |  |
| `mpn` | string |  |

## search_datasheets

Full-text search over stored datasheet pages. Returns part, revision, page and a snippet. Read the whole page with get_datasheet_page before copying a number into a part spec.

| Argument | Type | What |
|---|---|---|
| `query` * | string | Words to find, all must match (for example: peak current threshold) |
| `mpn` | string | Limit to a part number |
| `limit` | number | 1-20, default 8 |

## get_datasheet_page

Text of one datasheet page (tables in layout form). Cite part, revision and page.

| Argument | Type | What |
|---|---|---|
| `mpn` * | string |  |
| `page` * | number |  |

## get_datasheet_pdf

A download link to a stored datasheet's original PDF, by id (list_datasheets) or part number: works for 15 minutes and a few downloads, no sign-in (the link is the credential, so do not post it publicly). Company accounts.

| Argument | Type | What |
|---|---|---|
| `id` | number |  |
| `mpn` | string | Part number, when no id is given (the newest document that names it) |

## import_datasheet

Admins: add a manufacturer datasheet PDF to the library (original kept in the portal's storage, every page's text searchable with search_datasheets / get_datasheet_page). Source: url (the maker's https PDF, e.g. ti.com/lit/ds/symlink/<part>.pdf), or project + asset (a PDF uploaded with create_asset_upload, for makers that refuse automated downloads). mpns: every orderable part number the document covers. revision: as printed on the document. Re-importing the same PDF replaces its pages; a changed PDF becomes a new document, so old revisions stay. Text comes from the PDF itself (no OCR): the reply warns when most pages are images. Takes up to a few minutes for a large PDF.

| Argument | Type | What |
|---|---|---|
| `url` | string |  |
| `project` | string | With asset: the project holding the uploaded PDF |
| `asset` | string | Asset id from list_assets / create_asset_upload |
| `mpns` * | array of string |  |
| `manufacturer` * | string |  |
| `title` | string |  |
| `revision` | string |  |
| `source_url` | string | Where the PDF came from, when it was uploaded |
| `note` | string |  |

## delete_datasheet

Admins: remove one datasheet from the library (row, page texts, search index and the PDF) by id from list_datasheets. Part specs that cite it keep their citation text. Asks for confirm: true.

| Argument | Type | What |
|---|---|---|
| `id` * | number |  |
| `confirm` | boolean |  |

## delete_part_spec

Remove a part spec. Circuits using that part then lose their analysis for it.

| Argument | Type | What |
|---|---|---|
| `mpn` * | string |  |
