Skip to main content
Glama

Edit Mermaid diagram

mutate
Read-onlyIdempotent

Apply a list of structured edit ops to an existing Mermaid source and return the edited diagram. This is the declarative counterpart to execute: plain JSON in, plain JSON out, no sandbox. Prefer it for straightforward edits; reserve execute for logic the ops don't express. Returns { ok, family, source, verify:{ ok, warnings } } on success, or { ok:false, family, opIndex, error } — where error names the offending field and lists the valid ones — when an op is malformed or cannot apply. Ops apply in order and are all-or-nothing: the first failing op stops the batch (its position is opIndex) and the input is left untouched. Each op is { "kind": , …fields }. Call describe_sdk for the detected family before authoring unfamiliar ops; it returns compact signatures or exact field types, enum values, defaults, and constraints.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opsYesNon-empty ordered list of edit ops; each is { kind, ...fields }.
sourceYesMermaid source to edit.

TDQS

A5/5.0
Behavior5/5

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

Even though annotations already declare the tool read-only and idempotent, the description adds crucial behavioral details: ops apply in order, are all-or-nothing, the first failing op stops the batch, and the input is left untouched. It also specifies the exact error shape and that `opIndex` indicates the failing op. No contradiction with 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?

Every sentence contributes unique information: purpose, relationship to `execute`, usage guidance, return/error behavior, and op format. The description is detailed but tightly structured, front-loaded with the core purpose and followed by necessary qualifications.

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?

With no output schema, the description fully specifies success and failure return shapes, the meaning of `opIndex`, and the all-or-nothing behavior. It also references `describe_sdk` for op signatures, making it complete for a complex mutation tool with a generic item schema. Sibling tool distinctions are clearly handled.

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

Parameters5/5

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

The schema only defines `source` and `ops` generically, but the description adds essential semantics: each op is `{ kind, ...fields }`, ops are ordered, and the batch is atomic. It also explains how the parameters relate to the output and error handling, going well beyond the schema's coverage.

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 leads with a specific verb and resource: 'Apply a list of structured edit ops to an existing Mermaid source and return the edited diagram.' It clearly distinguishes itself from the sibling `execute` by calling itself the declarative counterpart, making its role 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?

Explicit guidance is provided: prefer `mutate` for straightforward edits and reserve `execute` for logic the ops don't express. It also advises calling `describe_sdk` before authoring unfamiliar ops, giving clear when-to-use and when-not-to-use instructions.

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.

TDQS

A4.4/5.0
Disambiguation4/5

Most tools have clear, distinct purposes: build and mutate are separated by create-vs-edit, describe and verify are separated by semantic-explain-vs-validate, and render_* variants differ by output format. The only potential ambiguity is between execute and build/mutate, but the descriptions explicitly steer users away from execute for straightforward structured edits.

Naming Consistency3/5

Tool names mix two conventions: bare verbs (build, describe, execute, mutate, verify) and verb_noun with underscore (describe_sdk, render_ascii, render_png, render_svg). While readable and lower-case throughout, the inconsistency prevents a higher score.

Tool Count5/5

9 tools is well within the 3-15 sweet spot and covers the domain of diagram authoring, editing, inspecting, verifying, and rendering without bloat. Each tool earns its place: build/mutate/execute for editing, describe/verify for analysis, render_* for output, and describe_sdk for schema discovery.

Completeness5/5

The tool set forms a complete lifecycle: create (build), edit (mutate, execute), inspect (describe, verify), and output (render_svg/png/ascii). describe_sdk provides schema discovery so agents can author valid operations. There are no obvious dead ends; even unsupported families are handled gracefully in the broader SDK design.