feat: add MCP-discovered API endpoints#17
Merged
Conversation
…call, integrations) Add 18 new client methods covering Hyperping API capabilities discovered via the MCP server reference (hyperping.com/docs/mcp): Reporting (3 methods): - get_status_summary() - aggregate up/down/paused counts - get_monitor_response_time(uuid, period) - latency percentiles - get_monitor_mtta(uuid, period) - mean time to acknowledge Observability (3 methods): - get_monitor_anomalies(uuid) - flapping, latency spikes - get_monitor_http_logs(uuid, page, limit, level) - probe logs - list_recent_alerts(from, to, monitor_uuids) - notification history On-call (5 methods): - list_on_call_schedules() / get_on_call_schedule(uuid) - list_escalation_policies() / get_escalation_policy(uuid) - list_team_members() Integrations (2 methods): - list_integrations() / get_integration(uuid) Outage extensions (2 methods): - get_outage_timeline(uuid) - lifecycle events - get_monitor_outages(monitor_uuid) - scoped outage list Monitor extensions (1 method): - search_monitors_by_name(query) - substring search All methods follow existing SDK patterns: mixin composition, Pydantic v2 models with camelCase aliases, validate_id for path safety, graceful 404 degradation for list endpoints. Full async parity. Endpoint paths are speculative (derived from MCP tool names and existing URL conventions). Marked with comments for verification. New models: StatusSummary, MonitorAnomaly, ProbeLog, AlertNotification, OnCallSchedule, EscalationPolicy, Integration, OutageTimeline, OutageTimelineEvent.
Add 86 new tests covering: - Reporting mixin: status summary, response time, MTTA (10 tests) - Observability mixin: anomalies, HTTP logs, alerts (14 tests) - On-call mixin: schedules, policies, team members (15 tests) - Integrations mixin: list/get (6 tests) - Outage extensions: timeline, monitor_outages (6 tests) - Monitor extensions: search_by_name (3 tests) - Async variants of all new mixins (16 tests) - Async pre-existing mixins: healthchecks, maintenance, incidents (16 tests) Coverage: 79% -> 90% (355 tests, 0 failures)
- Narrow all 14 bare `except Exception` catches in sync and async mixins to `except (HyperpingNotFoundError, HyperpingAPIError)`, matching the established pattern in _outages_mixin.py. Auth errors and rate limit errors now propagate correctly. - Add Endpoint.MONITOR_RESPONSE_TIME and Endpoint.MONITOR_MTTA constants to endpoints.py, replacing hardcoded path strings in _reporting_mixin.py and _async_reporting_mixin.py. - Update test URLs to use Endpoint constants instead of hardcoded paths.
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
Adds 18 new client methods covering Hyperping API capabilities discovered via the MCP server:
9 new Pydantic models, 4 new sync mixins + 4 async mirrors, 8 new endpoints. All follow existing SDK patterns (mixin composition, camelCase aliases, validate_id, typed exception handling). Full async parity.
Endpoint paths are speculative (derived from MCP tool names); marked with inline comments for live API verification.
Test plan