Skip to content

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

Draft
KhaledSalhab-Develeap wants to merge 2 commits into
mainfrom
feat/139561-mcp-write-tools
Draft

feat(mcp): add write tools to MCP clients (create/update/pause/resume/delete monitor)#32
KhaledSalhab-Develeap wants to merge 2 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.

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