feat: datasheet tools + fix missing delete_schematic_component
New tools - datasheet: - get_datasheet_url: construct LCSC datasheet PDF URL + product page URL without any API key (URL schema: https://www.lcsc.com/datasheet/<C#>.pdf) - enrich_datasheets: scan .kicad_sch, write LCSC datasheet URL into every symbol that has an LCSC property but an empty Datasheet field; supports dry_run=true for preview; text-based implementation (no skip writes) Implementation: python/commands/datasheet_manager.py New tool - schematic: - delete_schematic_component: remove a placed symbol from a .kicad_sch file by reference designator (e.g. R1, U3) Bug fix - delete_schematic_component (two separate root causes): 1. No MCP tool named delete_schematic_component was registered at all. Any delete-symbol request fell through to the PCB-only delete_component tool which searches pcbnew.BOARD and always returned 'Component not found' for schematic symbols. 2. component_schematic.py::remove_component() still used skip for writes. PR #40 rewrote DynamicSymbolLoader (add path) to avoid skip-induced schematic corruption, but the delete path was not touched by that PR. Fix: _handle_delete_schematic_component in kicad_interface.py uses direct text manipulation with parenthesis-depth tracking (same technique as PR #40), bypassing component_schematic.py entirely. Error message explicitly guides users: 'use delete_component for PCB footprints'. Files changed: - python/commands/datasheet_manager.py (new) - src/tools/datasheet.ts (new) - python/kicad_interface.py: 3 new handlers + dispatch entries - src/tools/schematic.ts: delete_schematic_component tool - src/server.ts: registerDatasheetTools import + call - src/tools/index.ts: export registerDatasheetTools - CHANGELOG.md: document all above
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
/**
|
||||
* Tools index for KiCAD MCP server
|
||||
*
|
||||
* Exports all tool registration functions
|
||||
*/
|
||||
|
||||
export { registerProjectTools } from './project.js';
|
||||
export { registerBoardTools } from './board.js';
|
||||
export { registerComponentTools } from './component.js';
|
||||
export { registerRoutingTools } from './routing.js';
|
||||
export { registerDesignRuleTools } from './design-rules.js';
|
||||
export { registerExportTools } from './export.js';
|
||||
export { registerSchematicTools } from './schematic.js';
|
||||
export { registerLibraryTools } from './library.js';
|
||||
export { registerUITools } from './ui.js';
|
||||
/**
|
||||
* Tools index for KiCAD MCP server
|
||||
*
|
||||
* Exports all tool registration functions
|
||||
*/
|
||||
|
||||
export { registerProjectTools } from "./project.js";
|
||||
export { registerBoardTools } from "./board.js";
|
||||
export { registerComponentTools } from "./component.js";
|
||||
export { registerRoutingTools } from "./routing.js";
|
||||
export { registerDesignRuleTools } from "./design-rules.js";
|
||||
export { registerExportTools } from "./export.js";
|
||||
export { registerSchematicTools } from "./schematic.js";
|
||||
export { registerLibraryTools } from "./library.js";
|
||||
export { registerUITools } from "./ui.js";
|
||||
export { registerDatasheetTools } from "./datasheet.js";
|
||||
|
||||
Reference in New Issue
Block a user