Tools reference
Every tool the Penna connector gives your AI app, with its parameters, exactly as the AI sees them.
These are the tools your AI app gets when you connect it. The in-app assistant uses the same diagram tools, without diagram_id, because it always works on the diagram you have open. Select a tool to see its full description and parameters.
| Tool | What it does | Read-only |
|---|---|---|
get_diagram | Read diagram | Yes |
write_diagram | Replace diagram | No |
edit_diagram | Edit diagram | No |
read_comments | Read comments | Yes |
reply_comment | Reply to a comment | No |
lookup_guidance | Look up guidance | Yes |
list_diagrams | List diagrams | Yes |
open_diagram | Open in the app | No |
create_diagram | Create diagram | No |
read_context | Read business context | Yes |
save_learning | Save learning | No |
update_model | Add to the Model | No |
update_context | Update business context | No |
show_diagram | Show diagram | Yes |
The connector also has load_diagram_card, edit_from_card, which only the diagram card calls, to load its picture and make the changes you make in it. Chats that show the card hide them from the AI.
Tools
Read diagram. Read the diagram as code with every element's id, its checks and how many comments are open, then its kind's rules, syntax and operations in short. Call it before editing if the user may have changed it since you read it. Pass format or between for an export or a JOIN, history for versions, and give the person what comes back.
| Parameter | Type | Required | Description |
|---|---|---|---|
diagram_id | string | Yes | |
format | "bpmn-xml" | "mermaid" | "plantuml" | "postgres" | "mysql" | "sqlserver" | "sqlite" | "oracle" | Instead of the code, this file format as Export writes it. | |
between | array of string | Instead of the code, the JOIN of these two tables as Copy JOIN writes it. | |
history | string | Instead of the code: "list" for the versions Version history lists, or a version's id for what changed since, as Compare lists it, with a schema's migration SQL. |
Replace diagram. Replace the whole diagram with new code in its kind's syntax. Use it to draft a diagram or redo most of one; use edit_diagram for smaller changes. Layout and wiring are automatic. Returns every element's id and the checks, or a line-numbered syntax error.
| Parameter | Type | Required | Description |
|---|---|---|---|
diagram_id | string | Yes | |
markup | string | Yes | The complete diagram, in its kind's code: Flowmark for bpmn (or pasted BPMN XML, unchanged), Sequence code for sequence (or pasted Mermaid or PlantUML, unchanged), Schema code for erd (or pasted SQL or Mermaid, unchanged), Mermaid for flowchart (or pasted PlantUML, unchanged). |
Edit diagram. Apply targeted edits to the diagram. Prefer it to write_diagram for small changes and fixes: it keeps element ids, and the user's comments on them, stable. Use the operations create_diagram and get_diagram list for the diagram's kind. The batch is atomic: if one fails, none apply and the error says what to fix. Returns the updated diagram and its checks.
| Parameter | Type | Required | Description |
|---|---|---|---|
diagram_id | string | Yes | |
operations | array of object | Yes |
Each entry in operations is one of the operations for the diagram's kind.
Read comments. Read the open comments the user left on the diagram's elements, with the elements they are on and their replies: notes for themselves and requests for you.
| Parameter | Type | Required | Description |
|---|---|---|---|
diagram_id | string | Yes |
Reply to a comment. Reply in a comment's thread or resolve it; a reply says it's from you. Resolve only what you've done, once the user agrees.
| Parameter | Type | Required | Description |
|---|---|---|---|
diagram_id | string | Yes | |
comment_id | string | Yes | From read_comments. |
reply | string | ||
resolve | boolean |
Look up guidance. Read a guide: each kind's full syntax ("flowmark" for bpmn, "sequence-code" for sequence, "schema-code" for erd or "flowchart-code" for flowchart), its style and patterns, and reference diagrams for common domains. Read the kind's syntax before your first write_diagram, and a fitting reference before drafting in its domain.
| Parameter | Type | Required | Description |
|---|---|---|---|
topic | "flowmark" | "modeling-style" | "scope-and-detail" | "gateways" | "events-and-exceptions" | "pools-and-messages" | "approval" | "escalation-and-sla" | "layout-and-polish" | "change-management" | "customer-support" | "employee-onboarding" | "incident-management" | "insurance-claims" | "kyc-onboarding" | "loan-origination" | "month-end-close" | "order-to-cash" | "patient-referral" | "permit-application" | "procure-to-pay" | "recruitment" | "returns-and-refunds" | "sequence-code" | "sequence-style" | "api-request" | "cache-aside" | "oauth-sign-in" | "webhook-retries" | "queue-async" | "payment-3ds" | "schema-code" | "schema-style" | "store-schema" | "saas-schema" | "booking-schema" | "billing-schema" | "content-schema" | "history-schema" | "flowchart-code" | "flowchart-style" | "approval-flow" | "troubleshooting-tree" | "retry-loop" | Yes |
List diagrams. List the diagrams in the user's Penna org: diagram_id, name, kind, size, which one is open in the app, and which are shared with the org (can view or can edit).
No parameters.
Open in the app. Open a diagram in the user's app, so they can watch you work. The other tools still act on the diagram_id they're given.
| Parameter | Type | Required | Description |
|---|---|---|---|
diagram_id | string | Yes |
Create diagram. Make a diagram, empty or a copy, open it in the app, and give its diagram_id with its kind's rules and syntax in short.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
from | string | Optional, to copy: a diagram_id, its link, or a template's name. | |
kind | "bpmn" | "sequence" | "erd" | "flowchart" | Yes | The kind the user names, else the one that fits: bpmn for people's work: who does what, in which order, with decisions, hand-offs and messages to customers and partners; sequence for how systems talk: requests, replies and events between apps and services, as in a sign-in or a sync; erd for a database schema: tables, columns, keys and how they relate; flowchart for a flowchart, Mermaid or UML activity: steps and decisions, a sign-up or app flow, troubleshooting, algorithms. When more than one fits, bpmn. |
Read business context. Read the team's business context (with its version), learnings and Model, and the names in the user's diagrams the Model lacks. Call it once per chat, before your first create_diagram, write_diagram or edit_diagram, and use their names and rules over generic ones.
| Parameter | Type | Required | Description |
|---|---|---|---|
kind | "bpmn" | "sequence" | "erd" | "flowchart" | The kind you're working on, for its learnings. Leave out for all. |
Save learning. Save rules about the team's business that the in-app assistant and you follow from now on, such as "Loans over $250k go to the Credit Committee." Only when the user asks you to remember something, or agrees to your offer. About roles, systems and rules: never a person's name, contact details or a secret.
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | The rule, as one standalone sentence under 300 characters. | |
kind | "bpmn" | "sequence" | "erd" | "flowchart" | The kind it's about. Leave out when it holds for every kind. | |
learnings | array of object |
Add to the Model. Add roles, systems or data to the team's Model, or more names or fields to ones it has. Only after the user agreed. The team's names: never a person's name, contact details or a secret. Renaming and removing happen in the app.
| Parameter | Type | Required | Description |
|---|---|---|---|
type | "role" | "system" | "data" | role: a person, role or team. system: an app, service, database or outside organisation's system. data: a thing the business stores, such as an order. | |
name | string | The name the team uses, under 80 characters. An entry of this type and name gets the rest. | |
also_called | array of string | Other names people use for it, such as a table's name. | |
description | string | What it is, in a sentence under 300 characters. | |
fields | array of string | For data: its key fields. | |
entries | array of object | ||
replace_description | boolean | Only when the user asked to change a description; otherwise it's set only if empty. |
Update business context. Write the team's business context: the whole new text, up to 6,000 characters, with your additions merged into read_context's text under its ## headings. Only after the user agreed to it. Never a person's name, contact details or a secret.
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | |
base_version | integer | Yes | The version read_context gave. Refused if the context changed since. |
Show diagram. Show a diagram in the chat as an interactive picture, or a link where the chat can't. When your answer is about part of it, such as what deleting a table touches or the path between two steps, pass those elements' ids in highlight: they stay in ink and the rest fades. Without highlight, not after write_diagram or edit_diagram: they show it after every change themselves.
| Parameter | Type | Required | Description |
|---|---|---|---|
diagram_id | string | Yes | |
highlight | array of string | Optional: the elements your answer is about, by the ids get_diagram lists; a lane, pool or group lights what it holds. |
Prompts
The connector also offers 2 prompts. Your AI app lists them; run one to start a chat that follows its steps. Neither saves anything until you've seen what it found and agreed.
| Prompt | Name | What it does |
|---|---|---|
| Bring my context to Penna | bring_context | Gather what this chat, project and memory know about your business, and save it to Penna after you've seen it. |
| Build my Model in Penna | build_model | Draft the team's Model of roles, systems and data from your diagrams, context and learnings in Penna, and save it after you've reviewed it. |
See Bring your context and Use the Model from your AI app.
Operations
Each entry in edit_diagram's operations is one operation for the diagram's kind, picked by its op field. The AI gets them as text when it creates or reads a diagram, and the server checks each one before applying the batch. The batch is atomic: if one operation fails, none apply.
BPMN process
Add a node. after/before connect it in the same step.
| Parameter | Type | Required | Description |
|---|---|---|---|
type | "startEvent" | "endEvent" | "intermediateCatchEvent" | "intermediateThrowEvent" | "boundaryEvent" | "task" | "userTask" | "serviceTask" | "manualTask" | "scriptTask" | "businessRuleTask" | "sendTask" | "receiveTask" | "callActivity" | "subProcess" | "exclusiveGateway" | "parallelGateway" | "inclusiveGateway" | "eventBasedGateway" | "complexGateway" | Yes | |
name | string | Activities: verb + object. Events: a state. Decision gateways: a question. | |
lane | string | Lane id or name; default: a joined step's. | |
eventDefinition | "none" | "message" | "timer" | "error" | "signal" | "conditional" | "escalation" | "terminate" | "compensation" | "link" | "cancel" | "multiple" | "parallelMultiple" | Events only. | |
timer | string | Timer events: ISO 8601 duration, date or cycle, e.g. P2D, PT4H, R/P1W, or ${field} for a date each case holds, e.g. ${startDate}. | |
trigger | string | Message, signal, error, escalation or link name, when not the event's. A link throw goes on at the catch of that name. | |
attachedTo | string | Boundary events: the activity they attach to (id or name). | |
cancelActivity | boolean | Boundary events and event sub-process starts: false for non-interrupting. | |
documentation | string | Not shown on the diagram. | |
note | string | A note drawn beside it, e.g. "SLA 24 hours"; "" removes it. Not on boundary events. | |
reads | array of string | Data it uses (activities, throw and end events); [] clears. | |
writes | array of string | Data it creates or changes (activities, start and catch events); [] clears. | |
repeat | "none" | "loop" | "parallel" | "sequential" | Activities: loop while a condition holds, or once per item: parallel (at once) or sequential (in turn). | |
properties | array of object | Custom properties (Owner, System), not drawn; [] clears. | |
calls | string | Call activities: the process it runs, by name; "" clears. | |
variant | "none" | "event" | "transaction" | "adHoc" | Sub-processes: an event sub-process (no flows), a transaction, or ad-hoc (its steps run in any order, with no start or end inside). | |
collapsed | boolean | Sub-processes with steps inside: true draws it small with a + and hides its steps; false shows them. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
id | string | Optional id. | |
parent | string | The sub-process it goes in. Default: after/before's. | |
pool | string | Its outside pool; lane is then one of the pool's. Default: after/before's. | |
after | string | Connect from this node: a node id or its exact name. | |
before | string | Connect to this node: a node id or its exact name. | |
flowName | string | Label of the flow from after. | |
condition | string | Condition of the flow from after. |
Change a node's fields.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The node: a node id or its exact name. |
type | "startEvent" | "endEvent" | "intermediateCatchEvent" | "intermediateThrowEvent" | "boundaryEvent" | "task" | "userTask" | "serviceTask" | "manualTask" | "scriptTask" | "businessRuleTask" | "sendTask" | "receiveTask" | "callActivity" | "subProcess" | "exclusiveGateway" | "parallelGateway" | "inclusiveGateway" | "eventBasedGateway" | "complexGateway" | ||
name | string | Activities: verb + object. Events: a state. Decision gateways: a question. | |
lane | string | Lane id or name; default: a joined step's. | |
eventDefinition | "none" | "message" | "timer" | "error" | "signal" | "conditional" | "escalation" | "terminate" | "compensation" | "link" | "cancel" | "multiple" | "parallelMultiple" | Events only. | |
timer | string | Timer events: ISO 8601 duration, date or cycle, e.g. P2D, PT4H, R/P1W, or ${field} for a date each case holds, e.g. ${startDate}. | |
trigger | string | Message, signal, error, escalation or link name, when not the event's. A link throw goes on at the catch of that name. | |
attachedTo | string | Boundary events: the activity they attach to (id or name). | |
cancelActivity | boolean | Boundary events and event sub-process starts: false for non-interrupting. | |
documentation | string | Not shown on the diagram. | |
note | string | A note drawn beside it, e.g. "SLA 24 hours"; "" removes it. Not on boundary events. | |
reads | array of string | Data it uses (activities, throw and end events); [] clears. | |
writes | array of string | Data it creates or changes (activities, start and catch events); [] clears. | |
repeat | "none" | "loop" | "parallel" | "sequential" | Activities: loop while a condition holds, or once per item: parallel (at once) or sequential (in turn). | |
properties | array of object | Custom properties (Owner, System), not drawn; [] clears. | |
calls | string | Call activities: the process it runs, by name; "" clears. | |
variant | "none" | "event" | "transaction" | "adHoc" | Sub-processes: an event sub-process (no flows), a transaction, or ad-hoc (its steps run in any order, with no start or end inside). | |
collapsed | boolean | Sub-processes with steps inside: true draws it small with a + and hides its steps; false shows them. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
parent | string | Move into this sub-process; "" moves out. |
Remove a node and its flows.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The node: a node id or its exact name. |
reconnect | boolean | Bridge a single incoming and outgoing flow. Default true. |
Connect two nodes.
| Parameter | Type | Required | Description |
|---|---|---|---|
source | string | Yes | Source node: a node id or its exact name. |
target | string | Yes | Target node: a node id or its exact name. |
name | string | Label, e.g. a gateway answer. | |
condition | string | Condition expression. | |
isDefault | boolean | The default flow of a gateway or activity. | |
note | string | A note drawn beside it, e.g. "SLA 24 hours"; "" removes it. Not on boundary events. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Change or re-route a flow.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Flow id. Or identify the flow by source and target. | |
source | string | ||
target | string | ||
name | string | ||
condition | string | ||
isDefault | boolean | Make it the default flow. | |
newSource | string | ||
newTarget | string | ||
note | string | A note drawn beside it, e.g. "SLA 24 hours"; "" removes it. Not on boundary events. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Remove a flow.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Flow id. Or identify the flow by source and target. | |
source | string | ||
target | string |
Split a flow with a new node.
| Parameter | Type | Required | Description |
|---|---|---|---|
flow | string | Flow id. Or identify the flow by source and target. | |
source | string | ||
target | string | ||
node | object | Yes |
Add a lane (a role or department).
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Lane name. |
id | string | Optional id. | |
index | integer | Position, 0 = top. | |
note | string | A note drawn beside it, e.g. "SLA 24 hours"; "" removes it. Not on boundary events. | |
parent | string | Lane it's inside; "" for none. | |
pool | string | Outside pool to add it to. Default: parent's party, else the process. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Rename or move a lane.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Lane id or name. |
name | string | ||
index | integer | Position, 0 = top. | |
note | string | A note drawn beside it, e.g. "SLA 24 hours"; "" removes it. Not on boundary events. | |
parent | string | Lane it's inside; "" for none. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Remove a lane.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Lane id or name. |
moveTo | string | Lane to move its nodes to. |
Rename the process or set its documentation.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Process name. | |
documentation | string | Documentation. |
Add an outside party (customer, bank). Your roles are lanes.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The party, e.g. Customer. |
id | string | Optional id. | |
below | boolean | true: below the process; false: above it. | |
beside | string | Pool to sit right of, in its row; "" for its own band. | |
multiple | boolean | Many of this party take part. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Rename or move a pool.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Pool id or name. |
name | string | ||
below | boolean | true: below the process; false: above it. | |
beside | string | Pool to sit right of, in its row; "" for its own band. | |
multiple | boolean | Many of this party take part. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Remove a pool, its steps and messages.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Pool id or name. |
Add a message between parties (steps or pools).
| Parameter | Type | Required | Description |
|---|---|---|---|
source | string | Yes | Sender: a step or pool, by id or name. |
target | string | Yes | Receiver: a step or pool, by id or name. |
name | string | What is sent, e.g. "Pickup request". | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
id | string | Optional id. | |
envelope | "none" | "start" | "reply" | Envelope: start (white) begins an exchange, reply (grey) answers one. | |
note | string | A note drawn beside it, e.g. "SLA 24 hours"; "" removes it. Not on boundary events. |
Rename a message or move an end.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Message id. Or identify the message by source and target. | |
source | string | ||
target | string | ||
name | string | ||
newSource | string | ||
newTarget | string | ||
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
envelope | "none" | "start" | "reply" | Envelope: start (white) begins an exchange, reply (grey) answers one. | |
note | string | A note drawn beside it, e.g. "SLA 24 hours"; "" removes it. Not on boundary events. |
Remove a message.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Message id. Or identify the message by source and target. | |
source | string | ||
target | string |
Add a data object (a document, e.g. Invoice) or store (a system, e.g. CRM) and the steps using it.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | What it is, e.g. Invoice. |
kind | "object" | "store" | object (default) or store. | |
collection | boolean | Data objects: many of them, e.g. Order lines. | |
id | string | Optional id. | |
readBy | array of string | Steps that read it. | |
writtenBy | array of string | Steps that write it. | |
note | string | A note drawn beside it, e.g. "SLA 24 hours"; "" removes it. Not on boundary events. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Rename data, switch object/store, or make it a list.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Data id or name. |
name | string | ||
kind | "object" | "store" | object (default) or store. | |
collection | boolean | Data objects: many of them, e.g. Order lines. | |
note | string | A note drawn beside it, e.g. "SLA 24 hours"; "" removes it. Not on boundary events. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Remove a data object or store, and its uses.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Data id or name. |
Add a note on its own, above the process. Steps, flows, lanes, messages and data have a note field.
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Its text; several lines allowed. |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
id | string | Optional id. |
Change a note's text or colour.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Note id or its text. |
text | string | New text. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Remove a note.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Note id or its text. |
Draw a dashed box round related steps, e.g. a phase. Changes no flow.
| Parameter | Type | Required | Description |
|---|---|---|---|
steps | array of string | Yes | Its steps, by id or name. |
name | string | Its label. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
id | string | Optional id. |
Relabel a group or set its steps.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Group id or label. |
name | string | New label; "" removes it. | |
steps | array of string | The full new list. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Remove a group, keeping its steps.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Group id or label. |
Change the layout, not the process: spacing, or hand-moved steps back. Spacing goes compact, standard, roomy, spacious; "more compact" or "a bit more room" is one step from where each direction is now, two only for "a lot". lookup_guidance("layout-and-polish") says the rest.
| Parameter | Type | Required | Description |
|---|---|---|---|
spacing | "compact" | "standard" | "roomy" | "spacious" | Both ways at once. | |
across | "compact" | "standard" | "roomy" | "spacious" | Between columns. Overrides spacing. | |
down | "compact" | "standard" | "roomy" | "spacious" | Between rows and lanes. Overrides spacing. | |
tidy | boolean | Put every step moved by hand back in its automatic spot. | |
putBack | array of string | Steps, notes, data or groups to put back in their spot (Back to its place). |
How much the canvas draws (Detail): all draws everything, steps draws without data and notes. Only if asked.
| Parameter | Type | Required | Description |
|---|---|---|---|
level | "all" | "steps" | Yes |
Link an element to a diagram it opens, by the diagram's id or exact name; "" unlinks.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
diagram | string |
Sequence diagram
Set the title, number the messages, or set the spacing.
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | The title; "" removes it. | |
autonumber | boolean | Number messages 1, 2, 3. | |
first | integer | The first number; numbers the messages. | |
step | integer | How much each number adds. Default 1. | |
spacing | "compact" | "standard" | "roomy" | "spacious" | How far apart the layout sets shapes: compact, standard (the default), roomy or spacious. Layout only; the code doesn't write it. |
Add a participant: a system, service or role. Messages add the ones they name, so this is for its kind, alias or column.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Its name. |
kind | "participant" | "actor" | "database" | "queue" | "collections" | "boundary" | "control" | "entity" | actor for a person, database for a data store, queue for a queue or topic; collections, boundary, control and entity as in UML. Default participant. | |
alias | string | A short name the code uses for it. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
id | string | Optional id. | |
index | integer | Column, 0 = leftmost. Default: the end. |
Rename a participant, change its kind or alias, or move its column.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The participant: a participant id, alias or name. |
name | string | New name. | |
kind | "participant" | "actor" | "database" | "queue" | "collections" | "boundary" | "control" | "entity" | actor for a person, database for a data store, queue for a queue or topic; collections, boundary, control and entity as in UML. Default participant. | |
alias | string | New alias; "" removes it. | |
index | integer | New column, 0 = leftmost. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Draw a labelled box round participants that belong together, such as one team's services or a trust zone.
| Parameter | Type | Required | Description |
|---|---|---|---|
members | array of string | Yes | The participants it goes round (ids, aliases or names). They move side by side, and out of any other box. |
label | string | Its label, e.g. "Payments provider". | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
id | string | Optional id. |
Change a box's label or the participants it goes round.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The box: its id or label. |
label | string | New label. | |
members | array of string | The full new list. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Remove a box, keeping its participants.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The box: its id or label. |
Add a message. Without a position it goes at the end.
| Parameter | Type | Required | Description |
|---|---|---|---|
from | string | Yes | Sender: a participant id, alias or name. A name the diagram doesn't have adds that participant. |
to | string | Yes | Receiver; the sender for a message to itself: a participant id, alias or name. A name the diagram doesn't have adds that participant. |
text | string | A verb phrase, e.g. "Request token". \n for a line break. | |
arrow | "call" | "reply" | "async" | call waits for an answer, reply is that answer, async doesn't wait. Default call. | |
activate | boolean | The receiver becomes active (++). | |
deactivate | boolean | The sender's activation ends (--). | |
start | "plain" | "arrow" | "found" | arrow for a two-way message; found starts at a filled circle, from outside the diagram when from and to are the same. Default plain. | |
end | "arrow" | "cross" | "lost" | cross for a message that fails; lost ends at a filled circle, out of the diagram when from and to are the same. Default arrow. | |
create | boolean | The message creates the receiver, whose head is drawn level with it. | |
delay | integer | The message takes time to arrive: its line slants down by this many steps, up to 20 (->(2)). 0 for one that arrives at once. Default 0. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
id | string | Optional id. | |
after | string | Put it right after this item: an item id (get_diagram lists them). | |
before | string | Put it right before this item: an item id (get_diagram lists them). | |
fragment | string | Put it at the end of this fragment: an item id (get_diagram lists them). | |
branch | integer | With fragment: which branch, 0 = the first. Default 0. |
Change a message's text, arrow, ends or activation.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The message: an item id (get_diagram lists them). |
from | string | New sender, as in add_message. | |
to | string | New receiver, as in add_message. | |
text | string | A verb phrase, e.g. "Request token". \n for a line break. | |
arrow | "call" | "reply" | "async" | call waits for an answer, reply is that answer, async doesn't wait. Default call. | |
activate | boolean | The receiver becomes active (++). | |
deactivate | boolean | The sender's activation ends (--). | |
start | "plain" | "arrow" | "found" | arrow for a two-way message; found starts at a filled circle, from outside the diagram when from and to are the same. Default plain. | |
end | "arrow" | "cross" | "lost" | cross for a message that fails; lost ends at a filled circle, out of the diagram when from and to are the same. Default arrow. | |
create | boolean | The message creates the receiver, whose head is drawn level with it. | |
delay | integer | The message takes time to arrive: its line slants down by this many steps, up to 20 (->(2)). 0 for one that arrives at once. Default 0. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Add a note. Without a position it goes at the end.
| Parameter | Type | Required | Description |
|---|---|---|---|
on | array of string | Yes | The participants it's on (ids, aliases or names): one, or several for over. |
position | "over" | "left" | "right" | over the participants, or left or right of one. Default over. | |
text | string | Yes | Its text; several lines allowed. |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
id | string | Optional id. | |
after | string | Put it right after this item: an item id (get_diagram lists them). | |
before | string | Put it right before this item: an item id (get_diagram lists them). | |
fragment | string | Put it at the end of this fragment: an item id (get_diagram lists them). | |
branch | integer | With fragment: which branch, 0 = the first. Default 0. |
Change a note's text or where it sits.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The note: an item id (get_diagram lists them). |
on | array of string | The participants it's on (ids, aliases or names): one, or several for over. | |
position | "over" | "left" | "right" | over the participants, or left or right of one. Default over. | |
text | string | New text. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Add a divider that names a phase, e.g. Checkout.
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Its label. |
id | string | Optional id. | |
after | string | Put it right after this item: an item id (get_diagram lists them). | |
before | string | Put it right before this item: an item id (get_diagram lists them). | |
fragment | string | Put it at the end of this fragment: an item id (get_diagram lists them). | |
branch | integer | With fragment: which branch, 0 = the first. Default 0. |
Change a divider's label.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The divider: an item id (get_diagram lists them). |
text | string | Yes | New label. |
Add a ref frame over participants, for an interaction drawn in another diagram.
| Parameter | Type | Required | Description |
|---|---|---|---|
on | array of string | Yes | The participants it spans (ids, aliases or names). |
text | string | Yes | What it refers to, e.g. "Payment". |
id | string | Optional id. | |
after | string | Put it right after this item: an item id (get_diagram lists them). | |
before | string | Put it right before this item: an item id (get_diagram lists them). | |
fragment | string | Put it at the end of this fragment: an item id (get_diagram lists them). | |
branch | integer | With fragment: which branch, 0 = the first. Default 0. |
Change a ref frame's text or participants.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The ref: an item id (get_diagram lists them). |
on | array of string | The participants it's on (ids, aliases or names): one, or several for over. | |
text | string | New text. |
Add a delay: time passing, drawn as a gap in the lifelines.
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | e.g. "2 days later"; may be empty. | |
id | string | Optional id. | |
after | string | Put it right after this item: an item id (get_diagram lists them). | |
before | string | Put it right before this item: an item id (get_diagram lists them). | |
fragment | string | Put it at the end of this fragment: an item id (get_diagram lists them). | |
branch | integer | With fragment: which branch, 0 = the first. Default 0. |
Change a delay's text.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The delay: an item id (get_diagram lists them). |
text | string | Yes | New text. |
Start a participant's activation bar on a line of its own, or end it with active false.
| Parameter | Type | Required | Description |
|---|---|---|---|
participant | string | Yes | The participant: a participant id, alias or name. |
active | boolean | false ends the bar. Default true. | |
id | string | Optional id. | |
after | string | Put it right after this item: an item id (get_diagram lists them). | |
before | string | Put it right before this item: an item id (get_diagram lists them). | |
fragment | string | Put it at the end of this fragment: an item id (get_diagram lists them). | |
branch | integer | With fragment: which branch, 0 = the first. Default 0. |
End a participant's lifeline with a cross.
| Parameter | Type | Required | Description |
|---|---|---|---|
participant | string | Yes | The participant: a participant id, alias or name. |
id | string | Optional id. | |
after | string | Put it right after this item: an item id (get_diagram lists them). | |
before | string | Put it right before this item: an item id (get_diagram lists them). | |
fragment | string | Put it at the end of this fragment: an item id (get_diagram lists them). | |
branch | integer | With fragment: which branch, 0 = the first. Default 0. |
Move an item: a message, note, fragment or other row.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The item: an item id (get_diagram lists them). |
after | string | Put it right after this item: an item id (get_diagram lists them). | |
before | string | Put it right before this item: an item id (get_diagram lists them). | |
fragment | string | Put it at the end of this fragment: an item id (get_diagram lists them). | |
branch | integer | With fragment: which branch, 0 = the first. Default 0. |
Put items that sit next to each other in a fragment: alt for conditions, opt for one optional part, loop for repeats and retries, par for parallel work, break to stop, critical, or group.
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array of string | Yes | The ids of the items. |
kind | "alt" | "opt" | "loop" | "par" | "break" | "critical" | "group" | "seq" | "strict" | "neg" | "ignore" | "consider" | "assert" | "region" | Yes | |
condition | string | The guard or label, e.g. "card declined" or "every 5 minutes". | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
id | string | Optional id. |
Change a fragment's kind, or a branch's condition.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The fragment: an item id (get_diagram lists them). |
kind | "alt" | "opt" | "loop" | "par" | "break" | "critical" | "group" | "seq" | "strict" | "neg" | "ignore" | "consider" | "assert" | "region" | ||
condition | string | New condition. | |
branch | integer | Which branch's condition, 0 = the first. Default 0. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Add an else branch to an alt, an and branch to a par, or an option to a critical.
| Parameter | Type | Required | Description |
|---|---|---|---|
fragment | string | Yes | The fragment: an item id (get_diagram lists them). |
condition | string | Its condition. |
Remove a branch of an alt, par or critical and what it holds.
| Parameter | Type | Required | Description |
|---|---|---|---|
fragment | string | Yes | The fragment: an item id (get_diagram lists them). |
branch | integer | Yes | Which branch, 0 = the first. |
Remove a fragment, keeping what it holds in its place.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The fragment: an item id (get_diagram lists them). |
Remove a participant (with its messages), a box (keeping its participants) or an item (a fragment with what it holds).
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | A participant, box or item id. |
How much the canvas draws (Detail): all draws everything, folded draws fragments folded, messages draws without notes. Only if asked.
| Parameter | Type | Required | Description |
|---|---|---|---|
level | "all" | "folded" | "messages" | Yes |
Link an element to a diagram it opens, by the diagram's id or exact name; "" unlinks.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
diagram | string |
ER diagram
Set the schema's name, database, note, spacing or arrangement, or put tables moved by hand back in place.
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Its name; "" removes it. | |
database | string | PostgreSQL, MySQL, SQL Server, SQLite or Oracle. | |
note | string | A note on the schema; "" removes it. | |
spacing | "compact" | "standard" | "roomy" | "spacious" | How far apart the layout sets shapes: compact, standard (the default), roomy or spacious. Layout only; the code doesn't write it. | |
arrange | "left-to-right" | "stages" | "hub" | "packed" | How the layout arranges tables: left-to-right (the default) follows the foreign keys; stages makes each group a column, ordered the way keys point between them; hub puts the most connected tables in the middle with the rest round them (a star or warehouse schema); packed packs tables into a tight block (few relationships). Lays every table out again, so tables moved by hand go back in place. Layout only; the code doesn't write it. | |
tidy | boolean | Put every element moved by hand back in place (Tidy up). | |
put_back | array of string | Elements to put back in place, by id or name (Back to its place). |
Add a table with its columns. A column's references adds its relationship too.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | snake_case and plural, e.g. order_items. |
columns | array of object | Yes | Its columns, the primary key first. |
schema | string | Its schema, when not the default. | |
group | string | A group id or name to put it in. | |
alias | string | A short name, e.g. o for orders. | |
note | string | What a row is. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
id | string | Optional id. | |
index | integer | Its place among the tables. Default: the end. |
Rename a table, or change its schema, alias, note, group or place.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The table: a table id or name. |
name | string | New name. | |
schema | string | New schema; "" for the default. | |
alias | string | Short name; "" removes it. | |
note | string | "" removes it. | |
group | string | A group id or name; "" takes it out of its group. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
index | integer | New place among the tables. |
Add a column to a table.
| Parameter | Type | Required | Description |
|---|---|---|---|
table | string | Yes | The table: a table id or name. |
name | string | Yes | snake_case, e.g. customer_id. |
type | string | Yes | A type for the database, e.g. integer, bigint, varchar(255), text, timestamp, boolean, decimal(10,2), or an enum's name. |
pk | boolean | Part of the primary key; several columns marked pk make a composite key. | |
unique | boolean | No two rows share a value. | |
not_null | boolean | Every row has a value. | |
increment | boolean | Numbered automatically. | |
default | string | Default value: 0, true, 'draft', or an expression such as now(). "" removes it. | |
note | string | What the column holds, when the name doesn't say. | |
check | string | An SQL expression every value must pass, e.g. price >= 0. "" removes it. | |
references | string | table.column it points at; adds a many-to-one relationship. | |
id | string | Optional id. | |
after | string | Put it right after this column: a column id, or table.column. | |
before | string | Put it right before this column: a column id, or table.column. | |
index | integer | Its place, 0 = first. Default: the end. |
Rename a column, or change its type, key, constraints, default or note.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The column: a column id, or table.column. |
name | string | snake_case, e.g. customer_id. | |
type | string | A type for the database, e.g. integer, bigint, varchar(255), text, timestamp, boolean, decimal(10,2), or an enum's name. | |
pk | boolean | Part of the primary key; several columns marked pk make a composite key. | |
unique | boolean | No two rows share a value. | |
not_null | boolean | Every row has a value. | |
increment | boolean | Numbered automatically. | |
default | string | Default value: 0, true, 'draft', or an expression such as now(). "" removes it. | |
note | string | What the column holds, when the name doesn't say. | |
check | string | An SQL expression every value must pass, e.g. price >= 0. "" removes it. |
Move a column within its table.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The column: a column id, or table.column. |
after | string | Put it right after this column: a column id, or table.column. | |
before | string | Put it right before this column: a column id, or table.column. | |
index | integer | Its place, 0 = first. Default: the end. |
Relate columns: from holds the reference (the foreign key), to is what it points at, usually a primary key.
| Parameter | Type | Required | Description |
|---|---|---|---|
from | Yes | The referencing columns: table.column, or for a composite key table.(a, b) or a list of table.column. | |
to | Yes | The referenced columns: table.column, or for a composite key table.(a, b) or a list of table.column. | |
cardinality | "many-to-one" | "one-to-one" | "many-to-many" | many-to-one: many rows of from point at one row of to (a foreign key). one-to-one: at most one each. many-to-many: better as a junction table. Default many-to-one. | |
name | string | The constraint's name. | |
on_delete | "cascade" | "restrict" | "set null" | "set default" | "no action" | What happens to the referencing rows when the referenced row is deleted. | |
on_update | "cascade" | "restrict" | "set null" | "set default" | "no action" | What happens to the referencing rows when the referenced row is changed. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
id | string | Optional id. |
Change a relationship's columns, cardinality, name or actions, or swap its ends.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The relationship's id. |
from | New referencing columns, as in add_relationship. | ||
to | New referenced columns, as in add_relationship. | ||
cardinality | "many-to-one" | "one-to-one" | "many-to-many" | many-to-one: many rows of from point at one row of to (a foreign key). one-to-one: at most one each. many-to-many: better as a junction table. Default many-to-one. | |
name | string | "" removes it. | |
on_delete | "cascade" | "restrict" | "set null" | "set default" | "no action" | "" | ||
on_update | "cascade" | "restrict" | "set null" | "set default" | "no action" | "" | ||
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
flip | boolean | Swap from and to. |
Add an enum: a type with a fixed list of values. Set a column's type to its name to use it.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | snake_case, e.g. order_status. |
values | array of operations | Yes | Its values, e.g. pending, paid, shipped. Each is a name, or { name, note } to give it a note. |
schema | string | Its schema, when not the default. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
id | string | Optional id. |
Rename an enum or move it to another schema (its columns follow), or replace its values.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The enum's id or name. |
name | string | New name. | |
schema | string | New schema; "" for the default. | |
values | array of operations | The full new list of values; a plain name keeps its note. Each is a name, or { name, note } to give it a note. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Group tables that belong to one area, such as billing or catalog. A table is in one group at most.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Its name. |
tables | array of string | Table ids or names to put in it. | |
note | string | What the area covers. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
id | string | Optional id. |
Rename a group, set its tables, note or colour.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The group's id or name. |
name | string | New name. | |
tables | array of string | The full new list of tables. | |
note | string | "" removes it. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Add an index, or a composite primary key or unique constraint.
| Parameter | Type | Required | Description |
|---|---|---|---|
table | string | Yes | The table: a table id or name. |
columns | array of string | Yes | Column names, or expressions in backticks. |
unique | boolean | A unique index. | |
pk | boolean | The primary key, for one over several columns. | |
name | string | Its name. | |
type | string | btree, hash and the like. | |
note | string | What it's for. |
Change an index's columns, uniqueness, name, type or note.
| Parameter | Type | Required | Description |
|---|---|---|---|
table | string | Yes | The table: a table id or name. |
columns | array of string | Yes | Its columns, as listed now. |
set_columns | array of string | Its new columns. | |
unique | boolean | A unique index. | |
name | string | "" removes it. | |
type | string | btree, hash and the like; "" removes it. | |
note | string | "" removes it. |
Remove an index.
| Parameter | Type | Required | Description |
|---|---|---|---|
table | string | Yes | The table: a table id or name. |
columns | array of string | Yes | Its columns, as listed. |
Add a check constraint across a table's columns. One on a single column is that column's check.
| Parameter | Type | Required | Description |
|---|---|---|---|
table | string | Yes | The table: a table id or name. |
expression | string | Yes | An SQL expression every row must pass, e.g. ends_at > starts_at. |
name | string | The constraint's name. |
Change a table's check constraint.
| Parameter | Type | Required | Description |
|---|---|---|---|
table | string | Yes | The table: a table id or name. |
check | string | Yes | Its name, or its expression as written. |
expression | string | New expression. | |
name | string | New name; "" removes it. |
Remove a table's check constraint.
| Parameter | Type | Required | Description |
|---|---|---|---|
table | string | Yes | The table: a table id or name. |
check | string | Yes | Its name, or its expression as written. |
Add a note of its own to the diagram.
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Its text; several lines allowed. |
name | string | Its name. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
id | string | Optional id. |
Change a note's text, name or colour.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The note's id or name. |
text | string | New text. | |
name | string | New name. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Remove a table (with its relationships), a column (with its relationships), a relationship, an enum, a group (keeping its tables) or a note.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Its id, or table.column for a column. |
How much the canvas draws (Detail): all draws all columns, keys draws keys only, names draws names only. Only if asked.
| Parameter | Type | Required | Description |
|---|---|---|---|
level | "all" | "keys" | "names" | Yes |
Link an element to a diagram it opens, by the diagram's id or exact name; "" unlinks.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
diagram | string |
Flowchart
Set the chart's title, the way it reads or its spacing, or put shapes moved by hand back in place.
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Its title; "" removes it. | |
direction | "TB" | "BT" | "LR" | "RL" | TB top to bottom, LR left to right, BT bottom to top, RL right to left. | |
spacing | "compact" | "standard" | "roomy" | "spacious" | How far apart the layout sets shapes: compact, standard (the default), roomy or spacious. Layout only; the code doesn't write it. | |
tidy | boolean | Put every element moved by hand back in place (Tidy up). | |
put_back | array of string | Elements to put back in place, by id or name (Back to its place). |
Add a node. With after, an arrow from that node to it too.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | A short id for the code, e.g. check_stock. Default: made from the label. | |
label | string | Yes | What it says: a short verb phrase for a step, a question for a decision. \n breaks the line. |
shape | string | A Mermaid shape name: rect (process, default), diam (decision), stadium (start or end), rounded (event), lean-r (input or output), fr-rect (subroutine), hex (preparation), cyl (database), doc (document), sm-circ (UML start), fr-circ (UML end), fork (fork or join), brace (comment); any other Mermaid 11 shape name works too. | |
frame | string | The frame to put it in: a frame id or label. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
after | string | Join it from this node with an arrow: a node id or label. | |
edge_label | string | The label of the arrow from after, e.g. yes. | |
index | integer | Its place in the node list, which sets the reading order. Default: the end. |
Change a node's label, shape, frame, colour or id.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The node: a node id or label. |
label | string | Its new label. | |
shape | string | A Mermaid shape name: rect (process, default), diam (decision), stadium (start or end), rounded (event), lean-r (input or output), fr-rect (subroutine), hex (preparation), cyl (database), doc (document), sm-circ (UML start), fr-circ (UML end), fork (fork or join), brace (comment); any other Mermaid 11 shape name works too. | |
frame | string | The frame to move it to; "" takes it out of its frame. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
new_id | string | A new id for the code; its arrows follow. |
Put a new node on an arrow: the arrow ends at it, and a new arrow goes on from it to where the old one went.
| Parameter | Type | Required | Description |
|---|---|---|---|
edge | string | Yes | The arrow: its id, or from>to. |
id | string | A short id for the code. Default: made from the label. | |
label | string | Yes | What it says. |
shape | string | A Mermaid shape name: rect (process, default), diam (decision), stadium (start or end), rounded (event), lean-r (input or output), fr-rect (subroutine), hex (preparation), cyl (database), doc (document), sm-circ (UML start), fr-circ (UML end), fork (fork or join), brace (comment); any other Mermaid 11 shape name works too. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Join two nodes (or frames) with an arrow.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | An id for the code to write. Default: none written. | |
from | string | Yes | Where it starts: a node id or label. |
to | string | Yes | Where it points: a node id or label. |
label | string | Its label, e.g. yes or no after a decision. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
line | "solid" | "dotted" | "thick" | "invisible" | solid (default), dotted for an optional or async path, thick for the main path, invisible to place two nodes near each other with no line. | |
end | "none" | "arrow" | "circle" | "cross" | The head where it points: arrow (default), none, circle, cross. | |
start | "none" | "arrow" | "circle" | "cross" | A head where it starts too, for a two-way arrow: arrow, circle or cross. Default none. |
Change an arrow: its ends, label, line, heads or colour, or turn it round.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The arrow: its id, or from>to. |
from | string | A new start: a node id or label. | |
to | string | A new end: a node id or label. | |
label | string | Its new label; "" removes it. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. | |
flip | boolean | Turn it round. | |
line | "solid" | "dotted" | "thick" | "invisible" | solid (default), dotted for an optional or async path, thick for the main path, invisible to place two nodes near each other with no line. | |
end | "none" | "arrow" | "circle" | "cross" | The head where it points: arrow (default), none, circle, cross. | |
start | "none" | "arrow" | "circle" | "cross" | A head where it starts too, for a two-way arrow: arrow, circle or cross. Default none. |
Add a frame (a Mermaid subgraph) round nodes that belong together.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | A short id for the code. Default: made from the label. | |
label | string | Yes | Its title. |
nodes | array of string | The nodes and frames to put in it, by id or label. | |
parent | string | The frame to put it inside. | |
direction | "TB" | "BT" | "LR" | "RL" | "" | TB top to bottom, LR left to right, BT bottom to top, RL right to left. Only when its nodes read another way than the chart's; "" goes back to the chart's. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Change a frame: its title, what's in it, where it sits, its direction or colour.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The frame: its id or title. |
label | string | Its new title. | |
nodes | array of string | Everything it holds now, by id or label; what isn't listed goes to the frame round it. | |
parent | string | The frame to put it inside; "" takes it to the top level. | |
direction | "TB" | "BT" | "LR" | "RL" | "" | TB top to bottom, LR left to right, BT bottom to top, RL right to left. | |
color | string | Colour name or #RRGGBB; "" removes it. Only if asked. |
Remove a node (with its arrows), an arrow, or a frame (what's in it stays, unless contents).
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Its id. |
contents | boolean | For a frame: remove what's in it too. |
Link an element to a diagram it opens, by the diagram's id or exact name; "" unlinks.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
diagram | string |
Server instructions
The connector also sends these instructions when an AI app connects. Some clients shorten or ignore them, which is why the tools carry what they need in their own descriptions.
Penna: draft and edit diagrams saved in the user's account. The app lays them out and wires them; you change the structure.
Kinds of diagram (create_diagram's kind)
- bpmn: people's work: who does what, in which order, with decisions, hand-offs and messages to customers and partners.
- sequence: how systems talk: requests, replies and events between apps and services, as in a sign-in or a sync.
- erd: a database schema: tables, columns, keys and how they relate.
- flowchart: a flowchart, Mermaid or UML activity: steps and decisions, a sign-up or app flow, troubleshooting, algorithms.
Workflow
1. list_diagrams first: a change ("before X, do Y") goes to the diagram open in the app; create_diagram only for a new one.
2. read_context, once per chat, before your first change.
3. lookup_guidance for the kind's syntax, before your first write.
4. Draft with write_diagram. Change an existing diagram, fixes included, with edit_diagram.
5. Fix every error a change returns, and each warning that's a real problem; keep the rest as it is. When a fix depends on what the user meant, ask them; don't guess.
6. End with a short summary, the level of detail you drew and your assumptions, with the link to the diagram. Don't paste the code back.