Flow tools of the Flows MCP server
The 10 tools that work on the flows as a whole and on tabs. How to connect, and how deploys, checks and errors come back, is in Flows MCP server. To work on single nodes, use the Node tools.
The write tools of this page deploy to the running Node-RED at once and report the deploy check: revision, restarted nodes, errors and red statuses, or, for delete-flow and reload-flows, the revision and the errors logged.
Reading
get-flows
Returns all the flows of the runtime, in one of five formats.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
format | schema, topology, tabs-only, formatted or raw | no | Default schema |
| Format | Contents |
|---|---|
tabs-only | The tabs, each with its id, label and disabled flag. The smallest answer |
topology | A structural summary of the whole project: tabs and node type counts, links between tabs, orphan nodes, and for each config node the tabs that use it, also through chains of config nodes (a widget, its group, its page and its dashboard) |
schema | Per tab, the nodes and their connections as a compact edge list, with positions |
formatted | Tabs, nodes and subflows as separate lists, with a summary line and the count of nodes per type |
raw | The complete flows array, as Node-RED stores it |
get-flow
Returns one tab. Read a tab with this tool before editing it.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
id | string | yes | Tab id |
format | schema, summary or raw | no | Default schema |
ids | array of strings | no | Only these node ids |
group | string | no | Only the members of this group, nested groups included |
type | string | no | Only nodes of this type |
offset | integer, from 0 | no | summary and raw: skip this many nodes |
limit | integer, 1 to 2000 | no | summary and raw: how many nodes. Default 200. Without offset, limit or a filter, raw returns the whole tab |
schemais the compact edge list ofget-flows, with positions and connections.summaryis one compact JSON line per node with onlyid,type,name,g,wires,links,x,y,landd, after a header with the tab, the node count and the nextoffsetwhen there are more. Use it to find your way in large tabs.rawis the tab asupdate-flowtakes it:label,nodes,configs, anddisabled,infoandenvwhen set. Paged or filtered, it returnsid,label,disabled,info,total,offset,nodesandnextwhen there are more.
Link out nodes are shown as the flows file stores them, with their wires.
get-flows-state
The runtime state of the flows: started or stopped. Takes no parameters. It needs runtimeState.enabled set to true in Node-RED's settings.js; without it the call fails.
lint-flows
Checks the flows for common problems and lists the findings grouped by rule, page by page. Read-only. Use it after large edits and before committing.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
flowId | string | no | Only this tab or subflow. Default: every tab, subflow and config node |
rules | array of rule names | no | Rules to run. Default all |
maxFunctionLines | integer, from 1 | no | long-functions: line limit of the code of a function node (func, initialize, finalize). Default 100 |
logicTypes | array of strings | no | unnamed-logic: node types that must have a name. Default function, switch, change, template, exec, link call, delay, trigger, join, split |
duplicateNameScope | tab or all | no | duplicate-names: compare names within each tab (default) or across all tabs |
allowLinkedPairs | boolean | no | duplicate-names: a link out and a link in linked to each other may share their name. Default true |
orphanIgnoreTypes | array of strings | no | orphans: types that may stand alone. Default comment, ui-spacer, ui_spacer, ui-template, ui_template, ui-text, ui_text |
unusedConfigIgnoreTypes | array of strings | no | unused-configs: config types that are used without references. Default global-config, ui_base, ui-base |
unknownPropertiesIgnoreTypes | array of strings | no | unknown-properties: node types to skip |
limit | integer, 1 to 500 | no | Findings per page. Default 50 |
offset | integer, from 0 | no | Findings to skip |
| Rule | Finds |
|---|---|
orphans | Nodes connected to nothing: no wire in or out, no link |
unnamed-logic | Logic nodes without a name |
duplicate-names | Names used by more than one node |
duplicate-configs | Config nodes of the same type with identical settings |
unused-configs | Config nodes no node refers to |
unknown-properties | Properties the node type does not define, credentials stored as plain properties, node types that are not installed |
overlaps | Nodes drawn on top of each other |
wires-over-nodes | Wires drawn over a node they do not connect |
long-functions | Function nodes whose code is longer than maxFunctionLines |
overlaps and wires-over-nodes work with estimated node sizes and wire paths; capture-flow measures the real ones. Fields that a node type declares both as a property and as a credential are listed apart, as notes, because nothing in the flow can fix them.
Changing tabs
update-flow
Replaces the contents of one tab and deploys it. The other tabs, and the position of the tab among them, are kept. Only the nodes of this tab that changed restart.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
id | string | yes | Tab id. It wins over any id inside flowJson |
flowJson | string | yes | The whole tab as a JSON string, in the shape get-flow returns with format: "raw": {"label", "nodes": [...], "configs": [...], "disabled", "info", "env"}. Every node the tab keeps has to be in it: nodes left out are deleted |
strict | boolean | no | Refuse the change, instead of only warning, when a property is not defined by the node type or a credential is passed as a plain property. Default false |
dryRun | boolean | no | Report what would change and deploy nothing |
The tab's own properties are rebuilt from flowJson too: a label, info or env left out is removed, and disabled left out means enabled.
Answers Flow <id> updated and the deploy check. After a connection error, check with get-flow whether the change was applied before retrying.
To change only the name, the description or the enabled state of a tab, use update-tab.
create-tab
Creates an empty tab and deploys it. The other tabs are not touched. Returns the id of the new tab.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
label | string | yes | Name of the tab |
disabled | boolean | no | Create the tab disabled. Default false |
info | string | no | Description shown in the tab's information panel |
Add nodes to it with create-node or batch-create-nodes.
create-flow
Creates a tab with its nodes in one call and deploys it; its nodes start running. Returns the id of the new tab: a new one is always generated, and an id in flowJson is ignored.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
flowJson | string | yes | The tab as a JSON string: {"label", "nodes": [...], "configs": [...], "disabled", "info", "env"}. nodes is required |
strict | boolean | no | As in update-flow |
dryRun | boolean | no | Report what would change and deploy nothing |
The ids of the nodes are kept, and the call is refused when one of them is already in use on the runtime. Tabs and subflows inside nodes are refused.
update-tab
Changes only the properties of the tab itself (name, description, enabled state) without sending its nodes, which stay exactly as deployed.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
id | string | yes | Tab id |
label | string | no | New name |
info | string | no | New description (Markdown) |
disabled | boolean | no | true stops every node of the tab, false starts them again |
dryRun | boolean | no | Report the change and deploy nothing |
At least one of label, info and disabled is required. Renaming the tab or changing its description restarts nothing.
delete-flow
Deletes a tab with all its nodes: they are stopped and removed from the runtime. It cannot be undone except through git. It uses Node-RED's own deletion of a tab, so the checks and the handling of concurrent deploys of the other write tools do not apply; the answer reports the revision and the errors logged.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
id | string | yes | Tab id |
dryRun | boolean | no | List what would be removed, and the nodes of other tabs that still refer to it, and deploy nothing |
Runtime
reload-flows
Reloads the flows from the flows file on disk and restarts every node of every tab. Takes no parameters. Use it when the flows file was changed outside Node-RED, or to recover the runtime; the write tools of this server do not need it, because they deploy themselves. Answers with the deploy check.