Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Mats2208/MCP-Packet-Tracer/llms.txt
Use this file to discover all available pages before exploring further.
pt_query_topology sends a queryTopology() call to the Packet Tracer Script Engine via the HTTP bridge and returns a formatted list of every device currently on the active logical canvas. Each entry includes the device name, type, model, and canvas coordinates. This is the primary way to inspect what is running in Packet Tracer before making modifications with other live tools.
Parameters
This tool takes no parameters.Return value
A formatted list of devices found in the active topology. Each line shows the device name (padded), its type category, model name in brackets, and canvas position. Example:If no devices are found, returns
"No hay dispositivos en la topología actual.".If the bridge is not connected, returns the bridge error message with the bootstrap snippet.Use cases
Verify a deploy succeeded — after callingpt_live_deploy, call pt_query_topology to confirm all expected devices appeared on the canvas and their names match the plan.
Inspect an existing topology — open a .pkt file in Packet Tracer, then call pt_query_topology to get the exact device names and models before planning modifications.
Get device names before editing — pt_delete_device, pt_rename_device, pt_move_device, and pt_delete_link all require exact device names. Use pt_query_topology to list the current names first.
Validate model compatibility — when planning to call pt_add_module, confirm the device model from the query output to check HWIC / NIM / NM slot compatibility before installing.
Type resolution
The tool resolves device types from PT’s internal numeric type codes to human-readable labels. If PT returns an"unknown" type name, the tool falls back to the catalog (resolve_model) to determine the category from the model name:
| PT type code | Label |
|---|---|
| 0 | Router |
| 1 | Switch |
| 7 | AccessPoint |
| 8 | PC |
| 9 | Server |
| 16 | L3 Switch |
| 17 | Laptop |
| 18 | Tablet |
Bridge requirement
pt_query_topology requires the HTTP bridge to be active and PTBuilder to be polling. It uses a long-poll round-trip (GET /result with a 10-second timeout) to wait for PT to return the topology data. If the bridge is up but PT is not connected, the tool returns the bridge error message.
Call
pt_bridge_status first if you are unsure whether the bridge is active. A 10-second timeout with no response typically means PT is open but the bootstrap is not running.Runtime patches dependency
Before executingqueryTopology(), the tool ensures the runtime patches are injected into PT (idempotent — sent only once per PT session). The patches define queryTopology itself as a bridge-aware function that serializes the current device list and posts it back via reportResult(...). If the patches are not applied, queryTopology will not be defined in the Script Engine and the call will time out.
See also
pt_set_port is an additional live tool (not shown in the sidebar) that sets low-level port attributes — bandwidth, duplex, description, MAC address, and power state — on an existing device in PT via the bridge. Use pt_send_raw with a custom ipc call if you need to inspect or set attributes not covered by the standard tools.