bgp_sessions
List BGP session status including remote address, AS, state, uptime, and prefix count. Handles RouterOS 6 and 7 differences, returning empty for devices without BGP.
Instructions
List BGP session status: remote-address/remote-as, state (established/idle/...), uptime, prefix-count.
RouterOS exposes this under two different paths depending on generation, the same split wireless_registrations already handles for wifi: ROS7's routing package (/routing/bgp/session) or ROS6's (/routing/bgp/peer). This tries ROS7 first, falls back to ROS6, and returns an empty list - rather than raising - for a device that doesn't run BGP at all.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"device_name": "<device_name>"
},
"name": "bgp_sessions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |