{"id":"electrical-calc","title":"Electrical arithmetic and resistor colour codes","description":"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 value. For engineers and agents checking a circuit number before acting on it. It does not simulate AC, reactive or non-linear circuits, choose a part by power rating or look up a material's resistivity. Exact decimal arithmetic. An optional claim map (output name to number, with a percent tolerance) turns it into a pass/fail check.","roi":"Exact decimal circuit arithmetic and colour-code decoding for one $0.005 call; no LLM arithmetic drift.","audience":"business","package":"physical-ops-kit","channels":["x402","mcp"],"endpoint":{"method":"POST","url":"https://agents.writerslogic.com/api/v1/electrical-calc","path":"/api/v1/electrical-calc","contentType":"application/json"},"price":{"amount":"0.005","currency":"USDC","network":"base","perCall":true,"failedCallsCharged":false},"inputSchema":{"type":"object","additionalProperties":false,"required":["op"],"properties":{"op":{"type":"string","enum":["ohm","series","parallel","divider","led-resistor","line-drop","colour-decode","colour-encode","e-series"],"description":"ohm | series | parallel | divider | led-resistor | line-drop | colour-decode | colour-encode | e-series."},"voltage":{"type":"number","description":"ohm: volts.","minimum":-1000000000000000,"maximum":1000000000000000},"current":{"type":"number","description":"ohm, led-resistor, line-drop: amperes.","minimum":-1000000000000000,"maximum":1000000000000000},"resistance":{"type":"number","description":"ohm: ohms. colour-encode and e-series: the value in ohms.","minimum":-1000000000000000,"maximum":1000000000000000},"power":{"type":"number","description":"ohm: watts.","minimum":-1000000000000000,"maximum":1000000000000000},"resistances":{"type":"array","items":{"type":"number","description":"number","minimum":-1000000000000000,"maximum":1000000000000000},"maxItems":100,"description":"series/parallel: ohms, at most 100."},"tolerancePct":{"type":"number","description":"series/parallel: shared tolerance percent for min/max bounds. colour-encode: tolerance percent to encode.","minimum":0,"maximum":100},"vin":{"type":"number","description":"divider: input volts.","minimum":-1000000000000000,"maximum":1000000000000000},"r1":{"type":"number","description":"divider: top resistor, ohms.","minimum":-1000000000000000,"maximum":1000000000000000},"r2":{"type":"number","description":"divider: bottom resistor, ohms.","minimum":-1000000000000000,"maximum":1000000000000000},"rLoad":{"type":"number","description":"divider: optional load across r2, ohms.","minimum":-1000000000000000,"maximum":1000000000000000},"supplyVoltage":{"type":"number","description":"led-resistor: supply volts. line-drop: optional, enables dropPercent.","minimum":-1000000000000000,"maximum":1000000000000000},"forwardVoltage":{"type":"number","description":"led-resistor: LED forward volts.","minimum":-1000000000000000,"maximum":1000000000000000},"series":{"type":"string","enum":["E3","E6","E12","E24","E48","E96","E192"],"description":"led-resistor (default E24) and e-series: preferred-value series."},"lengthM":{"type":"number","description":"line-drop: one-way length in metres.","minimum":0,"maximum":1000000000000000},"areaMm2":{"type":"number","description":"line-drop: conductor cross-section in mm^2.","minimum":0,"maximum":1000000000000000},"resistivityOhmM":{"type":"number","description":"line-drop: conductor resistivity in ohm-metres, supplied by the caller (not looked up).","minimum":0,"maximum":1},"roundTrip":{"type":"boolean","description":"line-drop: count out and return conductors (default true)."},"maxDropPercent":{"type":"number","description":"line-drop: fail when the drop exceeds this percent of supplyVoltage.","minimum":0,"maximum":100},"bands":{"type":"array","items":{"type":"string","maxLength":12,"description":"Colour name, head end first (IEC 60062 table)."},"maxItems":6,"minItems":3,"description":"colour-decode: 3 to 6 colours read from the head end."},"bandCount":{"type":"integer","minimum":3,"maximum":6,"description":"colour-encode: 3, 4 (default), 5 or 6 bands. 5 and 6 bands carry three digits."},"tcrPpm":{"type":"number","description":"colour-encode with 6 bands: temperature coefficient in ppm/K.","minimum":0,"maximum":1000},"claim":{"type":"object","description":"Optional map from an output value name (e.g. resistance, vout, minResistance) to the number you expect."},"claimTolerancePct":{"type":"number","description":"Relative tolerance for claim values, percent (default 0: exact).","minimum":0,"maximum":100}}},"resultSchema":{"type":"object","properties":{"status":{"type":"string","enum":["pass","fail","unknown","unsupported"],"description":"pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass."},"operation":{"type":"string"},"values":{"type":"object","description":"Named numeric results (a value is null where undefined, e.g. an unbounded ratio) in SI base units (ohm, volt, ampere, watt); null where undefined. colour-decode adds tolerancePct, min/maxResistance and tcrPpmPerK."},"bands":{"type":"array","items":{"type":"string"},"description":"colour-decode: the normalised colour names. colour-encode: the colours to print, head end first. Omitted for other ops."},"roles":{"type":"array","items":{"type":"string"},"description":"colour-decode: the meaning assigned to each band position. Omitted for other ops."},"witnesses":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"detail":{"type":"string"},"path":{"type":"string","description":"JSON pointer or dotted path into the input."},"offset":{"type":"integer"},"index":{"type":"integer"},"expected":{"description":"What the rule required."},"actual":{"description":"What the input had."}}}},"versions":{"type":"object","description":"Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile)."},"limits":{"type":"array","items":{"type":"string"}},"deterministic":{"type":"boolean","description":"Always true: pure code, no model."}}},"outputSchema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["pass","fail","unknown","unsupported"],"description":"pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass."},"operation":{"type":"string"},"values":{"type":"object","description":"Named numeric results (a value is null where undefined, e.g. an unbounded ratio) in SI base units (ohm, volt, ampere, watt); null where undefined. colour-decode adds tolerancePct, min/maxResistance and tcrPpmPerK."},"bands":{"type":"array","items":{"type":"string"},"description":"colour-decode: the normalised colour names. colour-encode: the colours to print, head end first. Omitted for other ops."},"roles":{"type":"array","items":{"type":"string"},"description":"colour-decode: the meaning assigned to each band position. Omitted for other ops."},"witnesses":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"detail":{"type":"string"},"path":{"type":"string","description":"JSON pointer or dotted path into the input."},"offset":{"type":"integer"},"index":{"type":"integer"},"expected":{"description":"What the rule required."},"actual":{"description":"What the input had."}}}},"versions":{"type":"object","description":"Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile)."},"limits":{"type":"array","items":{"type":"string"}},"deterministic":{"type":"boolean","description":"Always true: pure code, no model."}}},"_provenance":{"type":"object","description":"C2PA-aligned manifest and W3C VC 2.0 (eddsa-jcs-2022) issued by the hub DID; verify at POST /api/v1/verify-provenance"}},"required":["data","_provenance"]},"example":{"op":"colour-decode","bands":["brown","black","red","gold"]},"openapiOperation":{"operationId":"electrical_calc","summary":"Electrical arithmetic and resistor colour codes","description":"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 value. For engineers and agents checking a circuit number before acting on it. It does not simulate AC, reactive or non-linear circuits, choose a part by power rating or look up a material's resistivity. Exact decimal arithmetic. An optional claim map (output name to number, with a percent tolerance) turns it into a pass/fail check.\n\nPrice: 0.005 USDC on Base (x402).","x-x402-price-usdc":"0.005","x-x402-amount":"5000","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"}},"x-audience":"business","x-sample-url":"https://agents.writerslogic.com/api/v1/samples/electrical-calc","security":[{"x402":[]},{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["op"],"properties":{"op":{"type":"string","enum":["ohm","series","parallel","divider","led-resistor","line-drop","colour-decode","colour-encode","e-series"],"description":"ohm | series | parallel | divider | led-resistor | line-drop | colour-decode | colour-encode | e-series."},"voltage":{"type":"number","description":"ohm: volts.","minimum":-1000000000000000,"maximum":1000000000000000},"current":{"type":"number","description":"ohm, led-resistor, line-drop: amperes.","minimum":-1000000000000000,"maximum":1000000000000000},"resistance":{"type":"number","description":"ohm: ohms. colour-encode and e-series: the value in ohms.","minimum":-1000000000000000,"maximum":1000000000000000},"power":{"type":"number","description":"ohm: watts.","minimum":-1000000000000000,"maximum":1000000000000000},"resistances":{"type":"array","items":{"type":"number","description":"number","minimum":-1000000000000000,"maximum":1000000000000000},"maxItems":100,"description":"series/parallel: ohms, at most 100."},"tolerancePct":{"type":"number","description":"series/parallel: shared tolerance percent for min/max bounds. colour-encode: tolerance percent to encode.","minimum":0,"maximum":100},"vin":{"type":"number","description":"divider: input volts.","minimum":-1000000000000000,"maximum":1000000000000000},"r1":{"type":"number","description":"divider: top resistor, ohms.","minimum":-1000000000000000,"maximum":1000000000000000},"r2":{"type":"number","description":"divider: bottom resistor, ohms.","minimum":-1000000000000000,"maximum":1000000000000000},"rLoad":{"type":"number","description":"divider: optional load across r2, ohms.","minimum":-1000000000000000,"maximum":1000000000000000},"supplyVoltage":{"type":"number","description":"led-resistor: supply volts. line-drop: optional, enables dropPercent.","minimum":-1000000000000000,"maximum":1000000000000000},"forwardVoltage":{"type":"number","description":"led-resistor: LED forward volts.","minimum":-1000000000000000,"maximum":1000000000000000},"series":{"type":"string","enum":["E3","E6","E12","E24","E48","E96","E192"],"description":"led-resistor (default E24) and e-series: preferred-value series."},"lengthM":{"type":"number","description":"line-drop: one-way length in metres.","minimum":0,"maximum":1000000000000000},"areaMm2":{"type":"number","description":"line-drop: conductor cross-section in mm^2.","minimum":0,"maximum":1000000000000000},"resistivityOhmM":{"type":"number","description":"line-drop: conductor resistivity in ohm-metres, supplied by the caller (not looked up).","minimum":0,"maximum":1},"roundTrip":{"type":"boolean","description":"line-drop: count out and return conductors (default true)."},"maxDropPercent":{"type":"number","description":"line-drop: fail when the drop exceeds this percent of supplyVoltage.","minimum":0,"maximum":100},"bands":{"type":"array","items":{"type":"string","maxLength":12,"description":"Colour name, head end first (IEC 60062 table)."},"maxItems":6,"minItems":3,"description":"colour-decode: 3 to 6 colours read from the head end."},"bandCount":{"type":"integer","minimum":3,"maximum":6,"description":"colour-encode: 3, 4 (default), 5 or 6 bands. 5 and 6 bands carry three digits."},"tcrPpm":{"type":"number","description":"colour-encode with 6 bands: temperature coefficient in ppm/K.","minimum":0,"maximum":1000},"claim":{"type":"object","description":"Optional map from an output value name (e.g. resistance, vout, minResistance) to the number you expect."},"claimTolerancePct":{"type":"number","description":"Relative tolerance for claim values, percent (default 0: exact).","minimum":0,"maximum":100}}},"example":{"op":"colour-decode","bands":["brown","black","red","gold"]}}}},"responses":{"200":{"description":"Paid result with provenance","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["pass","fail","unknown","unsupported"],"description":"pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass."},"operation":{"type":"string"},"values":{"type":"object","description":"Named numeric results (a value is null where undefined, e.g. an unbounded ratio) in SI base units (ohm, volt, ampere, watt); null where undefined. colour-decode adds tolerancePct, min/maxResistance and tcrPpmPerK."},"bands":{"type":"array","items":{"type":"string"},"description":"colour-decode: the normalised colour names. colour-encode: the colours to print, head end first. Omitted for other ops."},"roles":{"type":"array","items":{"type":"string"},"description":"colour-decode: the meaning assigned to each band position. Omitted for other ops."},"witnesses":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"detail":{"type":"string"},"path":{"type":"string","description":"JSON pointer or dotted path into the input."},"offset":{"type":"integer"},"index":{"type":"integer"},"expected":{"description":"What the rule required."},"actual":{"description":"What the input had."}}}},"versions":{"type":"object","description":"Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile)."},"limits":{"type":"array","items":{"type":"string"}},"deterministic":{"type":"boolean","description":"Always true: pure code, no model."}}},"_provenance":{"type":"object","description":"C2PA-aligned manifest and W3C VC 2.0 (eddsa-jcs-2022) issued by the hub DID; verify at POST /api/v1/verify-provenance"}},"required":["data","_provenance"]}}}},"400":{"description":"Invalid request (no payment consumed)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}},"401":{"description":"Invalid X-API-KEY","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}},"402":{"description":"Payment required or invalid","content":{"application/json":{"schema":{"type":"object","description":"x402 v2 PaymentRequired (also base64 in the PAYMENT-REQUIRED header)","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"code":{"type":"string"},"resource":{"type":"object"},"accepts":{"type":"array","items":{"type":"object"}},"extensions":{"type":"object"}}}}}},"502":{"description":"Upstream failure; the payment is released or not settled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}}}},"links":{"docs":"https://agents.writerslogic.com/docs/electrical-calc/","docsJson":"https://agents.writerslogic.com/docs/electrical-calc.json","sample":"https://agents.writerslogic.com/api/v1/samples/electrical-calc","openapi":"https://agents.writerslogic.com/openapi.json","catalog":"https://agents.writerslogic.com/api/v1/catalog","verifyProvenance":"https://agents.writerslogic.com/api/v1/verify-provenance","index":"https://agents.writerslogic.com/docs/index.json"}}