Skip to content

feat(mcp): add export_to_gdm tool (write tracked changes back to GDM) - #91

Merged
AadilLatif merged 1 commit into
mainfrom
feat/export-to-gdm-mcp
Aug 4, 2026
Merged

AadilLatif merged 1 commit into
mainfrom
feat/export-to-gdm-mcp

Conversation

@AadilLatif

Copy link
Copy Markdown
Collaborator

Summary

Adds an export_to_gdm MCP tool that applies ERAD simulation tracked-changes (e.g. asset outages) back onto the original GDM DistributionSystem and writes the updated model to JSON. This closes the ERAD→GDM loop so a resilience scenario can chain directly into a follow-on power flow.

Implementation

  • src/erad/mcp/export.py: export_to_gdm_tool — reloads the source GDM via model_ref/source_path, applies gdm.tracked_changes.apply_updates_to_system, optional scenario_name filter, writes to_json.
  • src/erad/mcp/server.py: registered the tool (schema + _TOOL_HANDLERS).
  • Business logic reuses existing GDM API; no changes to solver/loaders.

Verification

  • Full erad suite: 114 passed.
  • Tool registered and callable; import + _get_tools() confirmed.

🤖 Generated with opencode

@AadilLatif
AadilLatif merged commit 8e1109a into main Aug 4, 2026
3 checks passed
@AadilLatif
AadilLatif deleted the feat/export-to-gdm-mcp branch August 4, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant