Refactor event search to consolidate alarms and enhance validation#42
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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_eventsto supportsearch_type=event|alarm|suppressed_alarm, with parameter validation split into helper functions. - Removes the
mist_search_alarmstool and updates tool category listings and README references. - Updates the MCP generator to treat
search_eventsas a custom template tool and skips generating the legacy consolidatedsearchEvents/searchAlarmstools.
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.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
No description provided.