Check state diagram text
check_state_diagramUse this when the user wants state machine text checked without a drawing, for example "which states are unreachable?" or "check my state diagram for dead ends". Takes the same diagram text as make_state_diagram. Returns ready true or false; when a line breaks the grammar, the line number, the token and the reason; otherwise the states with incoming and outgoing transition counts, states not reachable from the start, states with no path to the end (both by breadth-first search; a composite state is entered through its own start), and transitions that leave the same state on the same event and guard. Does not draw the diagram or make files, and does not read fork, join, history or concurrent regions.
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": {
"diagram": "<diagram>"
},
"name": "check_state_diagram"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| diagram | Yes | The state machine in this line grammar, one statement per line, up to 40,000 characters: state Name | state "Long label" as Name | state Name <<choice>> | state Name { ... } (composite, nest up to 3); [*] -> A (start), A -> [*] (end); A -> B: event [guard] / action (after ':' the event is required, then an optional [guard] and / action in that order; only a transition out of a <<choice>> state may have a [guard] without an event); note A: text; # comments. Declare each state before or after use. Example: "state Idle\nstate Running\n[*] -> Idle\nIdle -> Running: start [ready] / log\nRunning -> Idle: stop\nRunning -> [*]: shutdown". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | Yes | ||
| notes | Yes | ||
| ready | Yes | ||
| shown | No | ||
| counts | No | ||
| limits | Yes | ||
| states | Yes | ||
| grammar | Yes | ||
| analysis | No |