Skip to main content
Glama

diagram

Document a routine start to end as a graph, storing each step as a linked object with its own notes so processes stay traceable and reviewable.

Instructions

Document what a routine does, start to end, as a graph. Stored as type='diagram'.

For a PROCESS, not a fact: note() records what is true, checkpoint() where the work stands, this one how a routine runs. Every step is a separate object that can carry its own explanation and its own links to other memories, which is what makes a diagram the source of truth for its domain instead of one more wall of prose.

Keep every label objective -- what happens at that step, nothing more. The reasoning, caveats and history belong in that node's note, where they explain without cluttering the flow.

review_after and source_ref matter most for a flow: it describes code, and the code moves.

Returns {"uid": ...}, or {"ok": False, "errors": [...]} with nothing written at all. Node positions are computed and stored server-side, so the flow renders identically for every reader -- see get_diagram().

Input Schema

NameRequiredDescriptionDefault
alsoNoother domain paths this flow belongs to, comma-separated. `domain` is the routine's own place in the tree; `also` is for the flows that run ACROSS routines -- several of them can be steps of one end-to-end process without any of them being the parent of the others. Cross-list each into that process's path and asking about it returns all of them, instead of hoping one search phrasing reaches every one.
kindNo'flowchart', the only kind.flowchart
tagsNocomma-separated keywords and synonyms. Retrieval is BM25 over content, tags and domain paths, and tags weigh second only to the body, so they make a memory findable by words its own text never uses: the identifier, the error string, the plain phrasing someone will type. A memory with none is reachable only by quoting itself. At most 1000 characters.
edgesYesthe wires between steps, as [{"from": "load", "to": "check", "label": "optional branch"}].
nodesYesthe steps, as [{"key": "load", "label": "Read the export window", "shape": "step", "note": "optional long explanation"}]. key is a stable id the edges refer to (letters, digits, '_' or '-'); shape is start|step|decision|io|end. Exactly one 'start' is required and every node must be reachable from it. Cycles are allowed -- a retry loop is a real flow, not a mistake.
titleYesone line naming what this memory is about, in the words someone would look for it by. A list shows it instead of the opening of the body, and it outweighs every other field in search, so a title that repeats the type ("note about the parser") names nothing. At most 120 characters; a name that needs more is summarizing the body.
domainNothe subject this belongs to, as a path from the outermost scope in ('acme/x100/p200'). File it as deep as the fact is specific -- a note about one routine goes on the routine, and still comes back when someone asks about the module or the product above it. At most 200 characters.
sessionNogroups what one conversation writes. Leave it empty to use this server process's own stamp.
summaryNoa few sentences on what the routine is for, indexed with the flow.
source_refNowhat the fact came FROM -- a path, a URL, a table name -- so a later pass can check the claim against the thing itself instead of inferring what to check from the wording. At most 500 characters.
review_afterNowhen this stops being safe to trust unchecked, as a date ('2026-11-01') or a span from today ('90d'). pulse() counts what is overdue in a scope as `scope.stale` and optimize_scan lists it. Leave it empty for anything that does not go stale -- most facts do not, and a date nobody meant is worse than none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed23 schema fields changedv0.16.1
    • addedInput schema / properties / also / description
      Added value: +"other domain paths this flow belongs to, comma-separated. `domain` is the routine's own place in the tree; `also` is for the flows that run ACROSS routines -- several of them can be steps of one end-to-end process without any of them being the parent of the others. Cross-list each into that process's path and asking about it returns all of them, instead of hoping one search phrasing reaches every one."
    • removedInput schema / properties / also / title
      Removed value: -"Also"
    • addedInput schema / properties / domain / description
      Added value: +"the subject this belongs to, as a path from the outermost scope in ('acme/x100/p200'). File it as deep as the fact is specific -- a note about one routine goes on the routine, and still comes back when someone asks about the module or the product above it. At most 200 characters."
    • removedInput schema / properties / domain / title
      Removed value: -"Domain"
    • addedInput schema / properties / edges / description
      Added value: +"the wires between steps, as [{\"from\": \"load\", \"to\": \"check\", \"label\": \"optional branch\"}]."
    • removedInput schema / properties / edges / title
      Removed value: -"Edges"
    • addedInput schema / properties / kind / description
      Added value: +"'flowchart', the only kind."
    • removedInput schema / properties / kind / title
      Removed value: -"Kind"
    • addedInput schema / properties / nodes / description
      Added value: +"the steps, as [{\"key\": \"load\", \"label\": \"Read the export window\", \"shape\": \"step\", \"note\": \"optional long explanation\"}]. key is a stable id the edges refer to (letters, digits, '_' or '-'); shape is start|step|decision|io|end. Exactly one 'start' is required and every node must be reachable from it. Cycles are allowed -- a retry loop is a real flow, not a mistake."
    • removedInput schema / properties / nodes / title
      Removed value: -"Nodes"
    • addedInput schema / properties / review_after / description
      Added value: +"when this stops being safe to trust unchecked, as a date ('2026-11-01') or a span from today ('90d'). pulse() counts what is overdue in a scope as `scope.stale` and optimize_scan lists it. Leave it empty for anything that does not go stale -- most facts do not, and a date nobody meant is worse than none."
    • removedInput schema / properties / review_after / title
      Removed value: -"Review After"
    • addedInput schema / properties / session / description
      Added value: +"groups what one conversation writes. Leave it empty to use this server process's own stamp."
    • removedInput schema / properties / session / title
      Removed value: -"Session"
    • addedInput schema / properties / source_ref / description
      Added value: +"what the fact came FROM -- a path, a URL, a table name -- so a later pass can check the claim against the thing itself instead of inferring what to check from the wording. At most 500 characters."
    • removedInput schema / properties / source_ref / title
      Removed value: -"Source Ref"
    • addedInput schema / properties / summary / description
      Added value: +"a few sentences on what the routine is for, indexed with the flow."
    • removedInput schema / properties / summary / title
      Removed value: -"Summary"
    • addedInput schema / properties / tags / description
      Added value: +"comma-separated keywords and synonyms. Retrieval is BM25 over content, tags and domain paths, and tags weigh second only to the body, so they make a memory findable by words its own text never uses: the identifier, the error string, the plain phrasing someone will type. A memory with none is reachable only by quoting itself. At most 1000 characters."
    • removedInput schema / properties / tags / title
      Removed value: -"Tags"
    • addedInput schema / properties / title / description
      Added value: +"one line naming what this memory is about, in the words someone would look for it by. A list shows it instead of the opening of the body, and it outweighs every other field in search, so a title that repeats the type (\"note about the parser\") names nothing. At most 120 characters; a name that needs more is summarizing the body."
    • removedInput schema / properties / title / title
      Removed value: -"Title"
    • removedInput schema / title
      Removed value: -"diagramArguments"
  2. Addedv0.1.1

TDQS

A4.5/5.0
Behavior4/5

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

With annotations already declaring the write/safe/idempotency profile, the description adds real behavior beyond them: 'Returns {"uid": ...}, or {"ok": False, "errors": [...]} with nothing written at all' discloses atomic all-or-nothing semantics, and 'Node positions are computed and stored server-side' explains layout determinism. It stops short of touching auth, quota, or conflict handling, so it is strong but not exhaustive.

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?

Purpose and the sibling contrast are front-loaded, and the guidance paragraphs are separated cleanly. It is on the long side, though: the aside that a diagram becomes 'the source of truth for its domain instead of one more wall of prose' is rhetorical padding that does not help an agent call the tool.

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 an 11-parameter create tool with full schema coverage and no output schema, the description supplies what the schema cannot: the process-vs-fact routing, atomic failure behavior, and server-side layout. Nothing essential is missing, though it leaves session/domain interaction and the meaning of the required 'edges' shape entirely to the schema.

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 100%, so the baseline is 3; the description adds meaning on top by instructing that 'label' be objective and that reasoning/caveats/history belong in that node's 'note', and by flagging that 'review_after and source_ref matter most for a flow: it describes code, and the code moves.' That is genuine parameter guidance rather than restatement of 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?

Opens with a specific verb and resource: 'Document what a routine does, start to end, as a graph. Stored as type='diagram'.' It then directly names the two nearest siblings (note(), checkpoint()) and the distinct resource each owns, so an agent can separate this from them without opening a 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?

Explicitly frames the when/when-not: 'For a PROCESS, not a fact: note() records what is true, checkpoint() where the work stands, this one how a routine runs.' That is an explicit alternative-selection rule plus an implied exclusion (do not use this for facts or status), and it points to get_diagram() for the read side.

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