pt_run_js
Execute custom JavaScript in Packet Tracer's Script Engine to access the IPC API and return the last expression as a JSON-serializable value.
Instructions
Escape hatch: evaluate raw JavaScript in Packet Tracer's Script Engine.
The full IPC API is available as ipc (e.g. ipc.network().getDeviceCount()) and the
helper object PTMCP. The value of the last expression is returned; it must be
JSON-serializable (convert IPC objects to strings/numbers).
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": "pt_run_js"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| timeout | No |