BrandBrain Flow Orchestrator

v0.4.0
dev.brandbrain/flow-orchestrator Checked 2 days ago Published 2 months ago

Compose BrandBrain asset flows, run mock/live generation, and fetch outputs

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

login_brandbrain

Open BrandBrain sign-in in the user's browser and store a local session shared by MCP clients on this machine. Call when a tool reports not authenticated; verify afterwards with whoami_brandbrain.

whoami_brandbrain

Show the stored BrandBrain session (identity and expiry, never tokens). Call first to confirm the signed-in agent identity before editing or running flows.

logout_brandbrain

Revoke the stored BrandBrain session and remove local credentials for every client sharing it. Use to switch accounts or end access.

list_asset_flow_templates

List canonical starter flow templates (id, title, pattern). First step when the user describes a goal but no existing flow; pass the chosen template id to create_asset_flow.

list_asset_flows

List stored flow canvases (id, title, revision, updated_at, node/edge counts, canvas_url). query and limit filter client-side; archived:true lists read-only retained history. Use to find or resume an existing flow.

ParameterTypeDescription
archivedbooleanList archived, read-only flows instead of active flows.
limitintegerMax flows to return (default all).
querystringCase-insensitive match against title, description and id.

create_asset_flow

Create a persisted flow session from a templateId, a free-text goal, or an explicit flowSpec. A goal is patched into the scaffold's brief prompt node — asset-set templates have none, so express intent via update_asset_set_plan instead. Returns the stored session including canvas_url to share with the user.

ParameterTypeDescription
title *stringHuman-readable flow name shown on the canvas.
descriptionstringOptional description stored on the session.
flowSpecobjectComplete flow document to persist verbatim, instead of scaffolding from a template/goal.
goalstringFree-text intent, patched into the scaffold's brief prompt node. Asset-set templates have no prompt node — express intent via update_asset_set_plan for those.
templateIdstringStarter template id from list_asset_flow_templates.

get_asset_flow

Fetch a stored session with its full flowSpec graph. Inspect before editing; use list_asset_flows when you only need metadata across flows.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.

edit_asset_flow

Replace a session's title/description, and optionally REPLACE the entire stored flowSpec (full overwrite — get_asset_flow first). For targeted graph changes prefer add_flow_node, update_flow_node, connect_flow_nodes, or apply_flow_edits.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
descriptionstring
flowSpecobjectComplete replacement for the stored graph — not a merge. Fetch the current spec with get_asset_flow first.
titlestring

update_asset_set_plan

Atomically update an asset-set plan node's authoring fields and persist a complete draft manifest proposal; requires expected revisions from the current session. Configure before asking the user to approve.

ParameterTypeDescription
brief *stringCreative brief for the whole set — subject, style, palette.
desiredPurpose *stringWhat the assets are for, e.g. 'iOS tab icons'.
expectedFlowRevision *integerFlow revision from the current session — stale values are rejected to prevent lost updates.
expectedManifestRevision *integerManifest revision the draft builds on; 0 for the first proposal.
label *stringShort asset-set name, e.g. 'app icon set'.
manifest *objectComplete draft manifest object the backend will validate and persist.
planNodeId *stringThe asset_set plan node's id in the graph.
requestedCount *integerHow many assets the manifest should propose.
requestedFormats *Output formats: ["png"] or ["png","svg"] — svg adds local vectorisation.
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.

approve_asset_set_plan

Record the user's explicit approval of the exact persisted manifest revision and content hash. Never call before the user has seen and approved that manifest; approval alone does not start a run.

ParameterTypeDescription
expectedFlowRevision *integerFlow revision from the current session — stale values are rejected.
expectedManifestRevision *integerThe exact manifest revision the user approved.
manifestContentHash *stringContent hash of the approved manifest, from update_asset_set_plan's response — proves the user approved this exact draft.
planNodeId *stringThe asset_set plan node's id in the graph.
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.

approve_and_run_asset_set_plan

Approve the exact manifest revision/hash AND start its run in one durable idempotent call. In live mode this is a paid provider call — confirm the exact scope and cost with the user first.

ParameterTypeDescription
expectedFlowRevision *integerFlow revision from the current session — stale values are rejected.
expectedManifestRevision *integerThe exact manifest revision the user approved.
manifestContentHash *string
planNodeId *stringThe asset_set plan node's id in the graph.
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
idempotencyKeystring
modestringmock = free dry run. live = paid provider generation — confirm with the user first.

get_asset_set_plan_history

Fetch an asset-set plan's manifest revisions and approval events. Use to audit what was proposed and approved before any run.

ParameterTypeDescription
planNodeId *stringThe asset_set plan node's id in the graph.
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.

add_flow_reference_image

Upload a local image file (png/jpeg/webp/gif/svg, ≤10 MB) as a session-scoped reference — the backend stores it immutably and the reference node points at its storage key. Use connectToNodeId to feed a generate node, then validate_asset_flow before running.

ParameterTypeDescription
filePath *stringLocal image file (png/jpeg/webp/gif/svg) to attach as a generation reference. Read by this MCP process and uploaded to the session — keep it under 10 MB.
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
connectToNodeIdstringGenerate node the reference should feed (edges it in when creating a new node).
labelstringShort label for the reference node on the canvas.
nodeIdstringReference node to create or update. Defaults to reference_<filename>; pass an existing reference node id to replace its image.

add_flow_node

Add one node to the stored flow graph. Wire it with connect_flow_nodes, then validate_asset_flow before running.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
type *stringNode kind: prompt/style/reference feed a generate node; generate calls a provider; output is a display sink; frame/note are canvas annotations.
assetRefstring
descriptionstring
globalRulesarray
idstring
labelstring
mimeTypestring
modelIdstring
negativeConstraintsarray
palettearray
positionobject
providerstring
stageIndexnumber
stageLabelstring
statusstring
storagePathstring
strategystring
textstring
themeStylestring
titlestring
tonestring

update_flow_node

Update fields on one node in the stored flow graph (prompt text, model, processor options). Run validate_asset_flow afterwards.

ParameterTypeDescription
nodeId *stringNode id in the stored graph — from get_asset_flow.
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
assetRefstring
descriptionstring
globalRulesarray
labelstring
mimeTypestring
modelIdstring
negativeConstraintsarray
palettearray
positionobject
providerstring
stageIndexnumber
stageLabelstring
statusstring
storagePathstring
strategystring
textstring
themeStylestring
titlestring
tonestring

remove_flow_node

Remove a node (and its edges) from the stored flow graph. Run validate_asset_flow afterwards.

ParameterTypeDescription
nodeId *stringNode id in the stored graph — its edges are removed too.
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.

connect_flow_nodes

Create a directed edge from one node to another in the stored flow graph; invalid node-kind pairs are rejected.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
sourceNodeId *stringUpstream node id (prompt/style/reference → generate, generate → output).
targetNodeId *stringDownstream node id.
sourcePortstring
targetPortstringNamed input port for multi-input nodes.

disconnect_flow_nodes

Remove a directed edge between two nodes in the stored flow graph.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
edgeIdstringEdge id to remove; alternatively pass sourceNodeId + targetNodeId.
sourceNodeIdstring
targetNodeIdstring

set_generate_target

Set the output target on a generate node (surface, aspect ratio, size hint, composition/text policy). Run validate_asset_flow afterwards.

ParameterTypeDescription
nodeId *stringThe generate node's id.
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
aspectRatiostringe.g. '1:1', '16:9', '9:16'.
compositionRulesarrayComposition constraints, e.g. 'negative space top-left for headline'.
copySafetystringHow to leave room for copy, e.g. 'clean negative space'.
sizeHintstring
surfacestringOutput surface, e.g. 'hero', 'banner', 'story'.
textPolicystringGENERATE_TEXT_POLICY_* — DISALLOW for clean plates with no rendered text.

apply_flow_edits

Apply a batch of graph edits (add/update/remove nodes, connect/disconnect edges) atomically to the stored flowSpec. Preferred over individual calls for multi-step edits; validate afterwards.

ParameterTypeDescription
ops *array
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.

validate_asset_flow

Run backend validation on the stored graph. Call after every material edit and before every run — invalid graphs are refused at run time.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.

get_flow_processor_health

Report local processor readiness and pinned revisions (split, background removal, vectorisation). Required check before relying on zero-token local stages in asset-set flows.

start_asset_flow_run

Start a background mock or live run; returns a task to poll with get_asset_flow_task. live spends real provider money — confirm scope and cost with the user first; refused unless BRANDBRAIN_MAX_PROVIDER_SPEND_USD_MICROS is set in the server env. One run executes only the targeted generate node (targetNodeId): downstream generate nodes are paid-call boundaries — run them as separate targeted runs, each billed independently.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
idempotencyKeystringDedupe key so retries do not launch duplicate runs; reuse the same key to re-attach to the first dispatch.
modestringmock = free dry run. live = paid provider generation — confirm with the user first.
targetNodeIdstringRun only the subgraph feeding this node. A root run defaults to the backend's first generate target, so a multi-branch graph generates one image per run unless a branch is named here. Ignored for asse…

compare_image_models

Clone a single-generate-node flow once per candidate model (same prompt/style/references), preflight each, and start sibling runs to compare engines. live charges per sibling and needs a total ceiling.

ParameterTypeDescription
models *arrayThe engines to compare — one sibling session per entry. Discover provider/modelId pairs with list_image_models.
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
maxTotalUsdMicrosintegerLive only: the most the whole comparison may cost, in USD micros. The sum of the siblings' preflight ceilings must fit or nothing is started.
modestringmock = free dry run. live = paid provider generation — confirm with the user first.

start_regenerate_asset_flow_node

Start a background regeneration from a target node; poll it with get_asset_flow_task. Warning: targeting an output node re-runs its paid generate producer — use get_flow_outputs on a finished run to fetch results instead.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
targetNodeId *stringNode to rerun from. An output node resolves to its generate producer and re-runs paid generation — never use this to fetch outputs (use get_flow_outputs).
modestringmock = free dry run. live = paid provider generation — confirm with the user first.

get_asset_flow_task

Poll a task started by start_asset_flow_run or start_regenerate_asset_flow_node until completed/failed. Then verify the persisted outcome with get_asset_flow_run — a task report alone is not proof.

ParameterTypeDescription
taskId *stringTask id returned by start_asset_flow_run or start_regenerate_asset_flow_node.

run_asset_flow

Execute the stored flow session in mock or live mode as a task-backed run. Requires MCP task augmentation; clients without it should call start_asset_flow_run and poll get_asset_flow_task instead.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
idempotencyKeystringDedupe key so retries do not launch duplicate runs; reuse the same key to re-attach to the first dispatch.
modestringmock = free dry run. live = paid provider generation — confirm with the user first.
targetNodeIdstringRun only the subgraph feeding this node. A root run defaults to the backend's first generate target, so a multi-branch graph generates one image per run unless a branch is named here. Ignored for asse…

regenerate_asset_flow_node

Regenerate a single target node in the stored flow session as a task-backed run. Requires MCP task augmentation; clients without it should call start_regenerate_asset_flow_node and poll get_asset_flow_task instead.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
targetNodeId *stringNode to rerun from. An output node resolves to its generate producer and re-runs paid generation — never use this to fetch outputs (use get_flow_outputs).
modestringmock = free dry run. live = paid provider generation — confirm with the user first.

list_image_models

List every provider's image models with lifecycle status, reference-image support, and the preflight cost ceiling for one 1024² image. Call before choosing a generate model — the only way to discover OpenRouter model ids. Supports sortByCost and maxPerProvider to surface the cheapest options quickly.

ParameterTypeDescription
includeRetiredbooleanRetired models are hidden unless this is true.
maxPerProviderintegerCap models listed per provider (cheapest first when sortByCost is set).
providerstring"openai", "gemini" or "openrouter"; every provider when omitted.
sortByCostbooleanSort each provider's models cheapest-first and order providers by their cheapest model.

estimate_asset_flow_run_cost

Estimate what a flow's generate nodes would cost to run, priced from the image-model catalogue (1024² high estimate per image). Pass targetNodeId to scope to the single node a run would execute — one run bills only its target. Free to call — use before a live run to sanity-check spend, or to compare models before set_generate_target.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
targetNodeIdstringRestrict the estimate to one generate node; all generate nodes when omitted.

list_asset_flow_runs

List recorded runs for a session (id, mode, status, timing). Use to find a runId for get_asset_flow_run, get_flow_trace, or get_flow_outputs.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
limitinteger

get_asset_flow_run

Inspect a stored run's status, per-node traces, artifacts and errors. Use to confirm the real outcome of a finished or failed task before reporting it.

ParameterTypeDescription
runId *stringRun id from list_asset_flow_runs or a finished task.
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.

open_flow

Open the flow's canvas editor in the user's default browser and return its URL. Side effect: opens a window on the user's machine — when they only need the link, return canvas_url from list_asset_flows instead.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.

get_flow_trace

Get a run's per-node trace: status, duration, resolved prompts, provider request details, artifacts, errors. Use to diagnose a failed or surprising run.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
runIdstringDefaults to the session's latest run.

get_flow_outputs

Fetch a run's durable outputs with metadata, artifact_url (fetchable with this server's auth), open_in_browser link for humans, and a bounded inline preview. The way to view results — never regenerate to fetch outputs.

ParameterTypeDescription
sessionId *stringPersisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows.
runIdstringDefaults to the session's latest run.