Library and Template Tools
mcltspice ships 7 tools for browsing LTspice’s component library, searching SPICE model and subcircuit definitions, managing circuit templates, and verifying your installation. These tools never modify anything on disk --- they are read-only queries against the LTspice library files.
list_templates
Section titled “list_templates”List all available circuit templates with their parameters and default values.
| Parameter | Type | Default | Description |
|---|---|---|---|
| No parameters. | |||
Returns: dict with templates (list of name, description, and params for each) and total_count.
// Example response{ "templates": [ { "name": "rc_lowpass", "description": "RC low-pass filter, fc ~ 1.59 kHz", "params": { "r": "1k", "c": "100n", "f_start": "1", "f_stop": "1meg" } }, { "name": "voltage_divider", "description": "Resistive voltage divider", "params": { "v_in": "5", "r1": "10k", "r2": "10k", "sim_type": "dc" } } ], "total_count": 15}list_symbols
Section titled “list_symbols”Browse LTspice’s 6500+ component symbols. Filter by category or search by name.
| Parameter | Type | Default | Description |
|---|---|---|---|
| category | str | None | None | Filter by category folder (e.g. “Opamps”, “Comparators”, “Misc”). |
| search | str | None | None | Case-insensitive search term matched against symbol name. |
| limit | int | 50 | Maximum number of results to return. |
Returns: dict with symbols (list of name, category, path), total_count, and returned_count.
// Example response (search='LT1'){ "symbols": [ { "name": "LT1001", "category": "Opamps", "path": "/home/user/ltspice/lib/sym/Opamps/LT1001.asy" }, { "name": "LT1006", "category": "Opamps", "path": "/home/user/ltspice/lib/sym/Opamps/LT1006.asy" }, { "name": "LT1010", "category": "Misc", "path": "/home/user/ltspice/lib/sym/Misc/LT1010.asy" } ], "total_count": 342, "returned_count": 50}list_examples
Section titled “list_examples”Browse 4000+ example circuits from the LTspice installation. Filter by category folder or search by name.
| Parameter | Type | Default | Description |
|---|---|---|---|
| category | str | None | None | Filter by category folder name. |
| search | str | None | None | Case-insensitive search term matched against example name. |
| limit | int | 50 | Maximum number of results to return. |
Returns: dict with examples (list of name, category, path), total_count, and returned_count.
// Example response (search='buck'){ "examples": [ { "name": "Buck", "category": "Educational", "path": "/home/user/ltspice/examples/Educational/Buck.asc" }, { "name": "LT3800_Buck", "category": "jigs", "path": "/home/user/ltspice/examples/jigs/LT3800_Buck.asc" } ], "total_count": 37, "returned_count": 37}get_symbol_info
Section titled “get_symbol_info”Get pin names, attributes, and description from a .asy symbol file.
| Parameter | Type | Default | Description |
|---|---|---|---|
| symbol_path | str | required | Absolute path to a .asy symbol file. |
Returns: dict with name, pins (list of pin names), attributes (key-value pairs), description, prefix, and spice_prefix.
// Example response{ "name": "LT1001", "pins": ["IN+", "IN-", "V+", "V-", "OUT"], "attributes": { "Prefix": "X", "SpiceModel": "LT1001", "Value": "LT1001" }, "description": "Low Offset, Low Drift Op Amp", "prefix": "X", "spice_prefix": "X"}search_spice_models
Section titled “search_spice_models”Search .model definitions in the LTspice library. These are discrete devices: transistors, diodes, JFETs.
| Parameter | Type | Default | Description |
|---|---|---|---|
| search | str | None | None | Case-insensitive search term for model name. |
| model_type | str | None | None | Filter by type: NPN, PNP, NMOS, PMOS, D, NJF, PJF. |
| limit | int | 50 | Maximum number of results. |
Returns: dict with models (list of name, type, source_file, parameters) and total_count.
// Example response (model_type='NPN', search='2N'){ "models": [ { "name": "2N2222", "type": "NPN", "source_file": "standard.bjt", "parameters": "Is=14.34f Xti=3 Eg=1.11 Vaf=74.03 ..." } ], "total_count": 18}search_spice_subcircuits
Section titled “search_spice_subcircuits”Search .subckt definitions in the library. These are complex components like op-amps, voltage regulators, and other ICs.
| Parameter | Type | Default | Description |
|---|---|---|---|
| search | str | None | None | Case-insensitive search term for subcircuit name. |
| limit | int | 50 | Maximum number of results. |
Returns: dict with subcircuits (list of name, pins, pin_names, description, source_file, n_components) and total_count.
// Example response (search='LT1'){ "subcircuits": [ { "name": "LT1001", "pins": 5, "pin_names": ["1", "2", "3", "4", "5"], "description": "Low Offset, Low Drift Op Amp", "source_file": "LT1001.sub", "n_components": 42 } ], "total_count": 156}check_installation
Section titled “check_installation”Verify that LTspice and Wine are properly installed and accessible.
| Parameter | Type | Default | Description |
|---|---|---|---|
| No parameters. | |||
Returns: dict with valid (boolean), message, paths (ltspice_dir, ltspice_exe, wine_prefix, lib_dir, examples_dir), lib_exists, and examples_exist.
// Example response (healthy installation){ "valid": true, "message": "LTspice installation OK", "paths": { "ltspice_dir": "/home/user/ltspice/extracted/ltspice", "ltspice_exe": "/home/user/ltspice/extracted/ltspice/XVIIx64.exe", "wine_prefix": "/home/user/ltspice/extracted/ltspice/.wine", "lib_dir": "/home/user/ltspice/extracted/ltspice/lib", "examples_dir": "/home/user/ltspice/extracted/ltspice/examples" }, "lib_exists": true, "examples_exist": true}If valid is false, the message field explains what is missing and how to fix it. See Prerequisites for setup instructions.