Skip to main content
Glama

draw_group

Draws ONE region of the diagram in a single call: a container, the nodes inside it, and the edges that touch those nodes. This is THE way to build a diagram in a live document. A human is watching the canvas, and the server draws the items one at a time in the order a person would — the container, then each node followed at once by its edges — at a readable pace (a call takes about 0.7 s per item before it returns). Build a diagram as a series of draw_group calls, one region per call, issued ONE AFTER ANOTHER (never in parallel): finish a region before starting the next, and position each new region from the previous result's nextFree. Never create all the containers first, then all the nodes, then all the connections. The result reports where things landed: "placed" (centre x/y and size w/h), the "container" box grown around its nodes, "overlaps" when something landed on top of something else, "nextFree" (top-left corners of clear space to the right of and below the whole diagram — positions are centres, so add half your region's width/height), and sometimes a "hint" — act on it. Layout: nodes are about 150 wide × 50 tall; space node centres ~180 apart horizontally and ~100–160 vertically; leave 60–100 units of clear space between the EDGES of neighbouring containers (a container extends ~40 beyond its outermost nodes, plus a label strip on top), and size each region from its own node count rather than using one uniform grid. Everything is validated before anything is drawn. At most 25 items (container + nodes + connections) per call — split a larger region. Also usable without "container" to add free-standing nodes and edges, or nodes into an existing container (set node.container). Requires a valid editor access token.

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": {
      "token": "<token>",
      "agentId": "<agentId>"
    },
    "name": "draw_group"
  }
}

Input Schema

NameRequiredDescriptionDefault
nodesNoThe nodes of this region, in the order they should appear (follow the flow: source before target). Give each its final x/y.
tokenYesEditor access token for this document. The document ID is embedded in the token.
agentIdYesYOUR AI assistant name (e.g. "Claude.ai", "GitHub Copilot"). Shown as "[agentId] working with [userName]" in the collaboration presence dot.
userNameNoFirst name of the human you are assisting (ask them at session start if you do not know). Shown in the collaboration presence dot as "[agentId] working with [userName]".
containerNoOptional: the NEW container this region is drawn in. Nodes in this call go inside it unless they set their own "container". Omit to draw free-standing nodes, or to add to a container that already exists.
connectionsNoEdges touching this region. Each end may be a node or container in this call OR one already on the canvas — so include the edges that link this region back to earlier ones. Each edge is drawn the moment both of its ends exist.
action_explanationNoOptional: what this region is and why (max 250 chars). Shown live to human collaborators in the AI cursor tooltip while it is drawn.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Well beyond the annotations, it discloses the drawing order (container, then each node with its edges), the pacing (~0.7 s per item before return), that everything is validated before anything is drawn, the 25-item ceiling, and the valid-editor-token requirement. It also enumerates the return payload (placed, container, overlaps, nextFree, hint) even though no output schema exists, and explains that nextFree positions are top-left corners where coordinates elsewhere are centres.

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 first sentence front-loads the core purpose and the rest is sequenced meaningfully: what it does, how to call it, what comes back, then layout numbers and limits. It is dense and long for a description, with a couple of parenthetical asides, but nearly every sentence carries operational information an agent would otherwise get wrong.

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

Completeness5/5

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

For a 7-parameter mutating tool with nested objects and no output schema, the description covers the sequencing model, concurrency prohibition, item limits, layout constants, validation behavior, auth requirement, and the shape of the response. Nothing material an agent needs to call it correctly is left to inference.

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 already 100%, so the baseline is 3; the description earns above that by adding layout semantics the schema lacks — nodes ~150x50, centres ~180 apart horizontally and ~100–160 vertically, 60–100 units of clear space between container edges, containers extending ~40 past outermost nodes. It also clarifies the centre-vs-top-left conversion for nextFree and that nodes may target an existing container via node.container.

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?

"Draws ONE region of the diagram in a single call: a container, the nodes inside it, and the edges that touch those nodes" names a specific verb, a specific unit of work (a region), and exactly what that unit contains. The capitalized "ONE" and the later "This is THE way to build a diagram in a live document" make the scope unmistakable and implicitly rule out the primitive add_node/add_container route.

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

Usage Guidelines4/5

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

Guidance is unusually concrete: issue calls one after another, never in parallel, finish a region before starting the next, position each region from the previous result's nextFree, never create all containers first, and split regions over 25 items. It also states the no-container case for free-standing nodes or adding into an existing container. The only gap is that the alternative sibling tools (add_node, add_connection, add_container) are never named, so an agent must infer that this tool supersedes them.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.