Skip to content

ionis__current_conditions returns SFI/Kp unavailable (SWPC JSON format drift, same as solar-mcp) #3

@KI7MT

Description

@KI7MT

Diagnosis

Similar to solar-mcp issue #3: ionis__current_conditions (and related band outlook in reports) shows:

SFI: unavailable
Kp: unavailable
...
Note: Some data unavailable — Kp: 1

While solar wind and alerts populate.

Root Cause

In src/ionis_mcp/noaa.py:fetch_current_conditions():

  • SFI: assumes if isinstance(data, dict) for /10cm-flux.json → now list → skipped.
  • Kp: assumes list-of-lists latest[1] for /noaa-planetary-k-index.json → now list-of-dicts → KeyError caught as error.
  • Bz: same for /summary/solar-wind-mag-field.json → list now.

The _fetch_json succeeds, but parse fails silently into errors list.

Duplicated logic from old solar-mcp client (before the fix there).

Solution (on branch)

  • Updated parsing in noaa.py for current list-of-dicts + legacy fallback for all three endpoints.
  • Verified: now sfi=128, kp=0.67, bz=-1, errors=[], full report with bands.

Related

  • Same upstream change as solar-mcp.
  • ionis current_conditions should perhaps delegate to solar-mcp for consistency in future, but this makes it work now.

PR to follow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions