Skip to content

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 all available circuit templates with their parameters and default values.

ParameterTypeDefaultDescription
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
}

Browse LTspice’s 6500+ component symbols. Filter by category or search by name.

ParameterTypeDefaultDescription
categorystr | NoneNoneFilter by category folder (e.g. “Opamps”, “Comparators”, “Misc”).
searchstr | NoneNoneCase-insensitive search term matched against symbol name.
limitint50Maximum 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
}

Browse 4000+ example circuits from the LTspice installation. Filter by category folder or search by name.

ParameterTypeDefaultDescription
categorystr | NoneNoneFilter by category folder name.
searchstr | NoneNoneCase-insensitive search term matched against example name.
limitint50Maximum 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 pin names, attributes, and description from a .asy symbol file.

ParameterTypeDefaultDescription
symbol_pathstrrequiredAbsolute 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 .model definitions in the LTspice library. These are discrete devices: transistors, diodes, JFETs.

ParameterTypeDefaultDescription
searchstr | NoneNoneCase-insensitive search term for model name.
model_typestr | NoneNoneFilter by type: NPN, PNP, NMOS, PMOS, D, NJF, PJF.
limitint50Maximum 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 .subckt definitions in the library. These are complex components like op-amps, voltage regulators, and other ICs.

ParameterTypeDefaultDescription
searchstr | NoneNoneCase-insensitive search term for subcircuit name.
limitint50Maximum 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
}

Verify that LTspice and Wine are properly installed and accessible.

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