delete_monitor
Permanently delete a monitor by providing its unique ID, stopping all tracking and alerting for that resource.
Instructions
Delete a monitor permanently.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| monitor_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The actual implementation of the delete_monitor tool. It uses @mcp.tool() decorator to register as an MCP tool, takes a monitor_id and optional api_token, calls get_client(api_token).monitors.delete(monitor_id), and returns a plain string 'Monitor deleted successfully.' on success or raises a tool error on DevhelmError.
@mcp.tool() def delete_monitor(monitor_id: str, api_token: str | None = None) -> str: """Delete a monitor permanently.""" try: get_client(api_token).monitors.delete(monitor_id) return "Monitor deleted successfully." except DevhelmError as e: raise_tool_error(e) - src/devhelm_mcp/tools/monitors.py:108-108 (registration)The tool is registered via the @mcp.tool() decorator on the delete_monitor function. This happens inside the register(mcp) function which is called from server.py.
@mcp.tool() - src/devhelm_mcp/server.py:109-110 (registration)The monitors module's register() function is called with the mcp FastMCP instance, which registers all monitor tools including delete_monitor.
for mod in ALL_TOOL_MODULES: mod.register(mcp) - Imports used by delete_monitor: DevhelmError from devhelm, and get_client, raise_tool_error from devhelm_mcp.client.
"""Monitor tools — HTTP, DNS, TCP, ICMP, MCP, and Heartbeat monitors.""" from __future__ import annotations from typing import Any from devhelm import DevhelmError from devhelm.types import CreateMonitorRequest, UpdateMonitorRequest from fastmcp import FastMCP from pydantic import Field from devhelm_mcp.client import ( ToolResult, as_payload, get_client, raise_tool_error, serialize, )