Skip to main content
Glama

Add Diagram

add_diagram
Idempotent

Attach a Mermaid diagram that explains the logic or structure behind a change, so the reviewer can follow it without reading the diff. OPTIONAL — add one only when it clarifies something a list of endpoints or screenshots cannot: a decision tree or branching rule, a multi-step flow, a state machine, a call sequence, or how the touched modules, tables or classes relate. Skip it for simple changes.

Types (first line of source): flowchart TD (decision trees, flows, dependency maps), stateDiagram-v2, sequenceDiagram, classDiagram, erDiagram. No %%{init} directives or click handlers. Keep it small: about 15 nodes or fewer, short labels, one idea per diagram. Quote labels that contain punctuation, e.g. A["No tax line?"]. Mark what changed in flowcharts and state diagrams by tagging nodes :::added, :::changed or :::removed (e.g. B["Retry with backoff"]:::changed) — Damper colours them; do not add your own classDef colours. Before/after: for a changed flow pass beforeSource with the previous diagram. Upserts by key (default: slug of the title); calling again with the same key replaces the diagram. Never put secrets or real customer data in labels.

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": {
      "projectId": "<projectId>",
      "taskId": "<taskId>",
      "title": "<title>",
      "source": "<source>"
    },
    "name": "add_diagram"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyNoStable identity (default: slug of the title). Reuse it to replace.
groupNoOptional grouping label, e.g. the feature or module
titleYesShort label, e.g. "VOD booking type by tax line"
changeNoadded = new endpoint/page, changed = existing one behaves or looks different, removed = gone (default: changed)
sourceYesMermaid source, starting with the diagram type, e.g. "flowchart TD\n A[Start] --> B{Tax line?}"
taskIdYes
projectIdYesProject ID. Use list_projects to find available project IDs.
descriptionNoWhat the diagram shows and what to check
beforeSourceNoFor changed flows: the Mermaid source before your change

Output Schema

NameRequiredDescriptionDefault
artifactYes
replacedYes
dashboardUrlNoFull dashboard URL of the affected resource

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already mark this as a non-read-only, idempotent, non-destructive mutation, and the description adds important operational context beyond that: diagrams upsert by key and replace the previous diagram on reuse, beforeSource supports before/after flows, and labels must not contain secrets or real customer data. It also discloses formatting constraints such as no init directives, no click handlers, and no custom classDef colours.

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 front-loaded with purpose and optionality, then uses bold labels for Types, size limits, change marking, before/after, upsert behavior, and safety. Despite its length, every section provides actionable constraints or routing guidance for a complex nine-parameter diagram tool.

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?

Given the complex schema, existing output schema, and annotations, the description covers the remaining gaps an agent needs: when to use the tool, supported diagram types, size expectations, before/after handling, replacement semantics, and safety constraints around secrets. Nothing material for correct invocation appears missing.

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 description coverage is 89%, so the baseline is 3. The description meaningfully supplements the schema by enumerating supported Mermaid diagram types, explaining when to use beforeSource, describing key-based replacement, and showing how to tag changed nodes with :::added, :::changed, or :::removed, though some parameters such as group and description are left mainly to 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 states a specific verb and resource: attach a Mermaid diagram explaining logic or structure behind a change. It also distinguishes the tool from related artifacts by saying it is for cases a list of endpoints or screenshots cannot clarify, so an agent can tell it apart from add_screenshot and add_api_example.

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 frames the tool as OPTIONAL and gives concrete when-to-use criteria: decision trees, branching rules, multi-step flows, state machines, call sequences, or module/table/class relationships. It also gives a clear when-not-to-use rule: skip it for simple changes.

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.

Resources