pt_send_raw
Execute custom JavaScript in Packet Tracer to explore the IPC API or run commands, with optional result waiting via reportResult().
Instructions
Send arbitrary JavaScript to Packet Tracer via bridge. Useful for exploring the IPC API or running custom commands.
If wait_result=True, reportResult() is auto-injected into scope. Just call reportResult(data) in your code — no need to define it. Examples: pt_send_raw("reportResult(getDevices('router'))", wait_result=True) pt_send_raw("addDevice('TestR','2911',500,300)")
Parameters:
js_code: JavaScript to execute in PT's Script Engine
wait_result: if True, waits for a response via reportResult()
Refused: activity password material (getHashedPassword, getChallengeKeyAsBase64, getChallengeKeyAsInts) and reading the bytes of a .pka/.pkt.
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": {
"js_code": "<js_code>"
},
"name": "pt_send_raw"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| js_code | Yes | ||
| wait_result | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |