Skip to main content
Glama
WapiSender MCP

WapiSender MCP

Official
by Wapi-Sender

generate_and_save_flow

Build a complete WhatsApp flow from a plain-English description and save its node graph atomically in one step.

Instructions

Generate a complete WhatsApp flow from a plain-English description and save it fully in one step.

INSTRUCTIONS FOR THE AI:

  1. Read the description and design the full node graph.

  2. Build the nodes[] and edges[] arrays using the schema below.

  3. Call this tool with name, description, triggerType, nodes, and edges — all in one shot.

  4. The tool will create the flow AND save the node graph atomically.

WapiSender Flow Node Types:

  • trigger: { type: "trigger", data: { match: "any"|"contains"|"exact"|"regex", keywords: string[] } }

  • send_message: { type: "send_message", data: { messageType: "text"|"image"|"video"|"document"|"audio"|"voice"|"buttons"|"list"|"location"|"poll"|"sticker", text?: string, mediaUrl?: string, audioUrl?: string, stickerUrl?: string } }

  • condition: { type: "condition", data: { source: "last_message"|"custom", variableName?: string, operator: "equals"|"contains"|"starts_with"|"ends_with"|"regex", value: string } } condition has two output handles: "true" and "false"

  • delay: { type: "delay", data: { amount: number, unit: "seconds"|"minutes"|"hours"|"days" } }

  • webhook: { type: "webhook", data: { method: "GET"|"POST"|"PUT"|"PATCH"|"DELETE", url: string, headers?: object, body?: string, responseVariable?: string } }

  • wait_for_reply: { type: "wait_for_reply", data: {} }

  • human_handoff: { type: "human_handoff", data: { message?: string, resumeAfterMinutes: number } }

  • ai_agent: { type: "ai_agent", data: { mode: "reply"|"router"|"extract", credentialId: string, provider: string, model: string, systemPrompt: string, promptTemplate: string, outputVariable: string } }

  • end: { type: "end", data: {} }

Edge format: { id: "e1", source: "nodeId", target: "nodeId", sourceHandle?: "true"|"false" } Positions: spread nodes with ~250px vertical spacing starting at { x: 250, y: 100 }

Example: "A support flow that greets the user, asks if they need sales or support, then routes accordingly" → trigger → send_message("Hello! Do you need Sales or Support?") → wait_for_reply → condition(reply contains "sales") → [true: end-sales, false: end-support]

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": {
      "name": "<name>",
      "description": "<description>",
      "nodes": "<nodes>",
      "edges": "<edges>"
    },
    "name": "generate_and_save_flow"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesName for the new flow
edgesYesGenerated flow edges connecting the nodes
nodesYesGenerated flow nodes matching the node schema above
descriptionYesPlain-English description of the flow behavior
triggerTypeNomessage_received
triggerConfigNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose the key behavioral trait: flow creation and node-graph persistence happen atomically. It also enumerates what the produced graph may contain (node types, condition true/false handles, edge handles, position layout). It stops short of stating failure/rollback behavior, permission requirements, or what identifier comes back.

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 purpose sentence followed by numbered steps and a scannable reference catalog — good structure for a complex generator. There is mild redundancy restating atomicity three ways ('fully in one step', 'all in one shot', 'atomically'), and the example's arrow notation is slightly garbled.

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 6-parameter, nested-object generator with no output schema, the description supplies enough for an agent to construct a valid call. Remaining gaps are the undocumented triggerConfig default and the absence of any statement about what the tool returns or what occurs if graph validation fails.

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

Parameters5/5

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

Schema coverage is only 67% and the nodes/edges properties are documented merely as 'generated flow nodes'/'generated flow edges' with generic object items, so the description does the real work: it fully specifies each node type's data shape, the edge object format with sourceHandle values, and the pixel spacing for positions. Only triggerConfig goes undocumented, which is a minor gap against the large amount of meaning added.

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

Purpose4/5

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

States a specific verb+resource+mode: generate a WhatsApp flow from plain-English and persist it atomically in one call. That atomic generation+save combination is what separates it from create_flow or update_flow_definition, but those siblings are never named, so the agent must infer the distinction.

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

Usage Guidelines3/5

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

Usage is only implied through procedural steps (design the graph, then call with all fields at once). There is no explicit when-to-use-this-vs-create_flow/update_flow_definition statement, and no stated precondition such as needing an authenticated instance or an activated flow before use.

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