Skip to content

Refactor event search to consolidate alarms and enhance validation#42

Merged
tmunzer-AIDE merged 6 commits into
mainfrom
tmunzer-aide/merge-sle-tools
Jun 11, 2026
Merged

Refactor event search to consolidate alarms and enhance validation#42
tmunzer-AIDE merged 6 commits into
mainfrom
tmunzer-aide/merge-sle-tools

Conversation

@tmunzer-AIDE

Copy link
Copy Markdown
Collaborator

No description provided.

tmunzer-AIDE and others added 4 commits June 10, 2026 15:27
Consolidate mist_search_alarms into mist_search_events with search_type values for event, alarm, and suppressed_alarm.

- Use site_id to select site-level alarm searches
- Keep suppressed alarms as a separate search_type
- Preserve all existing event and alarm endpoint coverage
- Preserve acked=false alarm filtering

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reject cross-mode parameters instead of silently ignoring them in the unified event/alarm search tool, and validate MX Edge MAC filters before building the derived MX Edge UUID.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Wire the consolidated event/alarm and upgrade tools into make generate so regenerated output preserves mist_search_events, mist_get_sle, and mist_upgrades instead of recreating split tool files.

Also align the search-client template with the checked-in generated behavior so make generate is idempotent.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates event and alarm searching into a single mist_search_events tool, removing the standalone alarms tool and updating the generator/config/docs accordingly to reflect the new interface.

Changes:

  • Refactors mist_search_events to support search_type=event|alarm|suppressed_alarm, with parameter validation split into helper functions.
  • Removes the mist_search_alarms tool and updates tool category listings and README references.
  • Updates the MCP generator to treat search_events as a custom template tool and skips generating the legacy consolidated searchEvents/searchAlarms tools.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/mistmcp/tools/upgrades.py Minor formatting cleanup in payload description construction.
src/mistmcp/tools/search_events.py Consolidates events + alarms + suppressed alarms under one tool; adds validation helpers and MXEdge MAC normalization.
src/mistmcp/tools/search_client.py Parameter formatting cleanup only.
src/mistmcp/tools/search_alarms.py Removes the dedicated alarms search tool implementation.
src/mistmcp/tool_helper.py Removes mist_search_alarms from the events tool group and tidies enum placement.
README.md Removes mist_search_alarms from the “Monitoring and events” tool list.
mcp_generator/tools_optimization.yaml Skips generating legacy consolidated searchEvents/searchAlarms tools.
mcp_generator/templates/tmpl_search_events.py Adds a custom generator template for the consolidated mist_search_events tool.
mcp_generator/templates/tmpl_search_client.py Aligns template with current search_client behavior/params.
mcp_generator/generate_from_openapi.py Registers search_events (and upgrades) as custom tools in generator flow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/mistmcp/tools/search_events.py
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Comment thread src/mistmcp/tools/search_client.py
Comment thread src/mistmcp/tools/search_client.py
Comment thread src/mistmcp/tools/search_client.py
Comment thread mcp_generator/templates/tmpl_search_client.py
@tmunzer-AIDE tmunzer-AIDE merged commit dc576f9 into main Jun 11, 2026
4 checks passed
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.

2 participants