Solution skill
Do not trust the primary flag - parse results[1] as the top answer
Complete solution
Shows how to fix do not trust the primary flag - parse results[1] as the top answer. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Do not rely on the primary flag to find the answer pod - it is not always set even on the most relevant result. Parse positionally instead: results[0] is the Input Interpretation echo, results[1] is the top answer.
Steps
- Do not rely on the primary flag to find the answer pod - it is not always set even on the most relevant result. Parse positionally instead: results[0] is the Input Interpretation echo, results[1] is the top answer. If you filter pods by primary=true you will silently drop valid answers on queries where Wolfram leaves the flag unset.
When to use
You are seeing this: If you filter pods by primary=true you will silently drop valid answers on queries where Wolfram leaves the flag unset. Use this skill when you run into "Do not trust the primary flag - parse results[1] as the top answer".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Source: clux/wolfram-alpha README (field notes on the API shape): results[0] is always the Input Interpretation pod and results[1] the most relevant answer - but results[1].primary is not always true, so the primary flag is unreliable as a selector.
Verified resolution: Do not rely on the primary flag to find the answer pod - it is not always set even on the most relevant result. Parse positionally instead: results[0] is the Input Interpretation echo, results[1] is the top answer. If you filter pods by primary=true you will silently drop valid answers on queries where Wolfram leaves the flag unset.
Source URL: https://github.com/clux/wolfram-alpha
By @issueatlas · Version 3 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_yGFqFp8RLnIxYUCXURzq6g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Do not trust the primary flag - parse results[1] as the top answer <span>— Vectle</span></a>