project_check
Compare a CAD project's symbols or BOM against its project file to flag missing datasheets, unconfirmed MPNs, conflicts, and folder mismatches before sync and availability checks.
Instructions
Compare the project file with the parts of the CAD project, so that the two hold the same parts. Each part with an MPN needs its datasheet, also an alternative in MPN. The convention: Value holds the general value ("2N7002", "100nF 10V"), the field MPN the MPNs ("2N7002LT1G, BSS138LT1G"), and the hidden fields Value_Confirmed and MPN_Confirmed the copies of the last confirmation. The confirmation of the user is the truth: until it, the confirmed MPNs are the parts. With bom, one line for each BOM file gives the columns that the tool read. Then the result gives these lines:
conflict: the fields or the columns of one symbol do not agree.
change in the CAD project: MPN is not MPN_Confirmed, or Value is not Value_Confirmed. Add the datasheet of a new MPN at once; tell the user; write the given fields only when the user confirms it.
not confirmed: the fields are not confirmed yet.
the old convention: the MPNs are in the parentheses of Value (or only of Value_Confirmed). Write the given fields (the move); the confirmed state and the parts do not change.
no field Value_Confirmed or MPN_Confirmed, no part selected (a general value and no MPN).
CAD lines with a part, the symbols that are not fitted (DNP: their parts stay parts of the project), the number of the same parts, and one line for each part that is different (one part with two MPNs), missing (with the documents of the store or the Datasheet field, and the next call) or extra.
project folder: the folder does not agree with the project file and the store (new references, missing copies, copies to move, files of the inbox to take): run project_sync; project_status gives the files.
project folder (a second line): the files that need a step of the user, because project_sync cannot do it (files of the folder or of the inbox with no part, changed copies, documents that the store does not have): tell the user.
next steps: when the two hold the same parts and no symbol needs a step of the user: project_sync (when the folder needs it), then project_availability. A JLCPCB (LCSC) finding of a symbol that is not fitted (DNP) is information for the user, not a step. A message of an other variant names it. A message names the fields to write by the columns of the BOM (the BOM must name its columns as the fields of the symbols: export_bom of kicad-workbench does), or by mpn_fields of the parts; when the field is not known, it names the choices and tells you to ask the user. In KiCad, write the fields with set_symbol_fields of the MCP server kicad-workbench. When the store is connected to a team server, it gets the rows of the server first: a datasheet that a different person added is not missing. In a project that uses JLCPCB (a JLCPCB purchase source, or an LCSC field), the lines "LCSC:" compare the JLCPCB number of each symbol (the LCSC column of the BOM, or lcsc of the parts) with the purchase source and with the JLCPCB parts library. The lines "Manufacturer:" and "Distributor:" compare the fields Manufacturer (the manufacturers of the MPNs of the field MPN, in their order) and Distributor (the preferred distributor of the fitted part) with the project: write the given fields, and ask the user where a line tells it. It changes nothing in the project.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "project_check"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bom | No | The path of a BOM file (CSV) of the full CAD project, or a list of paths: one BOM file for each variant of the product, the default variant first (the tool takes the parts of all files, and checks the confirmed fields in each file; a message of an other variant names its file). One line for each symbol: for example the CSV file of 'kicad-cli sch export bom' (the MCP server kicad-workbench writes it with export_bom and output_path). A .csv, .tsv or .txt file: an absolute path, or a path relative to the project folder (the folder of datasheet-lens.toml). The tool finds the columns by their names (MPN, Value, Reference, Datasheet, DNP); a line with DNP is not fitted, and its parts stay parts of the project. Give parts or bom, not the two. | |
| path | No | A folder of the user project (default: the working folder of the server). The project file datasheet-lens.toml is in it or in a parent folder. | |
| parts | No | The parts of the CAD project, from the CAD tool (for example its MCP server). One item for each symbol or BOM line, with its MPN and Value fields as they are; give each part, not only the new ones. A general value with no MPN has no selected part. Give parts or bom, not the two. | |
| bom_quote | No | The quote character of the BOM file: '"' (CSV, Excel, kicad-cli and export_bom), "'" (the Semicolons preset of KiCad) or 'none' (the TSV preset of KiCad). Empty: '"'. | |
| bom_column | No | The column of the MPN in the BOM file. Empty: each column with a usual MPN name (MPN, Manufacturer Part Number, MP ...). The tool always reads the Value column too. | |
| bom_delimiter | No | The delimiter of the BOM file: a text or 'tab'. Empty: the one of , ; tab | that splits the header line. Give it when the tool asks for it. | |
| bom_confirmed_column | No | The column of the field Value_Confirmed in the BOM file, for example an unused custom column of the BOM of an other CAD tool. Empty: Value_Confirmed. | |
| bom_mpn_confirmed_column | No | The column of the field MPN_Confirmed in the BOM file, for example an unused custom column of the BOM of an other CAD tool. Empty: MPN_Confirmed. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |