Skip to main content
Glama

remove_dhcp_lease

Deletes a DHCP lease by IP or MAC address to force a client to renew its IP; preview first, then confirm, with a warning for static leases.

Instructions

Remove a DHCP lease (/ip/dhcp-server/lease remove) by address or mac_address - typically to force a client to renew its IP. At least one of address/mac_address must be given and must match an existing lease (mac_address is tried first if both are given).

Removes EITHER a dynamic or a static lease. If the resolved lease is STATIC (dynamic=false - i.e. it was pinned with add_static_dhcp_lease), the returned preview's warning field is non-null: removing it deletes the pinned IP<->MAC mapping itself, not just a renewable cache entry. Always check warning before calling again with confirm=true. No warning for a dynamic lease - that is this tool's ordinary use case.

WRITE tool, guarded: blocked entirely unless the server is running with MIKROTIK_ALLOW_WRITE=true. Call with confirm=False (the default) to get a preview (including the warning field) without changing anything; call again with confirm=True to actually remove it. Errors clearly if nothing matches.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressNo
confirmNo
device_nameYes
mac_addressNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.11.0

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden and does so: it discloses the MIKROTIK_ALLOW_WRITE=true gating, the preview-vs-confirm semantics, the destructive effect on static leases (deleting the pinned IP<->MAC mapping), the warning field signal, and the error behavior when nothing matches.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well front-loaded with the command path and core semantics, but the static-lease warning paragraph is dense and slightly repetitive with the surrounding paragraphs about the warning field. Still, nearly every sentence earns its place given the tool's destructive nature.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite an output schema existing, the description correctly explains the warning field's meaning because it is action-critical context (a signal to not proceed with confirm). Combined with write gating, confirm flow, and match semantics, an agent has everything needed to call this safely.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description compensates by explaining address vs mac_address semantics, the both-given precedence rule, and the meaning of confirm (preview vs actual removal). device_name is implied but never stated, which is the only gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (remove) and resource (DHCP lease) with the exact router command path, and distinguishes itself from siblings like dhcp_leases (read) and add_static_dhcp_lease by naming the pinning tool directly. An agent can route unambiguously.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly names when-to-use (force a client to renew its IP), the precondition (at least one of address/mac_address must match an existing lease), the resolution order when both are given, and the two-step confirm flow. Nothing is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools