Export PTBuilder script
export_scriptWrites the generated PTBuilder script for the current topology to a .js or .txt file, so users can run it in Packet Tracer instead of copying code from chat.
Instructions
Write the PTBuilder script for the current topology to a file, for users who prefer a file to copying from chat. Use an absolute path: relative paths resolve against $MCP_TRACER_DIR if set, else the server's working directory (now /app), which MCP clients often set arbitrarily. "~" is the user's home directory. Same validation as generate_script: errors block the export unless force: true. Refuses to replace an existing file unless overwrite: true. The user then copies the whole file into Extensions > Builder Code Editor in a new, empty Packet Tracer workspace and clicks Run.
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": {
"path": "<path>"
},
"name": "export_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File to write, e.g. C:\labs\vlans.js. Only .js or .txt file names are accepted; .js is added when the file name has no extension. Absolute path recommended. | |
| force | No | Export even if validation reports errors. | |
| overwrite | No | true = replace the file if it already exists. |