Skip to main content
Glama

create_flow

Create a flow. Provide the models in order — input/output nodes and connections are generated automatically by matching output→input port types, and the original input is shared (fan-out) when several models need it. Set run=true to start it immediately in the same call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
runNoStart the flow immediately after creating it. Requires input_files when the flow has input nodes. On success the response carries run_status — poll get_flow(view="status") from there. The flow is created either way: if the run cannot start, next_step explains why.
nameNoName for the new flow. Defaults to the model chain (e.g. 'ModelA → ModelB').
nodesYesJSON array of models IN ORDER. Two formats: (1) SHORTHAND — a string array of model IDs, e.g. '["ModelA","ModelB"]'. Use this unless you need explicit connections. (2) FULL — node objects with id, type, model_id and optional parameters, e.g. [{"id":1,"type":"ai_model","model_id":"ModelA","parameters":{"steps":50}}]. Use get_model_parameters to discover parameters; anything omitted is filled with defaults. FULL nodes may also declare the input and output nodes themselves — {"id":1,"type":"input","model_id":"Image-Loader"} or {"id":9,"type":"output","model_id":"Image-Viewer"} — which is how you give several models the SAME source (e.g. three editors comparing one image) instead of chaining them. Declaring any input/output node turns auto-generation off: the graph is then exactly what you pass.
parametersNoJSON object of parameter overrides keyed by model_id, or by node index to target one position in a chain that repeats a model. Index keys win over model_id keys. Example: {"PiSA-SR":{"steps":50,"seed":123}}.
connectionsNoJSON array of explicit connections, e.g. [{"out_node_id":1,"out_port_index":0,"in_node_id":2,"in_port_index":0}]. Port indices are positions in the model's own input/output list, and the order is NOT the same across models — some image editors take the image on port 0, others take the text prompt there. Read the ports from get_model before writing indices; a wrong index is rejected with the correct layout in the message. Connections you pass are kept: only the ports you leave open get wired automatically.
input_filesNoJSON array of inputs for the generated input nodes, matched in order. For image/video/sound inputs: file URLs from upload_file. For text inputs (Text-Input nodes): text content directly — it will be auto-uploaded as a text file. Example: ["https://storage.googleapis.com/.../image.png", "Change the color to blue"]
include_optionalNoWhether to auto-generate input nodes for OPTIONAL model input ports. Default true: every optional port also gets its own loader node (e.g. a multimodal model with an optional image input gets an Image-Loader). Set false to scaffold only REQUIRED inputs. DECIDE this yourself from the task — you do not need the user to ask: set false when the goal clearly uses only some modalities (e.g. 'summarize this text' on a text+optional-image model → skip the image loader), or when the user's input_files cover only the required ports. Keep true when the goal is genuinely multimodal, when the user supplied inputs for optional ports, or when you are unsure — so no modality is silently dropped. When in doubt, leave it true (or omit).

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations: it discloses automatic generation of input/output nodes and connections, port-type matching, fan-out sharing, and immediate execution behavior. The schema further adds that the flow is created even if the run fails and that passed connections are preserved.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The main description is two sentences, front-loads the purpose, and states the key run flag behavior. The long parameter guidance lives in the structured schema, keeping the overview section tight.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex 7-parameter creation tool with no output schema, the description plus rich schema covers behavior, parameter formats, and post-run status polling via get_flow. The main gap is that the general return shape or created flow identifier is not summarized in the description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema covers all 7 parameters with detailed descriptions (100% coverage), so the baseline is 3, but the description adds meaningful conceptual context: model ordering, automatic port-type matching, fan-out, and the run=true shortcut. This helps the agent understand how the nodes and connections parameters work together.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb+resource: 'Create a flow' and immediately distinguishes the create action from siblings by explaining models are provided in order and that run=true can start it in the same call. This clearly separates it from run_flow, update_flow, and duplicate_flow.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear context for use: create a flow by providing ordered models, with auto-generated wiring, fan-out, and optional immediate run via run=true. It does not explicitly name alternatives or when-not-to-use cases, but the context is sufficient for choosing this over siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4/5.0
Disambiguation5/5

Each tool targets a distinct resource and action, with clear separation between flow lifecycle, execution, model exploration, community, and account tools. Even similar-sounding tools like create_flow, preview_flow, and suggest_flow have clearly different purposes (actually creating, dry-running, and recommending models). Descriptions prevent misselection.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern in snake_case (e.g., create_flow, list_flows, run_batch, cancel_flow). No mixed conventions or vague verbs like 'process' or 'handle'. The naming is uniform and predictable.

Tool Count3/5

At 33 tools, this is a large surface, but each tool addresses a distinct feature of the cnaps.ai platform, from flow CRUD and execution to community features and notifications. Still, it exceeds the typical well-scoped range and feels heavy, making it a borderline case between appropriate and too many.

Completeness3/5

The core flow lifecycle (create, read, update, delete, restore, duplicate) and execution (run, batch, cancel) are covered, but structural editing of flow graphs is missing—update_flow only changes parameters, not topology. Additionally, there is no run history, batch list/cancel, or community post update/delete, leaving notable gaps for a platform API.

Resources