Skip to main content
Glama

send_flow_to_contacts

Destructive

Run an EXISTING interactive flow for each listed contact right now, outside any trigger — as if each of them had just triggered it. Use it when the WHOLE message is the flow — its first block's text, media and buttons are what the recipient sees. To send your own custom text with buttons that run a flow on tap, prefer send_message with buttons: [{ text, flowId }]; it needs no wrapper flow. The flow starts at its start block for every recipient, and any {{var|name}} inside it resolves against that recipient's own variable context. No deploy is needed — the runtime compiles the flow on demand — but the flow must already be applied (use the ids apply_actions returned). Contacts are targeted by contactId only (from list_contacts), 1 to 50 per call. Duplicates are collapsed. Each contact is dispatched independently: one bad id fails its own row in results and the others still go out, so read sent/failed, not just the absence of an error. An unsubscribed contact, or a contact whose bot is not active, is refused — the same rule send_message applies. Nothing is queued for it; its row has ok: false, the reason in error, and refused set to contact_unsubscribed or bot_inactive. A sleeping bot is not refused: it is woken first. BROADCAST and OPERATION flows are rejected — a broadcast flow runs in an audience scope (send it with its broadcast) and an operation runs in system context (use run_operation). For a large audience this is the WRONG tool: create a broadcast whose flow filter selects the audience, and launch that once. Requires the send_flow_to_contact permission. NOT idempotent and not reversible — every call reaches real people again and a sent message cannot be recalled. Confirm the flow and the exact recipient list with the user before calling, and never retry a timed-out call blindly.

Input Schema

NameRequiredDescriptionDefault
flowIdYesRequired. Id of the already-applied INTERACTIVE flow to run. Broadcast and operation flows are rejected.
paramsNoOptional. Literal values for the flow's declared input params (see `inputParams` in get_flow_context), keyed by param id. They are run-scoped — the flow reads them as {{param|<paramId>}} — and a required param left out rejects the whole call before anyone is messaged.
contactIdsYesRequired. Between 1 and 50 FlowCastle contact ids (from list_contacts) — NOT platform ids. Each one receives its own run of the flow.
applicationIdNoApplication (workspace) id. Optional: an application-scoped key (app_...) defaults to its own application, but a personal key (usr_...) has no default and omitting it fails with MCP_APPLICATION_REQUIRED. Call list_applications to get the id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / params
      Added value: +{
      +  "description": "Optional. Literal values for the flow's declared input params (see `inputParams` in get_flow_context), keyed by param id. They are run-scoped — the flow reads them as {{param|<paramId>}} — and a required param left out rejects the whole call before anyone is messaged.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "paramId": {
      +        "type": "string"
      +      },
      +      "value": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "paramId",
      +      "value"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already flag destructive/non-idempotent/open-world, and the description goes well beyond them: per-contact isolated dispatch with per-row `ok:false`/`error`/`refused` codes, refusal rules for unsubscribed contacts and inactive bots, sleeping bots being woken, no deploy needed, the required send_flow_to_contact permission, and the explicit warning never to blind-retry a timeout. The 'not reversible / cannot be recalled' line partly restates destructiveHint but adds the concrete consequence.

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?

Front-loaded with the core purpose and the send_message alternative in the first sentences, and nearly every sentence carries operational information. It is dense, though: the refusal rule is stated twice (once generally, once with the `refused` enum detail) and some flow-type/limit details repeat the schema descriptions.

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?

No output schema exists, yet the description explains the return shape (`results` rows, `sent`/`failed` counts), the auth/permission requirement, workspace resolution caveats handled by the schema, and the concurrency semantics. An agent has everything needed to call it safely and interpret the response.

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 baseline is 3; the description still adds real meaning — flowId must be an already-applied interactive flow from apply_actions, contactIds are FlowCastle ids not platform ids with duplicate collapsing, and params are run-scoped {{param|id}} values where a missing required param rejects the entire call before anyone is messaged.

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?

States a precise verb+resource+scope: run an EXISTING interactive flow for each listed contact right now, outside any trigger, starting at the start block. It explicitly distinguishes itself from send_message (custom text with buttons) and from broadcast/operation flows, so an agent can pick it correctly without opening another schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use ('when the WHOLE message is the flow'), when-not (large audience → create a broadcast; custom text → send_message with buttons; operation flow → run_operation), and flow-type exclusions (broadcast and operation flows rejected). Alternatives are named with the condition that selects them.

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.