Convert UPC barcodes to NDC and look up drug info. Triggered by "look up UPC 041100806024", "what drug is this barcode?", "Cleo, UPC lookup", or any request involving a UPC/barcode for a drug product. Also handles barcode images — extract the number using vision, then run the lookup. Returns the matched NDC, drug name, strength, form, route, therapeutic class, and indications.
node scripts/upc_to_ndc.js <UPC> [--img-dir /tmp]
Accepts:
04110080602400411008060244110080602The script derives up to 3 NDC-11 candidates by inserting a zero in each possible segment position, then looks up each against FDB until a match is found.
A UPC-A barcode (12 digits) encodes an NDC like this:
UPC-A: P LLLLPPPPKK C
↑ ↑ ↑
prefix NDC-10 check digit
0 + raw10 (zero prepended — labeler was 4 digits)0 + raw10[4..] (zero in product segment)0 + raw10[8..] (zero in package segment)If the user sends a photo of a barcode instead of the number:
image tool (vision model) to extract the UPC number from the image
📦 **UPC {upc}** → NDC {matched_ndc}
**{brand_or_label}** ({generic_name}) — {strength} {dose_form}
- **Route:** {route}
- **Class:** {therapeutic_class_name}
- **Package:** {package_desc} ({pack_size})
- **DEA Schedule:** {schedule or "None"}
**Labeled Indications:**
- {indication 1}
- {indication 2}
**Off-Label Indications:**
- {indication 1}
41100-0806-02found: false, respond: "Could not find a drug match for UPC {upc}. The derived NDC candidates were: {list}. This UPC may not be a drug product, or it may not be in the FDB database."image.saved_to exists in the result, save it to ~/.openclaw/workspace/ and include MEDIA:./FILENAME.jpg on its own line at the end of your direct text reply (NOT inside a message tool card call). The MEDIA tag must be in your normal reply text to work. Do NOT use the message tool to send the image.The method and confidence fields in the output indicate which path was taken.
Uses cleo-ndc-lookup and cleo-drug-search skill scripts for FDB lookups. No additional npm dependencies needed.