Skip to content

feat: add MCP-discovered API endpoints#17

Merged
KhaledSalhab-Develeap merged 3 commits into
mainfrom
feat/mcp-discovered-endpoints
Apr 19, 2026
Merged

feat: add MCP-discovered API endpoints#17
KhaledSalhab-Develeap merged 3 commits into
mainfrom
feat/mcp-discovered-endpoints

Conversation

@KhaledSalhab-Develeap
Copy link
Copy Markdown
Collaborator

@KhaledSalhab-Develeap KhaledSalhab-Develeap commented Apr 19, 2026

Summary

Adds 18 new client methods covering Hyperping API capabilities discovered via the MCP server:

  • Reporting (3): status summary, response time percentiles, MTTA
  • Observability (3): anomalies, HTTP probe logs, alert history
  • On-call (5): schedules, escalation policies, team members
  • Integrations (2): list/get notification channels
  • Outage extensions (2): timeline, per-monitor scoping
  • Monitor extensions (1): name search

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

  • 355 tests pass (269 existing + 86 new, 0 regressions)
  • 90% code coverage (up from 85%)
  • ruff lint + format clean
  • New models accept both camelCase and snake_case (tested per model)
  • All 18 new methods accessible via HyperpingClient and AsyncHyperpingClient
  • ID validation rejects path-traversal attempts (ValueError)
  • List endpoints return [] on 404 (graceful degradation)
  • Single-item endpoints raise HyperpingNotFoundError on 404
  • Exception handling uses (HyperpingNotFoundError, HyperpingAPIError), not bare Exception

…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.
@KhaledSalhab-Develeap KhaledSalhab-Develeap merged commit 1e18961 into main Apr 19, 2026
3 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.

1 participant