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_fix_plan is the automatic repair tool in the MCP Packet Tracer pipeline. It takes a TopologyPlan JSON — typically one that has just been flagged by pt_validate_plan — and applies three sequential fix passes: correcting wrong cable types based on device categories, upgrading router models when they do not have enough GigabitEthernet ports for their declared links, and reassigning invalid port names to the first available valid port on each device. After all fixes are applied, the plan is re-validated internally and the corrected plan is returned alongside a list of every change made.
Parameter
The
TopologyPlan serialized as a JSON string — the direct output of pt_plan_topology or pt_validate_plan. The tool does not require the plan to be valid before it starts; it attempts corrections regardless of the current error state.What the Auto-Fixer Corrects
1. Wrong Cable Types (INVALID_CABLE_TYPE)
The fixer inspects every link and checks whether the cable type matches the expected type inferred from the two device categories. The inference rules mirror Cisco’s real-world cabling guidelines:
| Connection | Correct Cable |
|---|---|
| Router ↔ Router | cross (crossover) |
| Router ↔ Switch | straight |
| Router ↔ Cloud (WAN) | straight |
| Router ↔ Firewall | cross |
| Switch ↔ PC / Laptop / Server | straight |
| Switch ↔ Access Point | straight |
| Switch ↔ Switch | cross |
straight for a router-to-router link, the fixer silently changes it to cross and records the change.
2. Router Model Upgrades (INSUFFICIENT_PORTS)
When a router has more links than its model’s GigabitEthernet port count allows, the fixer upgrades the model to the 2911 (which has 3 GigabitEthernet ports). For example, a 1941 (2 GigE ports) used as a hub router in a triangle topology with 3 links will be upgraded automatically. The fix is recorded with the original model name and the number of ports required.
3. Port Reassignment (INVALID_PORT)
If a link references a port name that does not exist on the device model (e.g. GigabitEthernet0/5 on a 2911 that only has Gig0/0 through Gig0/2), the fixer replaces it with the first available port on that device that is not already used by another link.
Returns
List of human-readable strings describing each correction that was applied. Empty if no changes were needed.
Total number of individual corrections applied.
true if the plan has no remaining errors after the fix passes.The corrected
TopologyPlan as a JSON object. Pass JSON.stringify(result.plan) (or the equivalent in your client) to downstream tools.Typical Fix Workflow
The recommended pattern is to validate first, fix, then validate again to confirm:Example Response
The auto-fixer handles the most common LLM-induced errors automatically: cable type confusion, port exhaustion on default router models, and off-by-one port indexing. It does not fix IP conflicts, subnet overlaps, or missing devices — those require re-planning with different parameters via
pt_plan_topology.