node
Manage GNS3 lab devices by listing, creating, deleting, and configuring them; use wildcard or bulk patterns to control state and apply properties safely.
Instructions
Manage GNS3 nodes (CRUD operations)
v0.47.0: CRUD-style consolidation of create_node, delete_node, and set_node. v0.40.0: Enhanced with wildcard and bulk operation support.
Actions: - list: List nodes in a project - create: Create new node from template at specified coordinates - delete: Delete node(s) from project (WARNING: destructive, cannot be undone) - set: Configure node properties and/or control state (supports wildcards/bulk)
Wildcard Patterns (for 'set' and 'delete'): - Single node: "Router1" - All nodes: "" - Prefix match: "Router" (matches Router1, Router2, RouterCore) - Suffix match: "*-Core" (matches Router-Core, Switch-Core) - Character class: "R[123]" (matches R1, R2, R3) - JSON array: '["Router1", "Router2", "Switch1"]'
Delete safety: - A pattern delete without confirm=True deletes nothing and returns 'matched_nodes' (dry run); repeat with confirm=True to delete them - A single name or a JSON array of names deletes at once - Several nodes return a BatchOperationResult; names not in the project are skipped
Validation Rules: - name parameter requires node to be stopped - Hardware properties (ram, cpus, adapters, hd*_disk_image, cdrom_image, options) apply to both 'create' and 'set'; disk/cdrom/options are QEMU-only - Disk slots: hda = boot disk, hdb = 2nd, hdc = 3rd (via properties), hdd = 4th - Values GNS3 did not apply are reported ('unapplied_properties' / warning) - never silent - For IOU nodes, 'adapters' maps to 'ethernet_adapters' automatically - ports parameter applies to ethernet_switch nodes only - state_action values: start, stop, suspend, reload, restart
Returns: Single node: Status message Multiple nodes: BatchOperationResult JSON with per-node success/failure
Examples: # List nodes in project >>> node(action="list", project_id="abc-123") >>> node(action="list", project_id="abc-123", format="json")
# Create new node
>>> node(action="create", template_name="Alpine Linux", x=100, y=200)
>>> node(action="create", template_name="Cisco IOSv", x=300, y=400, node_name="R1", properties={"ram": 1024})
>>> node(action="create", template_name="Ubuntu Cloud Guest", x=0, y=0, node_name="ops1",
... ram=12288, cpus=6, adapters=2, hda_disk_image="ops1.qcow2", cdrom_image="seed.iso")
# Delete nodes
>>> node(action="delete", node_name="Router1")
>>> node(action="delete", node_name='["R1", "R2"]')
>>> node(action="delete", node_name="*") # lists matches only
>>> node(action="delete", node_name="*", confirm=True) # deletes every node
# Start all nodes
>>> node(action="set", node_name="*", state_action="start")
# Stop all routers
>>> node(action="set", node_name="Router*", state_action="stop")
# Configure node properties
>>> node(action="set", node_name="R1", x=100, y=200, ram=2048)
>>> node(action="set", node_name="ops1", hda_disk_image="ops1-60G.qcow2", options="-cpu host")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": {
"action": "<action>"
},
"name": "node"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | X coordinate (top-left corner of node icon) | |
| y | No | Y coordinate (top-left corner of node icon) | |
| z | No | Z-order layer for overlapping nodes | |
| ram | No | RAM in MB (QEMU nodes only) | |
| cpus | No | Number of CPUs (QEMU nodes only) | |
| name | No | New name (REQUIRES node stopped) | |
| ports | No | Number of ports (ethernet_switch nodes only) | |
| action | Yes | Action: 'list' (list nodes), 'create' (new node), 'delete' (remove node), or 'set' (configure/control node) | |
| format | No | Output format: 'table' (default) or 'json' (for 'list' action) | table |
| locked | No | Lock position to prevent GUI moves | |
| confirm | No | 'delete' with a wildcard pattern: True deletes every match; False (default) only lists the matches | |
| options | No | Extra QEMU command-line options, e.g. '-cpu host' | |
| adapters | No | Network adapters (QEMU: adapters, IOU: ethernet_adapters) | |
| parallel | No | Execute operations concurrently (default: True for start/stop/suspend) | |
| node_name | No | Node name, wildcard pattern ('*', 'Router*', 'R[123]'), or JSON array ('["R1","R2"]'). Required for 'delete' and 'set' | |
| compute_id | No | Compute server ID (for 'create') | local |
| project_id | No | Project ID (required for 'list') | |
| properties | No | Raw GNS3 node properties for 'create' and 'set' (e.g. {'ram': 4096, 'hdc_disk_image': 'x.qcow2', 'adapter_type': 'virtio-net-pci'}). Keys GNS3 does not apply are reported back | |
| cdrom_image | No | CD-ROM ISO image, e.g. cloud-init seed (QEMU only) | |
| console_type | No | Console type: telnet/vnc/spice | |
| state_action | No | State control action for 'set': 'start' (boot), 'stop' (shutdown), 'suspend' (pause), 'reload' (reboot), 'restart' (stop then start) | |
| template_name | No | Template name (required for 'create', e.g., 'Alpine Linux', 'Cisco IOSv') | |
| hda_disk_image | No | Primary (boot) disk image, QEMU 'hda' slot (QEMU only) | |
| hdb_disk_image | No | Second disk image, QEMU 'hdb' slot (QEMU only) | |
| hdd_disk_image | No | FOURTH disk image, QEMU 'hdd' slot - not the boot disk (QEMU only) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |