Skip to main content
Glama

Change a diagram

edit_diagram

Change a diagram already on screen by adding, updating, moving or removing nodes and edges. Use it after user edits, comments or asks about a node to apply refinements in order.

Instructions

Change a diagram that is already on screen. Use it after the user edits, comments on or asks about a node, and for any refinement. Do not call visualize again for that. Ops apply in order and address nodes by id. A new node's id can be used by later ops in the same call. The open diagram updates itself.

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": {
      "docId": "<docId>",
      "ops": "<ops>"
    },
    "name": "edit_diagram"
  }
}

Input Schema

NameRequiredDescriptionDefault
opsYes
docIdYesThe docId a visualize result gave you

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare the mutation profile (readOnlyHint=false, openWorldHint=false), and the description adds real behavioral context beyond them: ops apply in order, nodes are addressed by id, ids minted in one op are usable later in the same call, and the open diagram self-updates. It stops short of saying whether changes persist or require save_state, and never warns that remove_node takes the subtree and edges with it - relevant since destructiveHint=false understates that op.

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

Conciseness5/5

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

Five short sentences, each carrying distinct information: scope, trigger, anti-pattern, execution semantics, id semantics, and live-update effect. The routing constraint is front-loaded and there is no filler.

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

Completeness4/5

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

For a multi-op mutating tool with no output schema, it covers invocation, ordering, and addressing well enough to call correctly. What is missing is persistence semantics (does an edit need save_state?) and a caution about destructive subtree removal, both of which an agent would want before issuing a batch of ops.

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?

Top-level schema coverage is only 50%, but the description fills the most important semantic gap: ordering of ops and id-resolution across ops within a single call, which the schema does not express. docId is left to the schema, which already explains it as 'The docId a visualize result gave you', so the omission costs little.

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?

States a specific verb and resource scoped to state: 'Change a diagram that is already on screen'. It explicitly partitions work against the sibling visualize tool ('Do not call visualize again for that'), so an agent can pick correctly between the two without opening either schema.

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?

Gives concrete triggers ('after the user edits, comments on or asks about a node, and for any refinement') plus an explicit exclusion ('Do not call visualize again for that'). The when-to-use and when-not-to-use conditions are both stated, which is rare and directly actionable.

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