project_update_part
Change a project part's MPN, base part, category, manufacturer, distributor, or pinned document in place, then write the confirmed change to the CAD BOM and check the project.
Instructions
Change a part of the user project in place: its MPN, base part, category, manufacturer, preferred distributor, or a pinned document. A new manufacturer must agree with the datasheet of the part (as project_add_part). A file of the folder with the content of a document is a copy of sync when it is in the subfolder of the layout of its part, else it is pinned: project_sync tells it for each new reference, and pin_document or unpin_document changes it. The part keeps its place in datasheet-lens.toml and its copies (project_remove_part and project_add_part would delete and copy them again). Then project_sync moves a copy when the layout gives it a different subfolder. The CAD BOM is the master: write the change that the user confirmed into the CAD project too (MPN, MPN_Confirmed, Value_Confirmed, LCSC, Manufacturer, Distributor; kicad-workbench: set_symbol_fields), then project_check. Gives each changed field with its old and new value, then the part and its documents.
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": {
"mpn": "<mpn>"
},
"name": "project_update_part"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mpn | Yes | The MPN of the project part now. | |
| base | No | The base part of the datasheet, for example TMP112D. Empty: no change. | |
| 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. | |
| new_mpn | No | The new MPN, for example the concrete orderable MPN TMP112D0IDPWR in place of TMP112D0. Empty: no change. | |
| category | No | The function of the part. None: no change; an empty text removes it. | |
| distributor | No | The preferred distributor of the part that the user selected or gave (DigiKey, Mouser, LCSC, an other name), or N/A for none. The field Distributor of the CAD project gets it. Empty: no change. | |
| manufacturer | No | The manufacturer, any of its names (TI or Texas Instruments: the store knows the names of one manufacturer). Necessary only when two parts have the same MPN. With a datasheet, the tool reads the manufacturer from it: a given name must be a name of the same manufacturer. | |
| pin_document | No | A document of the part (its reference, a SHA-256 prefix, its document ID or its file name) to pin: project_sync does not move its file, and project_remove_part keeps it. Empty: no change. | |
| unpin_document | No | A document of the part to unpin: project_sync manages its file as a copy (it moves it to the subfolder of the layout, and a removal deletes it). Empty: no change. | |
| new_manufacturer | No | The new manufacturer, any name of the manufacturer of the part in the store (TI or Texas Instruments). The project file and its layout use this name. Empty: no change. | |
| manufacturer_confirmed | No | True when the user read page 1 of the datasheet and confirms the given manufacturer, for example the maker of a module whose datasheet names the maker of its chip more often: the tool does not compare it with the text of the PDF. Give it only when the user confirms it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |