Skip to main content
Glama

batch_add_elements

Add multiple nodes and edges to a draw.io diagram in one operation, reducing file reads and writes for efficient diagram construction.

Instructions

Add multiple nodes and edges to a draw.io diagram in a single operation. Much more efficient than calling add_node/add_edge individually — performs only one file read and one file write regardless of how many elements are added. Use this for building entire diagrams or adding multiple components at once.

LAYOUT BEST PRACTICES:

  • Space nodes at least 200px apart horizontally and 150px vertically to leave room for edge labels.

  • Use "curved" edgeStyle when multiple edges connect the same nodes or cross over each other.

  • Use exitPoint/entryPoint (e.g. "left", "right", "topLeft25", "bottomRight75") to separate parallel edges.

  • For bidirectional pairs, use offset connection points so the two arrows don't overlap.

  • All edge labels automatically get a white background for readability.

  • Prefer "orthogonal" for structured layouts and "curved" for organic/many-connection layouts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
edgesNoArray of edges to add
nodesNoArray of nodes to add
layoutNoAuto-layout mode. "snake" arranges nodes in boustrophedon (row 1: L→R, row 2: R→L) so edges between consecutive rows are short vertical drops instead of spanning the full width.
filePathYesPath to the .drawio file
snakeOptionsNoOptions for snake layout (only used when layout="snake")
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses key behavior: 'performs only one file read and one file write regardless of how many elements are added' and mentions automatic white background on edge labels. However, it does not specify whether elements are appended to or replace existing content, file-creation behavior, or error handling, leaving notable gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with a clear purpose and efficiency statement, followed by a clearly labeled 'LAYOUT BEST PRACTICES' section. It is longer than minimal, but each sentence provides actionable guidance for layout quality, justifying the length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description provides good context for purpose and usage, but for a complex nested-object tool with no output schema, it omits critical details: whether edges can reference nodes created in the same batch, how existing diagram content is handled (append vs overwrite), and what the return value indicates (success/failure). These gaps make it incomplete for fully reliable use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds valuable guidance beyond the schema, such as 'Space nodes at least 200px apart horizontally and 150px vertically', 'Use "curved" edgeStyle when multiple edges connect the same nodes', and 'Use exitPoint/entryPoint to separate parallel edges.' These best practices help an agent choose appropriate parameter values, exceeding what the schema alone provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Add multiple nodes and edges to a draw.io diagram in a single operation.' It also distinguishes this from sibling tools add_node/add_edge by highlighting efficiency and batching, making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly advises when to use this tool: 'Much more efficient than calling add_node/add_edge individually' and 'Use this for building entire diagrams or adding multiple components at once.' It names alternatives and provides a clear use case, satisfying the when-to-use criterion.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/abossard/drawio-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server