fix: solar_conditions + band_outlook return nulls (SWPC JSON format drift)#4
Open
KI7MT wants to merge 1 commit into
Open
fix: solar_conditions + band_outlook return nulls (SWPC JSON format drift)#4KI7MT wants to merge 1 commit into
KI7MT wants to merge 1 commit into
Conversation
…nt parsing - solar__solar_conditions (and solar_band_outlook) returned nulls for sfi/kp because /summary/10cm-flux.json and /noaa-planetary-k-index.json now return list-of-dicts (not legacy dict/list-of-lists). - Added robust parsing for current + legacy formats. - Normalize scales '0' -> 'R0' etc. for consistency with tests/docs. - Updated mocks. - Added entry to Unreleased in CHANGELOG. This was diagnosed from MCP tool calls returning nulls while other solar tools succeeded, confirmed by direct curl of endpoints, and live verification post-fix. Closes: will link to issue/PR. Co-Authored-By: Grok (xAI) <grok@x.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
solar__solar_conditions(andsolar_band_outlook) returning nulls for SFI/Kp after NOAA SWPC updated the JSON response shapes on two endpoints used only by these tools.solar_conditionsnow robustly parses current list-of-dicts formats (and legacy for compat).See issue #3 for full diagnosis, evidence (curl repros), root cause in client.py parsing, and verification steps.
Changes
src/solar_mcp/client.py: updated conditions() parsing + mocks.CHANGELOG.md: Unreleased "Fixed" section.Testing
client.conditions()now succeeds with real SFI/Kp (e.g. 128 / 0.67) + band_outlook.Fleet impact
Closes #3
Next
pytest tests/test_live.py --livepost-merge.This aligns with qso-graph MCP security/release workflow (feature branch, tracked in Issues, two-person review).
Co-Authored-By: Grok (xAI)