electrical-calc
Electrical arithmetic and resistor colour codes — Computes Ohm's law and power from any two of V, I, R, P; series and parallel resistance with optional tolerance bounds; a voltage divider (with optional load); an LED series resistor rounded up to a preferred E-series value; conductor voltage drop from a caller-supplied resistivity; decodes or encodes 3 to 6 band IEC 60062 resistor colour codes; and tests whether a value is an official E3 to E192
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": {
"op": "<op>"
},
"name": "electrical-calc"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | ohm | series | parallel | divider | led-resistor | line-drop | colour-decode | colour-encode | e-series. | |
| r1 | No | divider: top resistor, ohms. | |
| r2 | No | divider: bottom resistor, ohms. | |
| vin | No | divider: input volts. | |
| bands | No | colour-decode: 3 to 6 colours read from the head end. | |
| claim | No | Optional map from an output value name (e.g. resistance, vout, minResistance) to the number you expect. | |
| power | No | ohm: watts. | |
| rLoad | No | divider: optional load across r2, ohms. | |
| series | No | led-resistor (default E24) and e-series: preferred-value series. | |
| tcrPpm | No | colour-encode with 6 bands: temperature coefficient in ppm/K. | |
| areaMm2 | No | line-drop: conductor cross-section in mm^2. | |
| current | No | ohm, led-resistor, line-drop: amperes. | |
| lengthM | No | line-drop: one-way length in metres. | |
| voltage | No | ohm: volts. | |
| bandCount | No | colour-encode: 3, 4 (default), 5 or 6 bands. 5 and 6 bands carry three digits. | |
| roundTrip | No | line-drop: count out and return conductors (default true). | |
| resistance | No | ohm: ohms. colour-encode and e-series: the value in ohms. | |
| resistances | No | series/parallel: ohms, at most 100. | |
| tolerancePct | No | series/parallel: shared tolerance percent for min/max bounds. colour-encode: tolerance percent to encode. | |
| supplyVoltage | No | led-resistor: supply volts. line-drop: optional, enables dropPercent. | |
| forwardVoltage | No | led-resistor: LED forward volts. | |
| maxDropPercent | No | line-drop: fail when the drop exceeds this percent of supplyVoltage. | |
| resistivityOhmM | No | line-drop: conductor resistivity in ohm-metres, supplied by the caller (not looked up). | |
| claimTolerancePct | No | Relative tolerance for claim values, percent (default 0: exact). |