Skip to content

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.

ParameterTypeRequiredMeaning
formatschema, topology, tabs-only, formatted or rawnoDefault schema
FormatContents
tabs-onlyThe tabs, each with its id, label and disabled flag. The smallest answer
topologyA 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)
schemaPer tab, the nodes and their connections as a compact edge list, with positions
formattedTabs, nodes and subflows as separate lists, with a summary line and the count of nodes per type
rawThe complete flows array, as Node-RED stores it

get-flow ​

Returns one tab. Read a tab with this tool before editing it.

ParameterTypeRequiredMeaning
idstringyesTab id
formatschema, summary or rawnoDefault schema
idsarray of stringsnoOnly these node ids
groupstringnoOnly the members of this group, nested groups included
typestringnoOnly nodes of this type
offsetinteger, from 0nosummary and raw: skip this many nodes
limitinteger, 1 to 2000nosummary and raw: how many nodes. Default 200. Without offset, limit or a filter, raw returns the whole tab
  • schema is the compact edge list of get-flows, with positions and connections.
  • summary is one compact JSON line per node with only id, type, name, g, wires, links, x, y, l and d, after a header with the tab, the node count and the next offset when there are more. Use it to find your way in large tabs.
  • raw is the tab as update-flow takes it: label, nodes, configs, and disabled, info and env when set. Paged or filtered, it returns id, label, disabled, info, total, offset, nodes and next when 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.

ParameterTypeRequiredMeaning
flowIdstringnoOnly this tab or subflow. Default: every tab, subflow and config node
rulesarray of rule namesnoRules to run. Default all
maxFunctionLinesinteger, from 1nolong-functions: line limit of the code of a function node (func, initialize, finalize). Default 100
logicTypesarray of stringsnounnamed-logic: node types that must have a name. Default function, switch, change, template, exec, link call, delay, trigger, join, split
duplicateNameScopetab or allnoduplicate-names: compare names within each tab (default) or across all tabs
allowLinkedPairsbooleannoduplicate-names: a link out and a link in linked to each other may share their name. Default true
orphanIgnoreTypesarray of stringsnoorphans: types that may stand alone. Default comment, ui-spacer, ui_spacer, ui-template, ui_template, ui-text, ui_text
unusedConfigIgnoreTypesarray of stringsnounused-configs: config types that are used without references. Default global-config, ui_base, ui-base
unknownPropertiesIgnoreTypesarray of stringsnounknown-properties: node types to skip
limitinteger, 1 to 500noFindings per page. Default 50
offsetinteger, from 0noFindings to skip
RuleFinds
orphansNodes connected to nothing: no wire in or out, no link
unnamed-logicLogic nodes without a name
duplicate-namesNames used by more than one node
duplicate-configsConfig nodes of the same type with identical settings
unused-configsConfig nodes no node refers to
unknown-propertiesProperties the node type does not define, credentials stored as plain properties, node types that are not installed
overlapsNodes drawn on top of each other
wires-over-nodesWires drawn over a node they do not connect
long-functionsFunction 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.

ParameterTypeRequiredMeaning
idstringyesTab id. It wins over any id inside flowJson
flowJsonstringyesThe 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
strictbooleannoRefuse 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
dryRunbooleannoReport 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.

ParameterTypeRequiredMeaning
labelstringyesName of the tab
disabledbooleannoCreate the tab disabled. Default false
infostringnoDescription 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.

ParameterTypeRequiredMeaning
flowJsonstringyesThe tab as a JSON string: {"label", "nodes": [...], "configs": [...], "disabled", "info", "env"}. nodes is required
strictbooleannoAs in update-flow
dryRunbooleannoReport 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.

ParameterTypeRequiredMeaning
idstringyesTab id
labelstringnoNew name
infostringnoNew description (Markdown)
disabledbooleannotrue stops every node of the tab, false starts them again
dryRunbooleannoReport 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.

ParameterTypeRequiredMeaning
idstringyesTab id
dryRunbooleannoList 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.