executeBuilderCode
Run PTBuilder JavaScript in Packet Tracer to automate network setup, batch add devices, and configure IPs or IOS devices programmatically.
Instructions
Execute PTBuilder JavaScript code in Packet Tracer. The code can use PTBuilder functions like addDevice, addLink, configurePcIp, configureIosDevice, etc. This is useful for batch operations and programmatic network building.
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": {
"code": "<code>"
},
"name": "executeBuilderCode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript code to execute. Can use PTBuilder functions: addDevice(name, model, x, y), addLink(dev1, port1, dev2, port2, type), configurePcIp(name, dhcp, ip, mask, gateway, dns), configureIosDevice(name, commands), getDevices(filter, startsWith) |