Skip to content

feat(mcp): add write tools to MCP clients (create/update/pause/resume/delete monitor)#32

Merged
KhaledSalhab-Develeap merged 4 commits into
mainfrom
feat/139561-mcp-write-tools
Jun 13, 2026
Merged

feat(mcp): add write tools to MCP clients (create/update/pause/resume/delete monitor)#32
KhaledSalhab-Develeap merged 4 commits into
mainfrom
feat/139561-mcp-write-tools

Conversation

@KhaledSalhab-Develeap

Copy link
Copy Markdown
Collaborator

@PR_BODY.md

Cover create/update/pause/resume/delete monitor for both sync and async
MCP clients. Red phase: tests fail until implementation lands.
Add create_monitor, update_monitor, pause_monitor, resume_monitor, and
delete_monitor to HyperpingMcpClient and AsyncHyperpingMcpClient.

Each method is a thin typed wrapper around _call(), following the same
pattern as existing read methods. create_monitor accepts a MonitorCreate
model serialized via model_dump(exclude_none=True). update_monitor takes
a uuid plus **kwargs for partial updates. pause/resume call dedicated
MCP tools directly, avoiding a read-modify-write roundtrip.
@KhaledSalhab-Develeap

Copy link
Copy Markdown
Collaborator Author

Self-review verdict: PASS

No blockers or high findings. Followups below.


Findings refuted on closer look

update_monitor(**kwargs) vs REST update_monitor(update: MonitorUpdate) — not an inconsistency. The REST client performs a full read-modify-write (HTTP PUT requires a complete payload). The MCP tool handles patch semantics internally. The **kwargs pattern matches every other variable-arg method on this client (get_monitor_response_time, get_monitor_mtta, etc.). Design is intentional.


Followups not in this PR

  1. Mid-file imports (nit)tests/unit/test_mcp_client.py and tests/unit/test_async_mcp_client.py append from hyperping.models._monitor_models import MonitorCreate # noqa: E402 after ~330 lines instead of placing it at the top alongside the existing Monitor import. The # noqa suppression is a code smell. Trivial cleanup; no behavioral impact.

  2. CHANGELOG not updated (medium)## [Unreleased] in CHANGELOG.md is empty. Five new public methods on two public classes (HyperpingMcpClient, AsyncHyperpingMcpClient) should be listed under ### Added before the next release cut.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@KhaledSalhab-Develeap

Copy link
Copy Markdown
Collaborator Author

CI matrix:

  • test (3.11): FAILURE
  • test (3.12): FAILURE
  • test (3.13): FAILURE

All required checks have failed. Details available at the linked logs above.

The MonitorCreate import was placed mid-file after the write-tools
section divider, which trips ruff's I001 import-sorting rule. Fold it
into the existing _monitor_models import at the top of each test file.
@KhaledSalhab-Develeap KhaledSalhab-Develeap marked this pull request as ready for review June 13, 2026 12:03
@KhaledSalhab-Develeap KhaledSalhab-Develeap merged commit f7dec6f into main Jun 13, 2026
3 checks passed
@KhaledSalhab-Develeap KhaledSalhab-Develeap deleted the feat/139561-mcp-write-tools branch June 13, 2026 12:03
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