Skip to main content
Glama

export_bom

Exports the bill of materials from a KiCad schematic as a table or CSV, with optional grouping, variant handling, and DNP exclusion.

Instructions

Give the bill of materials (BOM) of a schematic, as KiCad makes it.

The tool runs "kicad-cli sch export bom" for the full project of the schematic, and gives its lines as a table. Without group_by, each reference is one line. KiCad does not put the power symbols and the symbols that are excluded from the BOM into the BOM.

The units of one package (one reference, U1A and U1B) must have the same Value, MPN, Value_Confirmed and MPN_Confirmed. When they do not, the output starts with an error of the design: the BOM line of the package joins the values, and the joined MPNs look like an MPN and its alternative. Tell the user, and correct the fields in KiCad.

For project_check of datasheet-lens, give output_path and no group_by. Then give the path of the CSV file to project_check (argument bom). For a project with variants (KiCad 10), also give all_variants: then give the list of the files that the tool names to project_check.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "schematic_path": "<schematic_path>"
    },
    "name": "export_bom"
  }
}

Input Schema

NameRequiredDescriptionDefault
fieldsNoThe fields of the BOM, in their order. "*" adds all other fields. A generated field has the form "${QUANTITY}" or "${DNP}". Default: Reference, Value, Footprint, Datasheet, ${QUANTITY}, ${DNP} and "*".
variantNoThe name of a variant of the project (KiCad 10 and later). Empty: the default variant.
group_byNoThe fields whose equal values put symbols into one line. Each name must be an item of fields: a field that "*" adds does not group the symbols. Default: no groups.
exclude_dnpNoTrue to remove the symbols that have DNP.
output_pathNoThe CSV file to write, as kicad-cli writes it. A relative path is relative to the project directory. The tool does not expand variables. The tool replaces an existing file. Empty: the tool keeps no file.
all_variantsNoTrue to export the default variant and each variant of the project (KiCad 10 and later), one kicad-cli run and one CSV file for each: the default variant into output_path, the variant X into <stem>-X<suffix> next to it (bom.csv: bom-X.csv). It needs output_path, and gives no tables. Not with variant.
schematic_pathYesA .kicad_sch file of the project. The BOM is the BOM of the full project, also for a sub-sheet.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full disclosure burden and does so well: it states the tool shells out to kicad-cli, that power symbols and BOM-excluded symbols are omitted, that output_path replaces an existing file, that variables are not expanded, and that all_variants produces no tables and is incompatible with variant. It also explains the design-error case where package units disagree on Value/MPN and warns the user to fix the fields.

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

Conciseness5/5

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

The core behavior is front-loaded in the first two sentences, followed by the error condition and then the workflow recipe. Despite its length, every paragraph conveys distinct operational information, and no sentence merely restates the schema or title.

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

Completeness5/5

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

For a seven-parameter export tool with an output schema, the description covers the important gaps: error output when package units disagree, CSV file side effects, and multi-variant behavior. An agent has what it needs to both invoke the tool and hand its output to project_check.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description still adds value by explaining that without group_by each reference is one line, that group_by fields must be items of fields, and that output_path is relative to the project directory and overwrites files. The invariant that all units of a package must share Value/MPN is meaning the schema does not convey.

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

Purpose4/5

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

The description gives a specific verb and resource ('Give the bill of materials (BOM) of a schematic') and names the exact underlying command (kicad-cli sch export bom), so the operation is unambiguous. It does not explicitly name sibling tools such as generate_netlist, but the resource is distinct enough that no confusion is likely.

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

Usage Guidelines4/5

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

It supplies a concrete usage recipe: for project_check of datasheet-lens, give output_path and no group_by, then pass the resulting CSV path to project_check via the bom argument, and add all_variants for KiCad 10 projects. There is no explicit when-not guidance or statement of alternatives among the export_* siblings, but the workflow conditions are clear.

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