Skip to main content
Glama

update_diagram

DestructiveIdempotent

Replace a diagram's DBML source or rename it, with validation and base_version conflict checks so newer saved changes are not overwritten.

Instructions

Replace a diagram's DBML source (and/or rename it). This overwrites the whole source — fetch it with get_diagram first if you need to edit rather than replace it outright, and pass its version as base_version so you never overwrite someone else's newer change. New DBML is validated first: errors mean nothing is saved; warnings are returned with the result.

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": {
      "diagram_id": "<diagram_id>"
    },
    "name": "update_diagram"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoNew title. Omit to leave unchanged.
renamesNoTables, columns, enums and table groups this edit renames. Always list them: without it a rename can look like a removed column plus a new one, and a migration generated from the diagram would drop the column and its data instead of renaming it.
diagram_idYesThe diagram id (a UUID), from list_diagrams.
dbml_sourceNoNew full DBML text. Omit to leave unchanged.
base_versionNoThe diagram's `version` from get_diagram. When given, the update is refused if someone else saved since, instead of overwriting their change. Recommended whenever you edit.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.4

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare destructive=true and idempotent=true, but the description adds important behavior: the whole source is overwritten, validation errors mean nothing is saved, warnings are returned, and base_version enables optimistic concurrency refusal. These are material behavioral traits beyond the annotations.

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?

The description is three efficient sentences, front-loading the mutation and overwrite warning before the get_diagram/base_version workflow and validation behavior. Every sentence adds useful information without redundancy.

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 destructive update tool with no output schema, the description covers the key risks: whole-source overwrite, need to fetch before editing, concurrency protection via base_version, and atomic validation with warnings. It provides enough context for correct invocation.

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

Parameters3/5

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

Schema description coverage is 100%, so parameter documentation is already strong. The description reinforces the semantics of dbml_source as a full replacement and base_version as a concurrency guard, but most parameter meaning is already carried by the schema.

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 uses a specific verb and resource: 'Replace a diagram's DBML source (and/or rename it).' It clearly distinguishes replacement from editing via get_diagram and is specific enough for an agent to know this mutates an existing diagram's source.

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?

It explicitly tells the agent to fetch with get_diagram first when editing rather than replacing outright, and to pass the fetched version as base_version to avoid overwriting newer changes. This provides clear when-to-use and workflow guidance rather than leaving alternatives implicit.

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