Review a BOM locally
Give your existing agent a bill of materials and a clear mapping. CLI 0.6.14 reads the export locally, preserves source values and produces questions about missing engineering context. No account or API key is needed.
Try it now
Section titled “Try it now”After installing the CLI, download these synthetic examples into a new working directory:
curl -fSLo bom.csv https://trymaglev.com/docs/examples/bom-review/bom.csvcurl -fSLo mapping.json https://trymaglev.com/docs/examples/bom-review/mapping.jsonmaglev context review-bom bom.csv --mapping mapping.json --jsonThe example returns ready_for_brief_review, three rows and one do_not_populate part. It preserves part 000123, cable consumption 0.35 m per product, and revision B. purchaseQuantity remains null: this command does not calculate a purchase order or multiply quantities by a build size.
After reviewing the source, use Calculate purchase quantities for explicit assembly relationships, current-batch totals and declared yield/package allowances. It creates a separate calculation and preserves this original report.
You can save the output to a new path with > bom-review.json. Never redirect onto the source BOM or mapping file: your shell would overwrite it before the command runs. The report contains engineering content; review it before sharing it.
Ask your agent:
Review this BOM report and the released drawings. Keep source references with every requirement. Resolve its questions before preparing an RFQ. Quality comes first; no substitutions or supplier contact are authorized yet.
Map your export
Section titled “Map your export”The first record must contain distinct, nonempty headers. Map exact header names; the CLI does not guess column meaning or use a description as a manufacturer part number.
{ "delimiter": ",", "columns": { "partNumber": "Internal part", "quantity": "Qty", "unit": "Unit", "revision": "Part revision" }, "declarations": { "quantityBasis": "per_product", "configuration": "pilot", "population": "populate", "scope": "complete" }}Only make declarations you can confirm. A declaration applies to every record and is marked user_declaration; it is not extracted evidence or an independent check of the released design. A mapped column and a declaration for the same field cannot both be supplied.
| Setting | Accepted values and meaning |
|---|---|
delimiter |
CSV/TSV only: ",", ";" or "\t" for tab-separated data |
decimalSeparator |
"." by default; explicitly choose "," for decimal-comma exports |
columns.partNumber, columns.quantity |
Required exact header names; part identity is always text |
Other columns |
unit, quantityBasis, revision, configuration, population, parent, manufacturerPartNumber, description |
declarations |
Optional unit, quantityBasis, revision, configuration, population, scope |
| Quantity basis | per_product, per_parent or build_total; per-parent quantities also need a parent column |
| Population | populate or do_not_populate; map other source values explicitly with populationValues |
| Scope | complete, partial, filtered or unknown; absent scope is unknown |
For a DNP column containing true and false, use "population": "DNP" in columns and this top-level setting:
{ "populationValues": { "true": "do_not_populate", "false": "populate" }}This is a mapping fragment, not a complete configuration. Matching is exact, including case and whitespace. DNP rows stay in the report; they are not removed from the design or included in a purchase calculation.
Read an Excel workbook
Section titled “Read an Excel workbook”First list the actual worksheet names; this never chooses one silently:
maglev context inspect-bom ./bom.xlsx --jsonmaglev context review-bom ./bom.xlsx --mapping ./xlsx-mapping.json --jsonFor XLSX, replace delimiter with an exact worksheet and a one-based headerRow. The selected header cells must be literal text with distinct names. For example:
{ "worksheet": "Assembly BOM", "headerRow": 3, "columns": { "partNumber": "Part", "quantity": "Qty" }}This minimal mapping leaves units, revision, population, configuration and quantity basis unresolved. Add columns or declarations only when supported by your actual design. Nothing on preceding rows or other worksheets becomes a requirement; the report identifies that excluded scope.
- Text identifiers such as
000123stay exact. Numeric cell XML values are preserved as strings; Maglev does not recreate Excel’s displayed rounding or formatting. Numeric identifiers require clarification because Excel may already have removed leading zeros or rounded them. - Formula cells retain their formula and cached value as evidence. Caches are never used as requirements; formulas and external links are not evaluated. Export reviewed literal values when appropriate.
- General and basic numeric quantity cells use their stored decimal point independently of
decimalSeparator; literal text quantities use the declared separator. Dates, percentages, custom formats and other ambiguous typed values produce questions rather than quantities. - Hidden rows remain in the report. Hidden columns/sheets, filters and merges raise scope questions. Merged cells are not copied or filled down. Sparse cells stay blank.
- Evidence includes the workbook hash, worksheet, row, cell address, stored value, type and number format. XLSX evidence does not invent text line numbers.
usableAsRequirement: falsekeeps ambiguous cells out of folder-derived requirements.
The folder reviewer accepts this same mapping under an exact .xlsx path in bomMappings.
Use your connected agent
Section titled “Use your connected agent”MCP 0.2.14 includes inspect_local_bom and review_local_bom. Both operate only inside the canonical project directory configured by the host as MAGLEV_TRANSFER_ROOT. They need no API key and make no network request. Pass a relative path and the same mapping object. Setup configures this root; tools cannot select a broader one.
These tools return file content to your existing agent. Your host/model’s own data handling still applies. “Local only” means Maglev’s connector does not upload the file or call an API; it does not promise your chosen model runs locally.
Read the result
Section titled “Read the result”artifact.sha256identifies the original BOM bytes, including any UTF-8 byte-order mark. Changed bytes at the same path produce different evidence.mappingSha256identifies the parsed mapping serialized as JSON, not the original mapping file bytes. Changes to declarations are visible separately from changes to the BOM.headersand each row’scellsretain all decoded cell values. CSV quote escaping is decoded; the original file remains unchanged.- Each mapped field includes its
rawvalue and source record/column or user declaration. Logical record numbers include the header as record 1; a quoted multiline cell remains in one record.startLineandendLineidentify physical lines separately. interpreted.quantityDecimalis an exact decimal string, never a floating-point number. The decimal separator may be normalized whilerawremains unchanged. Missing, zero, negative, grouped, exponent, formula or unit-suffixed quantities produce a question rather than a default.issuescarries focused questions and available source references. Unmapped columns are retained and flagged for review; their contents are not interpreted as instructions.needs_clarificationmeans the export was read, but questions remain. A successfully produced report exits with code 0 even in this state; scripts must inspectstatusandissues.ready_for_brief_reviewmeans the implemented checks found no issues. It does not establish production readiness, supplier suitability, released revision authority or permission to spend/share files.productionApprovedis alwaysfalse.
Repeated part identifiers remain separate. Different revisions produce a conflict question; other repetitions require review before combining quantities. This command does not choose a configuration, expand parent/child quantities, evaluate substitutions, parse drawings, interpret arbitrary notes or calculate purchase totals.
Formats and limits
Section titled “Formats and limits”Supported: UTF-8 .csv/.tsv and a bounded, read-only subset of standard transitional SpreadsheetML .xlsx. CSV/TSV supports an optional UTF-8 BOM, comma/semicolon/tab delimiters, quoted fields, doubled quotes and embedded newlines. Legacy .xls, macro-enabled workbooks, encrypted files, chartsheets and strict OOXML namespaces are not supported. Export a plain XLSX or reviewed CSV/TSV through your engineering tools. Native CAD and PDFs are not interpreted.
Limits: 2 MiB per BOM, 5,000 data records, 128 columns, 64 KiB per cell, and 256 characters per header. Mapping JSON uses the CLI’s separate 64 KiB input limit. Headers must be unique and all records must have the same width. Stray quotes, characters after a closing quote, malformed UTF-8, NUL bytes, non-file inputs and BOM symlinks are rejected. A parse or limit failure exits with an error and returns no partial success report. Credential-like input is refused so global credential redaction cannot silently change a source value.
XLSX additionally allows at most 16 MiB expanded, 8 MiB per archive part, 256 entries, 32 worksheets, 100,000 cells and header rows 1–1,000. At most 5,000 rows after the header can contain data. Corrupt CRCs, inconsistent archives, path traversal, macros, embedded objects, XML entities and structural limits fail without partial review. MCP reports are limited to 2 MiB; use a smaller selected export if exceeded.
The commands never upload files or call the API. For the later handoff, see prepare engineering files and from files to a quote request.