Skip to main content
Glama

diagram

Document a routine start to end as a graph, storing each step with its own notes and links to make process flows the source of truth.

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.

nodes: [{"key": "load", "label": "Read the export window", "shape": "step", "note": "optional long explanation"}] edges: [{"from": "load", "to": "check", "label": "optional branch"}]

key: stable id the edges refer to; letters, digits, '_' or '-'. shape: 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.

also: 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.

review_after and source_ref behave as in note(), and a flow is exactly the kind of memory they are for: 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

TableJSON Schema
NameRequiredDescriptionDefault
alsoNo
kindNoflowchart
tagsNo
edgesYes
nodesYes
titleYes
domainNo
sessionNo
summaryNo
source_refNo
review_afterNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.1

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and delivers: validation constraints (exactly one 'start', all nodes reachable, cycles allowed), atomicity ('nothing written at all' on error), server-side position computation, and the cross-linking semantics of 'also'. This is unusually rich behavioral disclosure for a mutation tool.

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?

Front-loads purpose before the schema examples, and each block (nodes/edges, key rules, also semantics) earns its place for a complex tool. Some sentences lean editorial ('one more wall of prose', 'not a mistake'), which adds length without operational value.

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 tool with no output schema and no annotations, the description covers validation, return shape ({uid} vs {ok:False,errors}), and the linking model well. It falls short only on the auxiliary metadata params (kind, tags, session, summary) that an agent still has to guess at.

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 0%, so the description must compensate, and it does substantial work: node fields (key/label/shape/note), the key character rules, the shape enum (start|step|decision|io|end), edge from/to/label, and the meaning of 'also', 'domain', 'review_after' and 'source_ref'. However 'kind', 'tags', 'session', 'summary' and 'title' remain entirely undocumented, so it does not fully close the gap.

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 ('Document what a routine does, start to end, as a graph') and pins the storage type ('type=\'diagram\''). It explicitly distinguishes itself from siblings note() and checkpoint(), so an agent can select it without opening any 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 an explicit when-to-use rule: 'For a PROCESS, not a fact: note() records what is true, checkpoint() where the work stands, this one how a routine runs.' It names the alternatives and the discriminating condition, leaving nothing to inference.

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