Skip to content

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.

After installing the CLI, download these synthetic examples into a new working directory:

Terminal window
curl -fSLo bom.csv https://trymaglev.com/docs/examples/bom-review/bom.csv
curl -fSLo mapping.json https://trymaglev.com/docs/examples/bom-review/mapping.json
maglev context review-bom bom.csv --mapping mapping.json --json

The 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.

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.

First list the actual worksheet names; this never chooses one silently:

Terminal window
maglev context inspect-bom ./bom.xlsx --json
maglev context review-bom ./bom.xlsx --mapping ./xlsx-mapping.json --json

For 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 000123 stay 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: false keeps ambiguous cells out of folder-derived requirements.

The folder reviewer accepts this same mapping under an exact .xlsx path in bomMappings.

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.

  • artifact.sha256 identifies the original BOM bytes, including any UTF-8 byte-order mark. Changed bytes at the same path produce different evidence.
  • mappingSha256 identifies the parsed mapping serialized as JSON, not the original mapping file bytes. Changes to declarations are visible separately from changes to the BOM.
  • headers and each row’s cells retain all decoded cell values. CSV quote escaping is decoded; the original file remains unchanged.
  • Each mapped field includes its raw value and source record/column or user declaration. Logical record numbers include the header as record 1; a quoted multiline cell remains in one record. startLine and endLine identify physical lines separately.
  • interpreted.quantityDecimal is an exact decimal string, never a floating-point number. The decimal separator may be normalized while raw remains unchanged. Missing, zero, negative, grouped, exponent, formula or unit-suffixed quantities produce a question rather than a default.
  • issues carries focused questions and available source references. Unmapped columns are retained and flagged for review; their contents are not interpreted as instructions.
  • needs_clarification means the export was read, but questions remain. A successfully produced report exits with code 0 even in this state; scripts must inspect status and issues.
  • ready_for_brief_review means the implemented checks found no issues. It does not establish production readiness, supplier suitability, released revision authority or permission to spend/share files. productionApproved is always false.

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.

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.