Skip to main content
Glama

set_route_distance

Adjust an existing MikroTik route's failover priority by setting its distance, matched by destination address and gateway, with a preview before applying changes.

Instructions

Adjust an existing route's distance (failover priority - lower distance wins) via /ip/route set distance=<distance>.

Resolved by the STABLE (dst_address, gateway) pair - never a dynamic .id/list index, which can silently shift as routes are added/removed elsewhere on the device between a preview and the confirmed apply. Errors clearly (without changing anything) if no route matches that pair, or if more than one still does (AmbiguousResourceError) - this never guesses which route to touch.

WRITE tool, guarded: blocked entirely unless the server is running with MIKROTIK_ALLOW_WRITE=true. Call with confirm=False (the default) to get a before/after preview without changing anything; call again with confirm=True to actually apply it. See README's "Failover control" section for the recommended step-by-step flow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmNo
gatewayYes
distanceYes
device_nameYes
dst_addressYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.11.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: it discloses the write-guard requirement, the two-phase preview/apply contract, and the failure semantics (errors without changing anything if no route matches, AmbiguousResourceError if multiple match, never guesses). It also explains the stable-key resolution choice and why dynamic ids are avoided.

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?

Front-loaded with the core action and the meaning of `distance`, then layered with resolution rules, guard behavior, and workflow. Each paragraph earns its place, though the multi-paragraph format is denser than strictly necessary for a single-field update.

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?

An output schema exists, so return values need not be described. Given a 5-param mutation with 0% schema coverage and no annotations, the description covers the action, the safety guard, the preview/apply contract, the identity resolution strategy, and the error modes — nothing essential is missing.

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?

Schema coverage is 0%, so the description must compensate, and it does for the key parameters: `distance` (failover priority, lower wins), `confirm` (default False = preview, True = apply), and the `dst_address`/`gateway` pair as the resolution key. `device_name` is left implicit, 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 precise verb+resource ('Adjust an existing route's distance') and even names the underlying RouterOS command. It also defines the domain meaning of `distance` (failover priority, lower wins), which lets an agent distinguish it from siblings like add_route, remove_route, enable_route, and disable_route.

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

Usage Guidelines4/5

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

Gives clear operational context: it is a guarded WRITE tool requiring MIKROTIK_ALLOW_WRITE=true, with a confirm=False preview step followed by confirm=True apply. It points to the README for the full flow. It does not explicitly name a sibling alternative to use instead, so it falls just short of a 5.

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