Skip to main content
Glama

Run a flow

run_flow

Start a user-requested flow in the CALLER's repository.

Instructions

Start a user-requested flow in the CALLER's repository.

flow: a bare ID, ID.md, flows/ID.md, or builtin:/user:/repo:<id>. A bare ID
resolves repo:, then user:, then builtin:. request carries the user's scope,
PR/MR URL and constraints such as no-merge. repo_path defaults to the caller
workspace; an override must be an existing directory within it.
HTTP requires X-Agents-Workspace. Stdio uses AGENTS_CLIENT_REPO_ROOT, else
workspace when it lies inside the client's MCP roots, else the project
inferred from CLAUDE_PROJECT_DIR or cwd. A filesystem root, the home directory
or a system or program directory (also as the override) is refused with
workspace_unsafe, and a cwd without .git or CLAUDE.md with workspace_required.

Returns needs_execution with flow metadata, content, repo_path, workspace_id,
request and instruction. Continue executing that content using client tools.
When the flow names a persona (flow.persona), persona_activation is a protocol 2
response for it: pass current_persona and apply it as a switch before executing.
force_reload=True with current_persona returns that persona's full instruction again.
This tool only reads instructions: it does not run commands, edit files,
create a background task, sample a model or claim the workflow is complete.
Returns status=error for an invalid source or unavailable caller workspace; over
stdio a workspace error adds pid, workspace_inputs and, when the Claude desktop
app started this server, hint. Over HTTP a workspace outside the registered root
returns workspace_mismatch with both roots instead of running there.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "flow": "<flow>"
    },
    "name": "run_flow"
  }
}

Input Schema

NameRequiredDescriptionDefault
flowYesFlow id, ID.md, flows/ID.md, or builtin:/user:/repo:<id>.
requestNoThe user's scope, PR/MR URL and constraints.
repo_pathNoOptional directory within the caller workspace; defaults to the workspace.
workspaceNoAbsolute path of your working directory, the project this session works in. Pass it whenever you have one. It never widens this session's grant: over HTTP the workspace registered for the connection decides, and over stdio it is checked against the client's own MCP roots unless this session's root is already pinned, when it is ignored. Each tool's description says what it does with a path that grant does not cover.
force_reloadNoTrue with current_persona to restore the flow persona's lost instructions.
current_personaNoThe `persona` object of the last SUCCESS/NO_CHANGE, copied verbatim; omit or null on first activation. All 7 keys: agent, activation_id, bundle_revision (64 hex characters), scope, skills_loaded, implants_loaded, rules_loaded.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv26.10.18
    • changedInput schema / properties / workspace / description
      Previous value: -"Absolute path of your working directory, the project this session works in. Pass it whenever you have one: one server can serve several sessions."New value: +"Absolute path of your working directory, the project this session works in. Pass it whenever you have one. It never widens this session's grant: over HTTP the workspace registered for the connection decides, and over stdio it is checked against the client's own MCP roots unless this session's root is already pinned, when it is ignored. Each tool's description says what it does with a path that grant does not cover."
  2. Changed1 schema field changedv26.10.17
    • addedInput schema / properties / force_reload
      Added value: +{
      +  "default": false,
      +  "description": "True with current_persona to restore the flow persona's lost instructions.",
      +  "title": "Force Reload",
      +  "type": "boolean"
      +}
  3. First observedv26.10.14+1807

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 by enumerating concrete failure modes (workspace_unsafe, workspace_required, workspace_mismatch, status=error) and the extra diagnostic fields (pid, workspace_inputs, hint) returned over stdio. It also discloses the persona_activation protocol 2 handshake and what force_reload does, which no annotation covers.

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

Conciseness4/5

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

Purpose and scope are front-loaded, then source resolution, then return contract, then error contract — a sensible ordering. It is long and includes deep environment-variable precedence details (AGENTS_CLIENT_REPO_ROOT, CLAUDE_PROJECT_DIR, MCP roots) that are dense but arguably necessary for correct invocation.

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

Completeness5/5

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

For a tool with six parameters, nested current_persona, an output schema and a multi-step persona protocol, the description covers invocation, return status, follow-on actions and error surfaces. Nothing an agent needs to call it correctly and act on the result appears missing.

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?

Schema coverage is 100%, so the schema already defines each parameter; the description adds genuine value by giving the fallback resolution order for a bare flow ID, the override-must-be-inside-workspace rule for repo_path, and the requirement to pass current_persona verbatim on activation. The remaining parameters (request, workspace, force_reload) get only modest added meaning.

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?

Opens with a specific verb and resource: "Start a user-requested flow in the CALLER's repository," which immediately separates it from get_flow, list_flows, save_flow and delete_flow. It also clarifies the tool returns instructions rather than executing them, so the agent understands what 'run' means here.

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?

Explains the flow source resolution order (repo:, then user:, then builtin:), how repo_path defaults and is constrained, and when workspace errors occur, plus the follow-on step of executing returned content. It does not name sibling tools as alternatives (e.g., reading a flow without running it), so routing guidance is strong but not exhaustive.

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