BrandBrain Flow Orchestrator
v0.4.0Compose 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.
| Parameter | Type | Description |
|---|---|---|
archived | boolean | List archived, read-only flows instead of active flows. |
limit | integer | Max flows to return (default all). |
query | string | Case-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.
| Parameter | Type | Description |
|---|---|---|
title * | string | Human-readable flow name shown on the canvas. |
description | string | Optional description stored on the session. |
flowSpec | object | Complete flow document to persist verbatim, instead of scaffolding from a template/goal. |
goal | string | Free-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. |
templateId | string | Starter 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.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted 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.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
description | string | |
flowSpec | object | Complete replacement for the stored graph — not a merge. Fetch the current spec with get_asset_flow first. |
title | string |
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.
| Parameter | Type | Description |
|---|---|---|
brief * | string | Creative brief for the whole set — subject, style, palette. |
desiredPurpose * | string | What the assets are for, e.g. 'iOS tab icons'. |
expectedFlowRevision * | integer | Flow revision from the current session — stale values are rejected to prevent lost updates. |
expectedManifestRevision * | integer | Manifest revision the draft builds on; 0 for the first proposal. |
label * | string | Short asset-set name, e.g. 'app icon set'. |
manifest * | object | Complete draft manifest object the backend will validate and persist. |
planNodeId * | string | The asset_set plan node's id in the graph. |
requestedCount * | integer | How many assets the manifest should propose. |
requestedFormats * | Output formats: ["png"] or ["png","svg"] — svg adds local vectorisation. | |
sessionId * | string | Persisted 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.
| Parameter | Type | Description |
|---|---|---|
expectedFlowRevision * | integer | Flow revision from the current session — stale values are rejected. |
expectedManifestRevision * | integer | The exact manifest revision the user approved. |
manifestContentHash * | string | Content hash of the approved manifest, from update_asset_set_plan's response — proves the user approved this exact draft. |
planNodeId * | string | The asset_set plan node's id in the graph. |
sessionId * | string | Persisted 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.
| Parameter | Type | Description |
|---|---|---|
expectedFlowRevision * | integer | Flow revision from the current session — stale values are rejected. |
expectedManifestRevision * | integer | The exact manifest revision the user approved. |
manifestContentHash * | string | |
planNodeId * | string | The asset_set plan node's id in the graph. |
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
idempotencyKey | string | |
mode | string | mock = 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.
| Parameter | Type | Description |
|---|---|---|
planNodeId * | string | The asset_set plan node's id in the graph. |
sessionId * | string | Persisted 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.
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Local 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 * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
connectToNodeId | string | Generate node the reference should feed (edges it in when creating a new node). |
label | string | Short label for the reference node on the canvas. |
nodeId | string | Reference 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.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
type * | string | Node kind: prompt/style/reference feed a generate node; generate calls a provider; output is a display sink; frame/note are canvas annotations. |
assetRef | string | |
description | string | |
globalRules | array | |
id | string | |
label | string | |
mimeType | string | |
modelId | string | |
negativeConstraints | array | |
palette | array | |
position | object | |
provider | string | |
stageIndex | number | |
stageLabel | string | |
status | string | |
storagePath | string | |
strategy | string | |
text | string | |
themeStyle | string | |
title | string | |
tone | string |
update_flow_node
Update fields on one node in the stored flow graph (prompt text, model, processor options). Run validate_asset_flow afterwards.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Node id in the stored graph — from get_asset_flow. |
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
assetRef | string | |
description | string | |
globalRules | array | |
label | string | |
mimeType | string | |
modelId | string | |
negativeConstraints | array | |
palette | array | |
position | object | |
provider | string | |
stageIndex | number | |
stageLabel | string | |
status | string | |
storagePath | string | |
strategy | string | |
text | string | |
themeStyle | string | |
title | string | |
tone | string |
remove_flow_node
Remove a node (and its edges) from the stored flow graph. Run validate_asset_flow afterwards.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Node id in the stored graph — its edges are removed too. |
sessionId * | string | Persisted 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.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
sourceNodeId * | string | Upstream node id (prompt/style/reference → generate, generate → output). |
targetNodeId * | string | Downstream node id. |
sourcePort | string | |
targetPort | string | Named input port for multi-input nodes. |
disconnect_flow_nodes
Remove a directed edge between two nodes in the stored flow graph.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
edgeId | string | Edge id to remove; alternatively pass sourceNodeId + targetNodeId. |
sourceNodeId | string | |
targetNodeId | string |
set_generate_target
Set the output target on a generate node (surface, aspect ratio, size hint, composition/text policy). Run validate_asset_flow afterwards.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | The generate node's id. |
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
aspectRatio | string | e.g. '1:1', '16:9', '9:16'. |
compositionRules | array | Composition constraints, e.g. 'negative space top-left for headline'. |
copySafety | string | How to leave room for copy, e.g. 'clean negative space'. |
sizeHint | string | |
surface | string | Output surface, e.g. 'hero', 'banner', 'story'. |
textPolicy | string | GENERATE_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.
| Parameter | Type | Description |
|---|---|---|
ops * | array | |
sessionId * | string | Persisted 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.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted 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.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
idempotencyKey | string | Dedupe key so retries do not launch duplicate runs; reuse the same key to re-attach to the first dispatch. |
mode | string | mock = free dry run. live = paid provider generation — confirm with the user first. |
targetNodeId | string | Run 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.
| Parameter | Type | Description |
|---|---|---|
models * | array | The engines to compare — one sibling session per entry. Discover provider/modelId pairs with list_image_models. |
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
maxTotalUsdMicros | integer | Live only: the most the whole comparison may cost, in USD micros. The sum of the siblings' preflight ceilings must fit or nothing is started. |
mode | string | mock = 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.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
targetNodeId * | string | Node 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). |
mode | string | mock = 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.
| Parameter | Type | Description |
|---|---|---|
taskId * | string | Task 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.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
idempotencyKey | string | Dedupe key so retries do not launch duplicate runs; reuse the same key to re-attach to the first dispatch. |
mode | string | mock = free dry run. live = paid provider generation — confirm with the user first. |
targetNodeId | string | Run 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.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
targetNodeId * | string | Node 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). |
mode | string | mock = 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.
| Parameter | Type | Description |
|---|---|---|
includeRetired | boolean | Retired models are hidden unless this is true. |
maxPerProvider | integer | Cap models listed per provider (cheapest first when sortByCost is set). |
provider | string | "openai", "gemini" or "openrouter"; every provider when omitted. |
sortByCost | boolean | Sort 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.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
targetNodeId | string | Restrict 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.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
limit | integer |
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.
| Parameter | Type | Description |
|---|---|---|
runId * | string | Run id from list_asset_flow_runs or a finished task. |
sessionId * | string | Persisted 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.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
open_flow_gallery
Open the flow's run gallery (every run's output images with per-image cost and trace) in the user's default browser and return its URL. Opens a window on the user's machine.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted 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.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
runId | string | Defaults 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.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Persisted flow session id (flow_session_…) from create_asset_flow or list_asset_flows. |
runId | string | Defaults to the session's latest run. |