add_node
Add new nodes to draw.io diagrams using predefined shapes or custom styles. Control x/y coordinates, label, size, and page index for precise placement.
Instructions
Add a new node (shape/vertex) to a draw.io diagram. Use the "shape" parameter for predefined styles, or provide a custom "style" string.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | X position (default: 0) | |
| y | No | Y position (default: 0) | |
| id | No | Custom ID for the node (auto-generated if not provided) | |
| label | Yes | Text label displayed inside the node | |
| shape | No | Predefined shape name. Available: rectangle, roundedRectangle, ellipse, diamond, parallelogram, hexagon, triangle, cylinder, cloud, document, process, star, callout, actor, component, package, interface, start, end, decision, processStep, inputOutput, server, database, firewall, user, container, blue, green, red, yellow, purple, orange, gray | |
| style | No | Custom draw.io style string (overrides shape if both provided) | |
| width | No | Width in pixels (default: 120) | |
| height | No | Height in pixels (default: 60) | |
| filePath | Yes | Path to the .drawio file | |
| pageIndex | No | Page index to add to (0-based, default: 0) |