Skip to main content
Glama

add_wireguard_peer

Add a WireGuard peer to an existing RouterOS tunnel interface using its public key and allowed addresses, previewing the change before confirming.

Instructions

Add a WireGuard peer (/interface/wireguard/peers add) to an existing tunnel interface.

public_key is the REMOTE peer's own public key (base64, 44 chars). allowed_address is a comma-separated list of CIDR ranges routed through this peer (e.g. "10.0.0.2/32,10.0.0.3/32"). endpoint_address/endpoint_port (the peer's reachable address/port, if any) and persistent_keepalive (a RouterOS duration, e.g. "25s") are optional.

Does NOT accept a private-key or preshared-key parameter - the remote peer's own private key, and any preshared key, are entirely out of this tool's scope.

interface must already exist - create it first with add_wireguard_interface; errors clearly if it doesn't. Refuses to add a duplicate peer (same public_key already registered on the same interface) - never creates a duplicate.

WRITE tool, guarded: blocked entirely unless the server is running with MIKROTIK_ALLOW_WRITE=true. Call with confirm=False (the default) to preview without changing anything; call again with confirm=True to actually add it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commentNo
confirmNo
interfaceYes
public_keyYes
device_nameYes
endpoint_portNo
allowed_addressYes
endpoint_addressNo
persistent_keepaliveNo

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?

With no annotations provided, the description carries the full behavioral burden and does so well: it discloses write gating, two-step confirmation, duplicate detection/refusal, dependency on an existing interface, and explicit scope exclusions for private and preshared keys. No annotation contradiction exists.

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

Conciseness5/5

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

The description is long but appropriately structured for a write tool with many parameters: it front-loads the action, then key parameter meanings, then constraints and write-gating flow. Each paragraph addresses a distinct decision or parameter, with no obvious filler.

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

Completeness4/5

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

Given 9 parameters, no annotations, and 0% schema description coverage, it covers most decision-critical behavior and most parameters. However, it leaves the required device_name and optional comment unexplained, and an output schema exists so return values need not be covered. The remaining gaps are minor but real.

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 description coverage is 0%, so the description must compensate. It explains public_key format (base64, 44 chars), allowed_address CIDR list with example, endpoint_address/endpoint_port as optional, persistent_keepalive as a RouterOS duration, and confirm semantics, but it does not explain the required device_name or optional comment parameters.

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 and resource: 'Add a WireGuard peer' with the exact RouterOS command path. It distinguishes the tool from sibling add_wireguard_interface by requiring an existing interface, and from list/remove WireGuard tools, so an agent can select it without opening the schema.

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 states prerequisites ('interface must already exist - create it first with add_wireguard_interface'), duplicate refusal behavior, write gating via MIKROTIK_ALLOW_WRITE=true, and the confirm=False preview / confirm=True commit flow. It also names what the tool does not accept, further constraining usage.

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