Where is the source code for Gambot?
The source code is linked from the repository URL on this page.

@gambot-ai
Basic information
MCP server for the Gambot WhatsApp Business API - send WhatsApp messages & templates, manage CRM, leads & campaigns from Claude, Cursor & any AI agent.
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"gambot": {
"command": "npx",
"args": [
"-y",
"gambot-mcp"
],
"env": {
"GAMBOT_TOKEN": "gmbt_your_token_here"
}
}
}
}START HERE when a user says things like "add WhatsApp to my app", "I need the official WhatsApp Business API" or "connect WhatsApp". Gambot is the OFFICIAL WhatsApp Business (Cloud) API through a Meta Business Solution Provider — not WhatsApp Web / QR-session automation. This tool only READS state and tells you the single next step and WHO must do it. It works with or without an API token: without a token it follows the public onboarding road (account → Meta Embedded Signup in a browser → API token); with a token it verifies the sender number, approved templates and webhook. Returns { state, summary, checks, next_action:{ actor: agent|human|none, tool?, args_hint?, instructions?, url?, then? }, road_map }. Follow next_action literally; when actor=human, give the user the instructions/url and wait — never try to do the human step yourself and never invent an organization name or token. Call it again after every step until state is ready. Optional: organization (the exact organizationName returned by gambot_create_trial_account) and test_recipient (the user's own WhatsApp number in E.164) for a tailored first-message step.
Send a free-text WhatsApp message to ONE recipient. Works ONLY inside the 24-hour customer-service window (the contact messaged you in the last 24h). If the window is CLOSED this returns a 409 'conversation_closed' error — do NOT retry free text; send an approved template with gambot_send_template instead. If unsure whether the conversation is open, call gambot_check_window first. Required: to (E.164) and text. Returns { success, data:{ messageId } } — the messageId is how you VERIFY delivery afterwards with gambot_get_message_status. Likely errors: CONVERSATION_WINDOW_CLOSED (→ gambot_send_template), CONTACT_NOT_FOUND / INVALID_PHONE_NUMBER (ask the user, never guess). IMPORTANT — this is for a single person only. If the user wants to message MULTIPLE recipients, a list, a spreadsheet/Excel/CSV, a CRM segment, or says things like 'send to everyone / to all my contacts / to this list', DO NOT call this tool in a loop. Use a campaign instead: gambot_send_campaign_from_excel (for a sheet), gambot_send_campaign (ad-hoc list/segment), or gambot_create_campaign (to save/schedule). Campaigns handle rate-limits, per-recipient variables, opt-out/consent and reporting.
Send an approved WhatsApp template with variables to ONE recipient. Can initiate a conversation even outside the 24-hour window. Required: to (E.164) and templateId (id or name from gambot_list_templates — it must be APPROVED by Meta). Pass variables[] in body order; if the template has variables, call gambot_get_template_variables first and ask the user for values you do not have. Returns { success, data:{ messageId } } — verify delivery with gambot_get_message_status. Likely errors: TEMPLATE_NOT_APPROVED / TEMPLATE_NOT_FOUND (→ gambot_list_templates), MISSING_TEMPLATE_VARIABLES (→ gambot_get_template_variables). IMPORTANT — single recipient only. For a BULK/broadcast send (multiple numbers, an Excel/CSV/spreadsheet the user uploaded, a CRM segment, or 'send to everyone / all contacts / this list'), DO NOT loop this tool. Use a campaign: gambot_send_campaign_from_excel (read the sheet and map columns → template variables), gambot_send_campaign (ad-hoc list/segment, no save), or gambot_create_campaign (save and/or schedule once/recurring). Campaigns manage throughput, per-row variables, opt-out/consent and delivery reports.
Check whether a message you sent was delivered. Pass the messageId returned by gambot_send_text / gambot_send_template (or per recipient from a campaign send) and, for a fast exact lookup, the recipient's phone. Returns { messageId, phone, status (sent|delivered|read|failed), time, errorMessage? }. Use it as the final step of 'send a first test message' and whenever a user says 'I don't see the message arrived'. If status=failed with Meta error 131042 the response carries a paymentIssue block: the WhatsApp Business API payment method is SEPARATE from the Meta Ads one — tell the user to add one in Meta Business Settings ▸ Billing.
List the org's conversations = CONTACTS, ordered by most recent message. This returns WHO you've been talking to with per-contact METADATA only — name, phone, last-message time and a short last-message preview, plus status/tags/owner. It does NOT return the message history/content. To read the messages of ONE conversation use gambot_get_conversation_messages; to read message CONTENT across ALL conversations for a period (e.g. 'today') use gambot_analytics_transcript.
Read the full message HISTORY (content) of ONE conversation, identified by the contact's phone, newest-first and paginated with before/after cursors. Use this to see everything said with a specific customer. For just the LIST of conversations/contacts (no content) use gambot_list_conversations; for message content across ALL conversations in a period use gambot_analytics_transcript.
CHAT MEDIA tool (files that came in/out through WhatsApp CONVERSATIONS) - NOT the media library; for files the organization stores on purpose use the gambot_library_* tools. Get a short-lived DOWNLOAD URL for a media file (image, video, audio, voice note, document, sticker) that belongs to a conversation. Gambot's media storage is PRIVATE: a media URL/id from the API is not directly browsable — exchange it here (or GET it with the same API token) to get the file. Two ways to identify the file: (1) mediaId — returned as `mediaId` on messages from gambot_get_conversation_messages (its `mediaUrl` is the same file at GET /api/v1/media/{mediaId}); (2) metaMediaId + from — the WhatsApp media id and the sender's phone from the `media[]` list of an incoming_message webhook (this also works if the file has not been stored yet — it is fetched from WhatsApp on demand; WhatsApp keeps media ~30 days). Returns { mediaId, url, expiresAt }; download `url` immediately WITHOUT any Authorization header (it is a signed link, default valid 15 minutes, max 1440 via ttlMinutes). Only media of YOUR organization can be fetched. Errors: not_found (wrong id, other organization, or expired at WhatsApp).
MEDIA LIBRARY tool (NOT chat media - for files that came through WhatsApp conversations use gambot_get_media_url). Store a file or a piece of TEXT in the organization's media library (the 'Media Manager' in the app) and get an ONLINE link to it. Use it as a place to keep and serve information that must be reachable online: a JSON config, a markdown/text note, a CSV, a price list, a PDF, an image. Give EXACTLY ONE source: text (plain content, e.g. JSON or markdown - set fileName like 'prices.json'), contentBase64 (binary, e.g. an image/PDF), or url (public http(s) URL that Gambot downloads and re-hosts). Max 50MB. Links: the result ALWAYS has permanentUrl = a link that NEVER expires (safe to put in a template, a website or a bot; it keeps working until the file is deleted). Pass ttlHours (1-168, i.e. up to 7 days) to ALSO get an EXPIRING signed link in `url` + expiresAt that stops working after that time; without ttlHours, `url` equals permanentUrl. Returns { id, mediaId, name, mimeType, fileType, size, folderId, url, permanentUrl, expiring, expiresAt }. Keep `id` to read, update or delete the file later (to change the content of an existing file but keep the SAME permanent link use gambot_library_update_file). Optional folderId from gambot_library_list_folders.
MEDIA LIBRARY tool (NOT chat media). List files stored in the media library (newest first). Filter by folderId, fileType (image|video|audio|document) or search (file-name contains). Each item has id, mediaId, name, mimeType, fileType, size, folderId, createdAt, permanentUrl (never expires) and url (= permanentUrl, or an expiring link when ttlHours is given). Returns { items, count, total, limit, offset }. For the content of a text file use gambot_library_get_file with includeContent=true.
MEDIA LIBRARY tool (NOT chat media - for a file from a WhatsApp conversation use gambot_get_media_url). Get ONE stored library file and its links by its library file `id` (from gambot_library_upload_file / gambot_library_list_files). Links: permanentUrl never expires; ttlHours (1-168) additionally returns an EXPIRING link in `url` + expiresAt (without it `url` = permanentUrl). includeContent=true also returns `content` = the file's text when it is a text-like file (text/*, JSON, XML) up to 512KB - this is how you READ back information you stored with gambot_library_upload_file. Larger/binary files: download permanentUrl or url (no Authorization header needed). Returns { id, mediaId, name, mimeType, fileType, size, url, permanentUrl, expiring, expiresAt, content? }. Errors: not_found.
MEDIA LIBRARY tool (NOT chat media). Overwrite the content of an EXISTING library file IN PLACE: the id and the permanentUrl stay the same, so everything that already points to the link now serves the new content (ideal for keeping an online JSON/config/price list up to date). Give new content as text, contentBase64 or url; optionally rename (fileName, display only) or change contentType. Returns the same shape as gambot_library_upload_file. Errors: not_found.
MEDIA LIBRARY tool (NOT chat media). Permanently delete a library file: the record AND the stored file, so its permanentUrl and any expiring links stop working. Irreversible - confirm with the user first.
MEDIA LIBRARY tool (NOT chat media). List the media library folders. Returns { items:[ { id, name, parentId, createdAt } ], count }. Use an id as folderId in gambot_library_upload_file / gambot_library_list_files.
MEDIA LIBRARY tool (NOT chat media). Create a folder in the media library (optionally inside parentId). Returns { id, name, parentId }.
Check whether the 24-hour WhatsApp customer-service window is OPEN for a contact BEFORE you message them. WhatsApp only allows free text while the window is open (i.e. the contact messaged you in the last 24h); once it's CLOSED you MUST use an approved template. Call this whenever you're about to send a one-off message and aren't sure the conversation is active — then route accordingly: windowOpen=true → gambot_send_text (or a template); windowOpen=false → gambot_send_template (list options with gambot_list_templates). Returns { phone, windowOpen, canSendFreeText, requiresTemplate, reason, recommendation, defaultTemplateId }.
List the organization's connected WhatsApp SENDER numbers. Use this in a multi-number org to discover which line you can send FROM: pass the returned `phoneNumberId` (or `displayNumber`) as `from` on gambot_send_text / gambot_send_template, or as `fromNumberId` on the campaign tools. When omitted, the org's PRIMARY number is used. Returns { count, items:[ { phoneNumberId, displayNumber, label, isPrimary, status, defaultTemplateId } ] }.
List WhatsApp conversations ranked by how long the customer has been WAITING for a reply (the message-response / chat SLA). The clock starts at the customer's last inbound message and stops on ANY reply (human or bot). Levels come from the org's settings: 'warn' (amber) and 'breach' (red), and — when business hours are enabled — only working time is counted. Use this to answer 'who is waiting / which chats breached SLA / who hasn't been answered'. level: open (default = warn+breach, the actionable ones) | all | ok | warn | breach. Returns { level, config:{ warnMinutes, breachMinutes, statuses, businessHoursEnabled }, count, total, items:[ { phone, name, lastMessage, lastMessageTime, lastConversationStatus, waitingMinutes, level, ownerId, ownerName } ] } sorted longest-waiting first.
Message-response SLA status for ONE conversation: is the customer currently waiting for a reply, for how many minutes, and at what level (ok/warn/breach). Returns { phone, name, lastMessageDirection, lastMessageTime, lastConversationStatus, waiting, waitingMinutes, level, ownerId, ownerName, config }.
List all WhatsApp templates for the organization.
Get a single template by id, including Meta approval status.
Get the dynamic variables of a template.
Return the list of contact phone numbers for a TEMPLATE, segmented by how each contact interacted with a button — measured ACROSS ALL SEND SOURCES (bot flows, campaigns/broadcasts, manual agent sends, and the API/MCP). THIS is the tool for 'send to everyone who clicked button X on template T', 'who received T but never pressed X', or 'who did we send T to'. It unifies URL/CTA button clicks (tracked links) AND quick-reply button replies (the common bot case), so you don't have to know which send channel or button type was used. modes: 'clicked' = pressed the button; 'not_clicked' = received the template but never pressed it; 'recipients' = everyone it was sent to. `button` is REQUIRED for clicked/not_clicked. FOLLOW-UP: pipe the returned `phoneNumbers` straight into gambot_send_campaign (recipientPhoneNumbers) to message that exact segment. Response also includes `counts` { recipients, clicked, notClicked }.
Create a new WhatsApp template (submitted to Meta for approval). Name must be English, lowercase_with_underscores. Components use the full Meta shape and support: a TEXT or media (IMAGE/VIDEO/DOCUMENT) HEADER, a BODY with {{1}} variables, a FOOTER, and BUTTONS (QUICK_REPLY / URL / PHONE_NUMBER). For a media header you can either put example.header_handle on the HEADER component yourself (upload it first with gambot_upload_template_media), or simply pass headerMediaUrl (a public URL) and let Gambot upload it and inject the handle. ── SMART GUIDANCE — Gambot enriches your template automatically, so lean on it: (1) LINK BUTTONS: whenever the message refers to a link/CTA (book, track, open, pay, view), ADD a URL button ({type:"URL",text:"...",url:"https://..."}) instead of pasting the raw link in the body — one-tap buttons convert far better. (2) CLICK TRACKING (tracking link): STATIC url-button links are auto-wrapped in a Gambot tracked short link so clicks are logged (and can fire botomations). It's ON by default for MARKETING; you always pass the REAL destination url — Gambot swaps in the tracker. Set "trackClicks":false on a URL button to keep the raw link, or "trackClicks":true to force tracking on a non-marketing template. (3) MARKETING / BROADCAST (דיוור): use category 'MARKETING' for any promotional broadcast. Its opt-out FOOTER is MANDATORY and OWNED by Gambot — DO NOT add your own FOOTER for MARKETING; Gambot adds a localized opt-out footer (Hebrew 'להסרה יש להשיב הסר', else 'Reply STOP to unsubscribe') and OVERRIDES any non-opt-out footer you passed. An existing opt-out footer or a 'הסר'/'STOP' QUICK_REPLY button is respected. The new template starts as PENDING (awaiting Meta approval). You do NOT have to wait for approval to SCHEDULE with it: you can immediately call gambot_create_campaign with campaignTrigger='Scheduled' and this template's id — it just has to be APPROVED before the scheduled runAt.
Upload a public media URL (image/video/document) to Meta and get a reusable header_handle for a template's media HEADER. Use the returned headerHandle inside a HEADER component: {type:'HEADER',format:'IMAGE',example:{header_handle:[headerHandle]}}.
Get contact field definitions (base + custom/dynamic). Contacts store custom values as top-level keys — pass them via 'customFields' on create/update.
Create a contact (returns the existing one if the phone is already known). Custom/dynamic fields go under 'customFields' (see gambot_get_contact_fields for keys). ── MARKETING COMPLIANCE — always consider these when creating a contact: • consent ('הסכמה לדיוור'): set consent=true ONLY when the person actually agreed to receive marketing (they ticked a box / said yes / signed up). Set consent=false to record an opt-out. If you don't know, OMIT it — never assume true. consent=false contacts are auto-excluded from every broadcast. • source ('מקור'): where the contact/consent came from (e.g. 'website form', 'landing page', 'phone call', 'in-store', 'imported list'). Pass it whenever known — it's the audit trail for the opt-in and is stored as both the contact's source and the consent source. To change consent later use gambot_set_contact_consent.
List or SEARCH the org's contacts directory (all contacts — CRM + chat), paginated and ordered by most-recent activity. THIS is the tool for 'who are my contacts', 'find the contact named/phoned/emailed X', 'contacts tagged VIP', 'contacts with conversation status Open', 'contacts owned by agent Y'. Each item: phoneNumber, name, email, tags, conversationStatus (Open/In Process/Closed), conversationCategory, ownerId, ownerName, consent, isSpam, isCtwa, lastMessage (preview), lastMessageTime, createdOn. The response also includes a `summary` aggregated over the WHOLE filtered set (not just the current page) — { total, consent:{ optedIn, optedOut, unknown }, spam, ctwa, byStatus } — so you can answer 'how many contacts do I have / how many opted-in vs unsubscribed / how many are spam / how many came from ads' from ONE call without paging. For ONE contact's full record use gambot_get_contact; for ad-sourced contacts only use gambot_list_ctwa_contacts; for chat threads use gambot_list_conversations. Returns { pageNumber, pageSize, count, total, summary, items }.
Fetch a contact by phone number. The response carries the contact's MARKETING-CONSENT status: • consent=true → opted-in to marketing ('הסכמה לדיוור'); consent=false → opted-out/unsubscribed ('ביקש/ה הסרה', auto-excluded from broadcasts); consent=null → unknown/never set (still mailable). • isSpam=true → marked as spam/blocked (also auto-excluded). It also returns the contact's tags (`keys`), conversation status (`lastConversationStatus`: Open/In Process/Closed) and category (`lastConversationCategory`). Use gambot_set_contact_consent to opt a contact in/out, and gambot_mark_contact_spam to flag spam. When the contact came from a Click-to-WhatsApp (CTWA) ad, the response also carries the referral/ad fields (referralSourceId, referralHeadline, referralPlatform, etc.).
Set a contact's marketing-consent status ('הסכמה לדיוור'). consent=true opts the contact IN (mailable); consent=false opts them OUT / unsubscribes them — after which they are automatically excluded from ALL future broadcasts (campaigns). Use this to record an opt-out the customer requested off-platform (phone call, email, web form), or to re-enable a contact who gave fresh consent. Recipients can also opt out themselves by replying הסר/stop/unsubscribe. Optionally pass a 'source' note for the audit trail.
Mark a contact as spam (isSpam=true) or clear the flag (isSpam=false). Marking as spam also opts the contact out of marketing (consent=false), so they are excluded from broadcasts and hidden from the active chat list. Unmarking spam does NOT automatically restore marketing consent — use gambot_set_contact_consent for that.
List the contacts that were created from a Click-to-WhatsApp (CTWA) ad / Meta referral — i.e. people who messaged the business by tapping an ad on Facebook/Instagram — each enriched with the originating ad info. Filter by a single ad (adId = referralSourceId), by sourceType ('ad' | 'post'), and/or a creation date range (dateFrom/dateTo, yyyy-MM-dd). Paginated. Each item includes: phoneNumber, name, email, ownerId, ownerName, createdOn, keys, and a 'ctwa' object { adId, sourceType, headline, body, sourceUrl, platform, ctwaClid }. Use gambot_analytics_ctwa for aggregate CTWA performance and the list of unique ads.
Update a contact — only the provided fields are changed. Custom fields go under 'customFields'.
List the organization's contact TAGS (aka keys/lists) — the many-to-many labels a contact can carry and that campaigns target via the `keys` audience filter. Use this to resolve/validate a tag name before tagging or broadcasting. (Tags are different from a conversation CATEGORY, which is a single label per contact — see gambot_list_conversation_categories.)
Add and/or remove TAGS on ONE contact, MERGING with its existing tags (safe — it never wipes the others). Provide `add` and/or `remove` (arrays). New tags are auto-created org-wide. To overwrite the entire tag list instead, use gambot_update_contact with `keys`.
Add and/or remove TAGS across MANY contacts at once (merging with each contact's existing tags). Choose the audience with `phones` (explicit list) and/or `fromTag` (apply to every contact that currently has that tag — e.g. re-tag a whole group). Provide `add` and/or `remove`. Returns { requested, updated, notFound }. Great for 'tag everyone in group A as B', 'remove tag X from these numbers', bulk segmentation, etc.
Update MANY contacts in ONE call — e.g. 'tag every contact created this week whose name contains לקוח with דיוור', reassign an owner, set a category/consent, or write a custom field across a whole segment. Audience: `phones` (explicit) and/or `filter` { search, tag, status, category, ownerId, includeSpam, createdFrom, createdTo (yyyy-MM-dd, on the creation date) }. Change: `fields` { addKeys[], removeKeys[], ownerId, ownerName, category, consent, isSpam, customFields{} }. âš ï¸ ALWAYS TWO STEPS — CONFIRM FIRST: call with confirm=false (default) to PREVIEW; it returns { requiresConfirmation:true, count, change, willAffect:[{phoneNumber,name,createdOn}] } and changes NOTHING. Show the user that EXACT list of who will be affected AND what will change, get their explicit approval, and ONLY THEN re-call with confirm=true. On execution every affected contact gets a timeline note 'בוצע על ידי גמבוט ב×ישור המשתמש' (executed by Gambot with the user's approval). Pass `approvedBy` (who approved) for the audit record.
Update MANY leads in ONE call — e.g. move a segment to a stage, change status/priority/owner, or write a custom field across many leads. Audience: `ids` (explicit lead ids) and/or `filter` { search, createdFrom, createdTo (yyyy-MM-dd on createdOn) }. Change: `fields` — any base lead field (status, stageId, priority, ownerId, ownerName, source…) plus nested customFields{} (merged, never wiped). âš ï¸ ALWAYS TWO STEPS — CONFIRM FIRST: call with confirm=false (default) to PREVIEW; it returns { requiresConfirmation:true, count, change, willAffect:[{id,title,contactName,createdOn}] } and changes NOTHING. Show the user that EXACT list + what will change, get explicit approval, then re-call with confirm=true. Each affected lead's contact gets a timeline note 'בוצע על ידי גמבוט ב×ישור המשתמש'. Pass `approvedBy` for the audit record.
List the organization's conversation CATEGORIES (labels). A contact has AT MOST ONE category (lastConversationCategory) — a single classification for routing/pipeline, unlike tags which are many-to-many. Use before gambot_set_contact_category.
Set a contact's conversation CATEGORY (single label). Pass an empty string to clear it. See gambot_list_conversation_categories for the available labels. This is distinct from tags (use gambot_update_contact_tags for many-to-many tags).
Set a contact's conversation STATUS — one of 'Open', 'In Process', 'Closed'. This is the same status the chat sidebar and status filters use (setting it also syncs the underlying conversation). Use to close/reopen a conversation or move it into processing from an external workflow.
Get lead field definitions: { baseFields, customFields }. Custom lead values are stored under a nested 'customFields' map — pass them the same way on create/update.
Create a CRM lead (contact created if missing, optional template send). Accepts all base lead fields plus a nested 'customFields' object. See gambot_get_lead_fields for available fields.
Update a lead — only the provided fields are changed. Accepts any base field plus a nested 'customFields' object (merged with existing custom values).
Get case (×¤× ×™×™×”) field definitions: { baseFields, customFields }. Custom case values are stored under a nested 'customFields' map — pass them the same way on create/update.
Create a case (support ticket / ×¤× ×™×™×”). Accepts base fields plus a nested 'customFields' object.
Update a case — only the provided fields are changed. Accepts base fields plus a nested 'customFields' object (merged with existing custom values).
Create a task (optionally linked to a contact via contactPhone).
List leads (paginated).
Get a single lead by id.
List cases (paginated).
Get a single case by id.
List cases (×¤× ×™×•×ª / support tickets) ranked by their per-stage SLA — i.e. cases that have sat in their current stage longer than the stage's target (or are about to). Use this to answer 'which cases breached SLA / are at risk / are overdue'. 'breached' = past the stage deadline; 'at_risk' = within the last 20% of the allotted time; 'ok' = within target; 'none' = the current stage has no SLA; 'resolved' = closed/resolved (clock stopped). Deadlines are business-hours-aware when enabled. status: open (default = breached+at_risk) | all | breached | at_risk | ok | none | resolved. Returns { status, config:{ businessHoursEnabled, stages }, count, total, items:[ { caseId, subject, contactPhone, contactName, priority, statusId, ownerId, ownerName, stageId, stageName, stageEnteredAt, stageDueAt, slaHours, slaUnit, minutesInStage, minutesRemaining, breached, status } ] } (breached first, then soonest to breach).
Read the human-written notes (הערות) from across the CRM — the same feed as the in-app 'Notes Hub'. Aggregates notes attached to contacts (from the chat timeline), leads and cases (×¤× ×™×•×ª). Filter by source ('contact' | 'lead' | 'case'), a date range (dateFrom/dateTo, yyyy-MM-dd; defaults to the last 30 days), the author (userId), or a free-text search inside the note body. Paginated. Each item includes: note, entityType, entityId, contactId, contactName, entityName, createdOn, createdById, createdByName. Use gambot_get_entity_notes to read the notes of ONE specific contact/lead/case.
Read the notes (הערות) attached to a single record. entityType is 'contact', 'lead' or 'case': for 'contact' pass the contact's phone number as entityId; for 'lead'/'case' pass the record id. By default this follows the organization's 'Sync Notes Between Entities' setting (ON by default): a contact also returns the notes written on its leads and cases, and a lead/case also returns its contact's notes — exactly what the user sees in the app's timeline. Pass includeRelated=false to get ONLY the notes stored on that exact record. Returns the notes newest-first (each with id, note, createdOn, createdById, createdByName, plus the ORIGIN entityType/entityId the note is stored on and viaRelatedEntity=true when it came from a related record). To edit a note use gambot_update_note with that note's id and origin entityType/entityId.
Write a note (הערה) on a contact, lead or case — the same internal timeline note a user adds in the app (NOT a WhatsApp message to the customer). entityType is 'contact' (entityId = the contact's phone number), 'lead' or 'case' (entityId = the record id). The note is stored on THAT record, shows in its timeline immediately, and — when the organization's 'Sync Notes Between Entities' setting is on (default) — also appears in the related records' timelines (a note on a lead shows on the lead's contact, and vice-versa). The record must already exist. Shown as authored by 'Gambot MCP'. Returns { id, entityType, entityId, note, createdOn }. Keep the id if you may need to edit it with gambot_update_note.
Replace the text of an existing note (הערה). Pass the note's id plus the entityType/entityId of the record the note is STORED on — both are returned with every note by gambot_get_entity_notes / gambot_add_note (a lead note read via its contact still reports the lead as its origin). Only user notes can be edited (never system events). The edit is stamped with the update time and 'Gambot MCP'. Returns { id, entityType, entityId, note, updatedOn }.
List tasks for the organization.
Get a single task by id.
Update a task — only the provided fields are changed.
Create a price quote. quoteData holds the quote fields (title, items, total, contact…).
List price quotes (paginated).
Get a single quote by id.
Update quote fields (partial).
Create an invoice draft. invoiceData holds the invoice fields.
List invoices (paginated).
Get a single invoice by id.
Update invoice fields (blocked once issued/locked).
Issue a DRAFT accounting document — locks it and assigns the official sequential document number (IRREVERSIBLE; confirm with the user first). Runs the same pipeline as the app: content validation (billing documents need ≥1 item), the legal Tax Authority guard and an automatic allocation number (מספר הקצ××”) for tax_invoice / combined above the statutory threshold (₪15,000 in 2026, ₪10,000 in 2027, ₪5,000 from 2028). If the org is not connected to the Tax Authority you get error `allocation_required` — a human must connect it in Settings → Invoice settings → Tax Authority. Returns { documentNumber, status, publicUrl (customer-facing view/download link), allocation }. To create AND issue in one call use gambot_create_accounting_document.
Read what this organization is set up for BEFORE issuing documents: business details configured, VAT rate, Tax Authority connection (allocation numbers), allocation threshold, the next official document number per type, copy-recipient emails and the supported document types.
Create a REAL accounting document in ONE call — the same engine as the Botomation 'Accounting document' action. docType: tax_invoice (×—×©×‘×•× ×™×ª מס, default), combined (×—×©×‘×•× ×™×ª מס קבלה), receipt (קבלה), transaction (חשבון עסקה), order (×”×–×ž× ×”), delivery_note (תעודת משלוח), work_order, purchase_order. VAT, discount and totals are computed server-side. By default it ISSUES the document (official numbering + Tax Authority allocation number when required; IRREVERSIBLE — confirm details with the user first); issueNow=false saves a draft for human review. sendToCustomer=true also emails it to customerEmail. combined/receipt: pass paymentMethod (bank_transfer, credit_card, cash, check, bit, paybox, paypal, app_payment, other) — one payment row for the document total is recorded. Pass quoteId to build from an existing quote instead of items, or sourceInvoiceId to link to an invoice. Credit invoices / credit receipts are created with gambot_derive_invoice_document. Call gambot_get_invoice_settings first to check readiness. Returns { invoiceId, documentNumber, publicUrl, allocation }.
Create a follow-up document from an EXISTING invoice/document: a receipt (קבלה) after payment, a combined/tax invoice, a credit invoice (×—×©×‘×•× ×™×ª זיכוי), a credit receipt, a delivery or return note. Receipts and credits may be PARTIAL (partialAmount) — the source keeps a running balance (paidAmount / balanceDue / paymentStatus open|partial|paid); a credit cannot exceed what is still owed. Creates a DRAFT by default; issue=true also issues it (irreversible — confirm first). Returns the new invoiceId.
Create a store order. Body holds order fields (customer, items, total…).
List orders (optionally filtered by status / store / date range).
Get a single order by id.
Update order fields (merge).
List payment / clearing transactions (עסק×ות), newest first. Use this to answer 'what did this customer pay/owe' or to give a transaction breakdown. Each item includes amount, status (pending/paid/failed), customerName, customerPhone, description, entityType (quote/invoice/order/lead/case…), vatInclusive, amountBeforeVat, provider, paymentUrl, items[] and createdAt/paidAt. Filter by contactPhone, status or entityType.
Get a single payment transaction by id (Firestore document id or the provider transactionId), including the full amount breakdown (amount, amountBeforeVat, vatInclusive, discount), status, customer details, linked record and items[].
List e-signature documents (newest first).
Get a single e-signature document, including its signing results.
Get the signing link(s) to distribute for an existing signature document (one per signer). Share with signers via WhatsApp/email/SMS.
List web forms.
Get a single web form definition.
Get the stable public shareable link for a web form. Distribute it to customers via WhatsApp/email/SMS/QR; all submissions land in the form's submissions.
Get submissions (results) for a web form.
List document templates.
Get a single document template.
Get fill-only submissions generated from a document template.
Get the public fill link (/form/ URL) of a document template. Without contactPhone/leadId/variables this is the template's ONE PERMANENT link: the same URL on every call, and template edits are applied to it automatically (public forever unless an expiry is set on the template in the UI). With pre-fill data (contactPhone/leadId/variables) a separate personal instance is created instead.
Create an organization user (team member). Sends a welcome email + WhatsApp invite.
List organization users (excluding system bots).
Get a single user by id.
Update user fields — only the provided ones are changed.
Disable a user (status = inactive).
Enable a user (status = active).
Permanently delete an organization user (removes both the auth account and the profile). This is irreversible — prefer gambot_disable_user to just deactivate access.
List all broadcast campaigns for the organization.
List scheduled campaigns that are waiting to run.
Get a single campaign by id.
Get the run results/report for a campaign (sent/delivered/read/replies/clicks).
Returns the REAL current date/time in a timezone (default Asia/Jerusalem) plus the UTC time and offset. Call this BEFORE scheduling anything (gambot_create_campaign / reschedule / email campaigns) so 'today', 'in an hour', '14:30' are computed from the real clock, not guessed. Gambot reads every runAt as LOCAL wall-clock time in the `timezone` you send with it — so use `nowLocal` from here, keep the same `timezone` in the scheduling call, and never convert to UTC.
Create a SAVED WhatsApp broadcast campaign. Use this whenever the send should be a campaign — i.e. ANY scheduled send (one-time OR recurring is ALWAYS a campaign), or a reusable CRM-segment broadcast. For a plain immediate send to a tag/list use gambot_send_campaign; for an Excel/CSV sheet use gambot_send_campaign_from_excel (which also saves a campaign). After creating, run it now with gambot_run_campaign (scheduled ones run automatically at runAt). For a template broadcast set messageType='Template' + wabaTemplateId; for free text set messageType='regular' + message (note: a 'regular' broadcast only reaches recipients whose 24h window is open — prefer a Template for cold audiences). Audience: recipientSource='Excel' + ExcelData, or ContactFilters (CRM segment), or legacy ContactsQuery. Scheduling: campaignTrigger='Scheduled' + scheduleType ('once' with runAt+timezone, or 'repeated' with interval/intervalNumber/endCondition). TIME RULES (shared contract): ALWAYS send `timezone` (IANA, e.g. Asia/Jerusalem) together with every runAt, and send runAt as the LOCAL wall-clock time in that timezone (2026-10-14T13:30:00) — no Z, no UTC offset, no UTC conversion. Call gambot_get_current_time first to know the real 'now'. A runAt in the past is rejected (it would fire immediately). The response's scheduling.runTimes lists every scheduled run in local time AND UTC (plus minutesFromNow) — check it matches what the user asked and tell them the local times. PENDING TEMPLATES: a SCHEDULED campaign MAY reference a template that is NOT yet approved (status PENDING) — it only needs to be APPROVED by Meta before runAt. So the flow 'send this to these people on Thursday' works as: gambot_create_template → then this tool with campaignTrigger='Scheduled' + the new template id, even while it's still pending. The response includes a non-blocking `templateStatusWarning` when the template isn't approved yet; relay it to the user (a REJECTED template will never send).
Update a campaign (send the full campaign object).
Delete a campaign by id.
Run an existing (saved) campaign by id now (resolves recipients and executes).
List the concrete SCHEDULED RUNS (occurrences) of a scheduled/recurring/block campaign — every future date it will fire, with each occurrence's runAt, status, and (for split campaigns) the recipient batch range. Works for ALL scheduled types: a one-time scheduled campaign (single occurrence), a recurring campaign (e.g. 'every Tuesday'), auto-split blocks, and manually-timed blocks. Use this FIRST to get the exact runAt values, then pass one to gambot_skip_scheduled_run (turn a single date off) or gambot_reschedule_scheduled_run (move a date). If `runs` is empty the campaign is pattern-only (simple interval with no materialized dates) — change its pattern with gambot_update_campaign instead.
Cancel a SINGLE upcoming occurrence of a scheduled/recurring campaign (e.g. 'skip this coming Tuesday but keep the weekly schedule'), or cancel ALL upcoming occurrences at once. Pass `runAt` (an exact value from gambot_list_scheduled_runs, matched to the minute) to skip just that date, OR scope='upcoming' to cancel every future run (already-sent runs are always kept). The rest of the schedule is re-armed automatically and untouched. To remove the whole campaign entirely use gambot_delete_campaign.
MOVE a single occurrence of a scheduled/recurring campaign to a new date/time, leaving every other occurrence untouched (e.g. 'push this Tuesday's send to Wednesday'). Pass `runAt` (the existing occurrence from gambot_list_scheduled_runs, matched to the minute) and `newRunAt` (the new datetime). The campaign's timezone is preserved.
IMMEDIATE 'run to a group' — send an ad-hoc broadcast NOW to a tag/segment/phone-list, WITHOUT saving a campaign. Use this ONLY for an immediate one-off send to CONTACTS. Do NOT use it for: a schedule (once or recurring) or an Excel/CSV sheet — those are ALWAYS saved as a campaign (use gambot_create_campaign for scheduled/recurring or CRM-segment campaigns, and gambot_send_campaign_from_excel for a sheet). TWO things are required: (1) an AUDIENCE and (2) the MESSAGE. AUDIENCE — pick ONE: `keys` (send to everyone with these tags/lists, e.g. keys:['מכבי חיפה'] — the most common request 'send to tag X'), `recipientPhoneNumbers` (explicit list), `excelRecipients` (per-recipient variables), or `filters` (advanced CRM segment). Never send with an empty audience — if the user named a tag/list, put it in `keys`. MESSAGE — you MUST set `messageType`: for a WhatsApp TEMPLATE set messageType='Template' AND `templateId` (the exact template the user chose); for free text set messageType='regular' AND `message`. Do not leave messageType/templateId empty when the user asked to send a specific template. Use gambot_list_templates to resolve the template name → id first if needed. PREFER A TEMPLATE for broadcasts: a 'regular' free-text broadcast is delivered ONLY to recipients whose 24-hour window is open (they messaged you in the last 24h) and SILENTLY FAILS for everyone else. Cold/one-way audiences must get a Template. REGULAR-BROADCAST SAFETY (messageType='regular'): the API will NOT send it straight away — it first returns error 'regular_window_confirmation_required' with { audienceCount, closedWindowCount, willReceive, recommendation }. You MUST relay this to the user: tell them how many recipients (closedWindowCount) will NOT receive the message because their 24-hour window is closed, and RECOMMEND sending a template instead. Only after the user decides: either switch to a template (messageType='Template' + templateId), or re-call this tool with confirmRegular=true to send the free text anyway (only the open-window recipients will get it). You can also call with dryRun=true first to preview the numbers without sending. Compliance is built in: contacts who opted out (consent=false — via a הסר/stop/unsubscribe reply, or set with gambot_set_contact_consent) and contacts flagged as spam (isSpam=true) are AUTOMATICALLY excluded from the audience. Every org also has an ACTIVE opt-out flow; the response echoes it under `optOut` (enabled=true) and your consent-to-mail under `consent`.
Send a single-recipient TEST of a template or free-text message. Great for previewing before a full broadcast.
Broadcast a WhatsApp TEMPLATE to everyone in an Excel/CSV the user gave you — the easiest way to do a mail-merge blast. An Excel/CSV broadcast is ALWAYS saved as a campaign (this matches the Gambot web app — there is no unsaved Excel send). If you send it immediately, this tool SAVES the campaign and then RUNS it right away; if you schedule it, it just saves it and the scheduler runs it. YOU (the agent) read the sheet and pass: `rows` (one object per row, keyed by the column header), `phoneColumn` (which column holds the phone), and the variable mapping — either `variableColumns` (ordered: 1st column → {{1}}, 2nd → {{2}}, …) or `variableMapping` ({ var1:'ColName', var2:'ColName2' }). TIP: call gambot_get_template_variables first to see how many variables the template expects, then map columns to them. Prefer a TEMPLATE (templateId): a free-text `message` broadcast only reaches recipients whose 24-hour window is open and silently fails for everyone else. To SCHEDULE add scheduling fields (scheduleType:'once' + runAt + timezone, or scheduleType:'repeated' + interval/intervalNumber/endCondition). Every original column is also stored per-recipient (rowData) so later automations can use any value by name. Compliance is built in: opted-out contacts (consent=false — via a הסר/stop/unsubscribe reply or gambot_set_contact_consent) and spam-flagged contacts (isSpam=true) are AUTOMATICALLY excluded; the org's ACTIVE opt-out flow is echoed under `optOut` (enabled=true) and your consent under `consent`.
List the organization's bots & chat automations (botomations). Pass botsOnly=true for only the visual menu/AI bots. Each item includes role (main_bot | activator | gambot_ai | human_intervention_cancel | return_to_menu | automation), triggerKind, sourceFlowId and linkedBotomationId — botomations sharing a sourceFlowId form ONE deployed bot 'package' (main bot + activator + human-intervention cancel + Gambot AI).
Get a single bot/automation with its full step definition (trigger + actions).
Return every botomation deployed together with this one (they share a sourceFlowId): the main bot plus its activator (the trigger, מפעיל), the human-intervention cancel (ביטול בוט בהתערבות ×× ×•×©×™×ª), the Gambot AI answerer and any return-to-menu helper. Use this to see the WHOLE bot before turning it on/off. If the bot has no sourceFlowId, returns just that bot.
Create a bot that automatically replies to an incoming WhatsApp message. Trigger on specific keyword(s) (matchType 'equals' or 'contains') or on ANY incoming message (anyMessage=true). The reply is an approved template (replyTemplateName) or free text (replyText — only delivers inside the 24h service window). ── OPTIONAL ENHANCEMENTS (regular/free-text replies only — full parity with the visual Bot Builder): • contextCheck: verify the incoming reply is on-topic before advancing ('בדיקת הקשר') — pass contextPrompt to define what counts as in-context (auto-defaulted if omitted). • aiCompose: instead of a fixed replyText, let Gambot AI phrase the reply in real time from a short instruction (aiComposePrompt); sent as 'Gambot AI'. • outsideHoursMessage: send a DIFFERENT reply text outside the org's business hours. • reminders: follow-up reminders on the primary flow if the contact doesn't respond. ── BEFORE CREATING: look at the existing bots (this tool also returns `existingBotsBefore`); if a matching bot exists, update/enable it instead (gambot_update_bot / gambot_set_bot_status). Duplicates (same name, or same active trigger) are rejected with DUPLICATE_BOT.
Create ONE standalone bot that reacts when a contact taps a quick-reply BUTTON on a template you sent (e.g. after a campaign). For each button give the reply (template or text) — perfect for 'when they click X, send Y'. The button title must match the template's button exactly. âš ï¸ NOT for building menus / multi-level conversations: do NOT call this once per menu level or chain it to emulate sub-menus (that creates disconnected fragments). A multi-level menu is ONE bot — use gambot_create_bot with nested switchCase steps (see the server instructions: 'ONE CONVERSATION = ONE BOT'). ── BEFORE CREATING: look at the existing bots (this tool also returns `existingBotsBefore`); if a matching bot exists, update/enable it instead (gambot_update_bot / gambot_set_bot_status). Duplicates (same name, or same active trigger) are rejected with DUPLICATE_BOT.
Create a SINGLE-LEVEL menu bot: an opening template with quick-reply buttons that route each tap to ONE reply (no sub-menus — for 2+ levels use gambot_create_bot with a nested steps[] tree instead). Provide openingTemplateName and options (each button + its reply template/text). Start the menu for a contact by sending the opening template (e.g. via a campaign). Each option's free-text reply can be enhanced (Bot Builder parity): aiCompose + aiComposePrompt (Gambot AI phrases it live) and outsideHoursMessage (different text outside business hours). Add reminders[] to send follow-ups on the primary/main flow if the contact goes quiet ('תזכורות בפלו×ו הר×שי'). ── BEFORE CREATING: look at the existing bots (this tool also returns `existingBotsBefore`); if a matching bot exists, update/enable it instead (gambot_update_bot / gambot_set_bot_status). Duplicates (same name, or same active trigger) are rejected with DUPLICATE_BOT.
Deploy a WHOLE bot in one call — the way the Bot Builder does it — instead of wiring pieces separately. It creates, in order: (1) the MAIN bot, (2) its ACTIVATOR (מפעיל — the trigger that starts it), and (3) the HUMAN-INTERVENTION CANCEL (ביטול בוט בהתערבות ×× ×•×©×™×ª — stops the bot the instant a human agent replies), all linked by one sourceFlowId so they turn on/off together. botType 'menu' = an opening template with quick-reply buttons routed to replies (needs openingTemplateName + options; the activator SENDS that opening template to start the bot). botType 'keyword' = reply to a keyword/any message (self-activating — its own keyword IS the activator, so no separate activator is made). Choose how the menu bot STARTS with activator.type: 'keyword'/'any_message' (a contact texts in), 'inactivity' (no message in noContactDays days), or 'campaign_lead' (a lead arrived from an ad/campaign). AI / combined bots (Gambot AI) are built in the Bot Builder app because they need a Gambot AI configuration. After deploy, toggle the whole thing with gambot_set_bot_status(includePackage=true) or inspect with gambot_get_bot_package. ── BEFORE CREATING: look at the existing bots (this tool also returns `existingBotsBefore`); if a matching bot exists, update/enable it instead (gambot_update_bot / gambot_set_bot_status). Duplicates (same name, or same active trigger) are rejected with DUPLICATE_BOT.
Turn a bot on (active) or off (inactive). By default this toggles ONE botomation. Set includePackage=true to toggle the WHOLE bot — every botomation sharing its sourceFlowId (the main bot + its activator/trigger + the human-intervention cancel + the Gambot AI answerer) — which is what a user usually means by 'turn the bot on/off'. Use gambot_get_bot_package first if you're unsure what will be affected.
Update an EXISTING bot/botomation instead of creating a duplicate. Workflow: gambot_get_bot → change what is needed → send the WHOLE bot back here (name, status, isBot, steps[], primaryFlowSettings, …) — the object is replaced, so include every step you want to keep. To only turn it on/off use gambot_set_bot_status.
Delete a bot/automation by id.
Advanced: create a bot from a full botomation object when the high-level builders aren't enough. USE THIS for ANY multi-level conversation (menu → sub-menu → answers): put the WHOLE tree in ONE call with isBot=true, nesting each level inside switchCase cases[].actions as [SendMessage(template) → IncomingMessage(template + buttons) → switchCase on {{Step_<path>_ButtonText}}]. Never split a conversation into one botomation per step/button. A full worked example is in the server instructions ('ONE CONVERSATION = ONE BOT'). steps[]: step 1 is the trigger (action 'IncomingMessage', …), the rest are actions ('SendMessage','switchCase','Condition','GambotAi','Delay','GambotAction',…). Use {{Step_1_PhoneNumber}} / {{Step_1_Message}} placeholders. ── STEP CONFIG FEATURES you can set (parity with the visual Bot Builder): • On a REGULAR IncomingMessage trigger config → aiContextGate:{enabled:true,prompt,model:'gpt-4o-mini',onExhausted:'advance'} for an on-topic CONTEXT check ('בדיקת הקשר'). • On a REGULAR SendMessage config → aiCompose:{enabled:true,prompt,assignToGambotAiAfter:true} to have Gambot AI phrase it live, and businessHoursAlternative:{enabled:true,outsideHoursMessage:'...'} for a different text outside business hours. • On the botomation itself → primaryFlowSettings:{reminderEnabled:true,reminders:[{afterMinutes,message,action}]} for follow-up reminders. Prefer gambot_create_keyword_autoreply / _template_button_autoreply / _menu_bot / _deploy_bot_package for common cases — they expose contextCheck, aiCompose, outsideHoursMessage and reminders as simple params. ── BEFORE CREATING: look at the existing bots (this tool also returns `existingBotsBefore`); if a matching bot exists, update/enable it instead (gambot_update_bot / gambot_set_bot_status). Duplicates (same name, or same active trigger) are rejected with DUPLICATE_BOT.
List the organization's Gambot AI 'brains' (how the AI answers: purpose, tone, language, Q&A count). Most orgs already have one auto-built from their website at signup — find it here before creating a new one. Pair a brain with its botomation via gambot_list_bots (role 'gambot_ai').
Get one Gambot AI brain with its full configuration (purpose, tone, instructions, language, Q&A).
Update/upgrade an existing Gambot AI brain. PATCH semantics — only the fields you pass change; everything else (including learned Q&A, style examples and the knowledge-base file) is kept. Use this to refine the auto-built AI: sharpen its purpose/instructions, set the tone or language, add Q&A, or toggle escalate-to-human.
Create a NEW Gambot AI brain. Only do this if the org has none (check gambot_list_ai first — most orgs already have one auto-built from their website). After creating, wire it to a botomation whose trigger is contactOwner == 'Gambot AI' (built in the Bot Builder app) and route contacts by assigning owner = 'Gambot AI'.
Check whether an organization already exists for a company + tax id (ח.פ/ת.ז), and whether an incomplete onboarding can be resumed. Use before creating a new trial.
Generate a unique organization name from a company name + tax id (adds a suffix if taken).
List phone numbers available to purchase for a country (via Twilio), so you can pick one to buy as the account's SIM/number. Pass the chosen phoneNumber to gambot_create_paid_account (or gambot_create_paid_account_self_serve with no API key) as simInfo.selectedSimNumber with simInfo.purchaseInTwilio=true. A bought number is prepaid - never a trial.
Create a new FREE-TRIAL organization + first user (no card required). Login credentials (temp password) are emailed & WhatsApp'd to the contact. WhatsApp/number options: (Gambot does NOT provide any free / test / sandbox numbers - never offer or suggest one) · useCoexisting (existing WhatsApp Business number in simInfo.simNumberEntered) · BYO SIM (the customer's own number in simInfo.simNumberEntered) · Buying a SIM/number from us is NOT available on a trial (it is prepaid with no trial) - use gambot_create_paid_account for that. GLOBAL: send companyInfo.timezone (IANA) and companyInfo.country (ISO-3166 alpha-2) — they drive scheduling and locale. Neither hard-fails: a missing/invalid timezone is derived from country (else defaults to Asia/Jerusalem). For a paid account with a card on file (no trial) use gambot_create_paid_account instead. After creating, connect WhatsApp via the returned wabaConnectUrl or gambot_exchange_waba_token.
Create a new organization that goes STRAIGHT TO PAID — no free trial month. A payment method is MANDATORY: pass a `card` object; the card is verified first, then (if buying a number: simInfo.purchaseInTwilio=true + simInfo.selectedSimNumber) the number is bought and the FIRST period (plan + SIM) is charged immediately - prepaid, no trial for the subscription or the SIM. If the charge fails nothing is created and the number is released. The card token is then saved for renewals. Use this when an AI agent has the customer's card and should provision a paying account in one call. Same number options and the same graceful companyInfo.timezone/country handling as gambot_create_trial_account (neither hard-fails). The raw card is sent only to the PCI-compliant clearing provider and never stored.
Verify a card with the clearing provider (Tranzila) and save its token to an organization, so an AI agent with the customer's card can put a payment method on file without the hosted page. The raw card is sent only to the PCI-compliant clearing provider and never stored. For a hosted alternative (customer types the card), use gambot_create_payment_link.
ONBOARDING ONLY — build a hosted link where a NEW Gambot customer saves a card on file for their Gambot subscription. Card data is never handled by the API — share the URL; the card token is saved on success. NOT for charging an organization's own customers — for that use gambot_create_clearing_payment_link.
Check whether THIS organization has a credit-card clearing provider (סליקה) configured in Settings → Clearing: activeProvider, enabledProviders, testMode and the auto-invoice settings. `canCreatePaymentLinks` tells you if gambot_create_clearing_payment_link will work; when false the `reason` says what a human must configure in the app. Call this BEFORE offering a payment link.
Create a payment link (קישור לתשלו×) to charge one of the organization's OWN customers by credit card, through the organization's configured clearing provider (סליקה). Requires clearing to be set up (see gambot_get_clearing_status) — otherwise error `clearing_not_configured` and a human must configure it in Settings → Clearing. Give either amount (+ description), items[], or invoiceId / quoteId (amount defaults to the invoice's open balance / quote total and customer details are copied; the link is attached to that document). payments = max installments. Returns { transactionId, shareUrl } — send shareUrl to the customer (e.g. with gambot_send_text). The transaction appears in the app's Transactions screen (track with gambot_get_transaction); when the org enabled auto-invoice, the accounting document is issued automatically after payment. Different from gambot_create_payment_link (that one is the Gambot-subscription onboarding link).
Get the hosted page URL where the customer completes Meta Embedded Signup (the Facebook popup) to connect their WhatsApp Business account. REQUIRES AN EXISTING ACCOUNT: call gambot_create_trial_account FIRST (no key/form needed) and pass the exact organizationName it returned — never invent one (a non-existent organization is refused with ORGANIZATION_NOT_FOUND). The create call already returns wabaConnectUrl, so you normally don't need this tool right after creating.
Complete Meta Embedded Signup by exchanging the authorization code returned by the Facebook popup. Registers the WABA, subscribes webhooks and registers the phone number.
Send a 6-digit verification code to the customer's email AND WhatsApp. Public (no token). Required ONLY before creating a self-serve account that BUYS a phone number (proves the customer owns the email/phone, so we don't buy numbers for fake accounts). Returns { verificationId } — collect the code from the customer, then call gambot_verify_onboarding_code. Co-existence / bring-your-own do NOT need this (only buying a number does).
Verify the 6-digit code the customer received (from gambot_send_onboarding_verification). Public (no token). On success returns { verified:true }; pass the same verificationId to gambot_create_paid_account_self_serve to create a prepaid account that buys a phone number.
Check where an organization is in onboarding: whether the account exists, a card is on file, and WhatsApp (WABA) is connected. Use this to POLL after create-trial (Meta Embedded Signup finishes in the browser, not in the agent). Returns { accountCreated, cardOnFile, wabaConnected, status (not_found|account_created|connected), wabaConnectUrl, paymentUrl, nextStep }. Public — works without a token.
One-shot KPI snapshot for a period: WhatsApp message volume (incoming/outgoing + per-agent breakdown), new contacts (incl. from CTWA ads), leads (created/won/open), support tickets (×¤× ×™×•×ª: created/closed/open), tasks (created/completed/open/overdue) and bots (runs/completed/active/failed/completionRate). USE THIS to answer 'how are we doing today / this month', 'how many messages did we send', 'how many new leads', etc. Set userId to scope to a single team member; omit it to get the whole org (the per-agent breakdown still shows each user).
WhatsApp message volume for a period: total, incoming, outgoing, how many were sent by bots vs humans, and a per-agent breakdown (byAgent) — how many messages each user sent. Use for 'how many messages went out today', 'inbound vs outbound this month', 'who sent the most messages'.
Read the ACTUAL message CONTENT across ALL conversations for a time window (default: today) as a flat, time-ordered feed. Each message has: time, phone, contactName, direction (incoming=from the customer / outgoing=from the team or bot), sender (customer name, agent name, 'Gambot AI', 'Gambot MCP', …), senderId, type, messageType and text. THIS is the tool for QUALITATIVE questions about conversations — e.g. 'how did my employees reply today?', 'which customers seem upset / frustrated?', 'summarize today's chats', 'did anyone ask about prices / cancel?', 'how did agent X handle their chats?'. After calling it, analyze the returned messages yourself to answer. For pure COUNTS use gambot_analytics_messages instead (cheaper). Filter by direction, by userId (one agent's replies), or by phone (a single conversation). Returns up to `limit` most-recent messages (truncated=true means older ones were dropped — narrow the window or raise limit).
Lifetime WhatsApp totals (total / sent / received / delivered / read / failed) plus a last-6-months trend. Cheap (served from a cached view). Use for all-time totals or a monthly trend chart; for a specific period use gambot_analytics_messages.
A day-by-day time series of inbound / outbound / AI messages across a range (default: last 30 days). Ideal for charts and trends.
New contacts in the period, how many came from CTWA (Click-to-WhatsApp ads), and a breakdown by creation method (manual / incoming_message / api / ...).
Sales pipeline snapshot: open / won / lost this month, total pipeline value, and breakdowns by stage, source and user (salesByUser).
Support tickets / ×¤× ×™×•×ª for the period: created, closed, resolved, still-open, SLA compliance and a breakdown by stage. ('cases' is Gambot's internal name for ×¤× ×™×•×ª / inquiries / tickets.)
Task KPIs: totals, open / in-progress / completed / overdue, and breakdowns by priority, category and assignee. Set userId to scope to one assignee.
Click-to-WhatsApp ad performance: the unique ads that drove conversations (id + headline), and how many new contacts in the period came from CTWA ads.
WhatsApp bot / automation performance for a period: totalRuns, completedRuns, activeRuns, failedRuns, completionRate (%), uniqueContacts engaged, and a per-bot breakdown (byBot: botId, name, status, runs, completed, active, failed, uniqueContacts) sorted by run volume. Also reports botsConfigured (total/active/bots). Use for 'how are my bots doing', 'which bot ran the most', 'bot completion rate this month'. Use gambot_list_bots for the bot catalog and gambot_get_bot for one bot's full definition.
Register (or update) a WEBHOOK so Gambot POSTs every matching WhatsApp event to your server as it happens. Each delivery is a JSON 'envelope': { type, event, types[], organization, receivedAt, meta_obj } where meta_obj is Meta's raw payload, plus request headers X-Gambot-Organization and X-Gambot-Event. Provide the destination `url` (https recommended); optionally an `authHeader` we send verbatim as the Authorization header on every call, and `events` toggles to choose which event types to receive (all on by default). This is the programmatic equivalent of Settings → Event Forwarding, so it also shows up in the console. After registering, verify it with gambot_test_webhook. To stop delivery use gambot_delete_webhook.
Return the organization's current event-forwarding webhook: whether it's enabled, the destination url, whether an auth header is set, and which event types are forwarded.
Disable event forwarding (stop POSTing events to the registered URL). The URL/settings are kept on file, so re-enabling later is a single gambot_register_webhook call.
Fire a synthetic sample 'incoming_message' envelope (flagged test:true) at the registered webhook URL — or at an override `url` passed here — and return the delivery result: { delivered, statusCode, durationMs, responsePreview }. Use this to confirm your endpoint actually receives Gambot's calls. The attempt is recorded in the delivery log.
List the organization's connected integrations (the same as Settings → Connections): email & calendar OAuth accounts (Google/Microsoft), Facebook/Meta lead-ads pages, shop/CRM links, plus the org's WhatsApp numbers. Only non-secret metadata is returned (ids, providers, status, account email). Use a connection's id as the connectionId elsewhere (e.g. gambot_list_facebook_lead_forms, gambot_create_facebook_lead_bot) and its provider ('google'/'microsoft') to pick a mailbox/calendar.
Send a single email over a connected Google/Microsoft mailbox (Settings → Connections). Provide to, subject and body. Set isHtml=false for plain text. Optionally cc/bcc and a provider ('google'/'microsoft' or a connection id; blank ⇒ first available).
List the organization's saved email templates (compact: id, name, subject, isHtml, category, variables, attachment count). Use a template's id as templateId in gambot_create_email_campaign / gambot_send_test_email.
Get one email template in full: subject, body, isHtml, variables (the {{names}} used), variableDefaults (default source per variable), attachments, mediaUrls, tags, category.
Create a reusable email template. The body may be PLAIN TEXT (line breaks preserved, links auto-detected, images as markdown ) or HTML (isHtml is inferred from the presence of tags). Variables are written as {{name}} in subject/body (Hebrew names are fine, e.g. {{שם החברה}}); {{name}} and {{email}} are always filled from the recipient. variableDefaults is the template's AUTOMATIC MAPPING (same model as the WhatsApp auto-mapping): per variable a fixed text, a contact field, or a field of ANY CRM table via { entity, field } — entity: contact | lead (latest lead) | case | quote | order | user (sending user) | org (business). Table mappings fill the variable when the template is picked for ONE recipient in the app (chat / contact / lead / case); campaigns only inherit fixed values and contact fields (they map per recipient / Excel column), botomations map inside the flow. FILES: to attach a file to the template (sent with EVERY email), host it first with gambot_upload_email_media (kind='attachment') and pass the returned `attachment` in attachments. To put an image INSIDE the body, host it with kind='image' and paste the returned markdown (plain-text body) or url (<img src> in HTML). Templates created here have no drag-and-drop design — only subject + body.
Update an email template — send only the fields that change (name, subject, body, isHtml, category, tags, variableDefaults, attachments, mediaUrls). attachments REPLACES the whole attachment list (send [] to remove all). Existing campaigns keep their own saved variable mapping.
Delete an email template. Campaigns already created from it are not affected only if they were saved inline — confirm with the user first.
Host a file so it can be used in an email (max 10MB, any file type). Provide a public `url` (Gambot downloads and re-hosts it) OR `contentBase64`. kind='attachment' (default) → returns `attachment` { name, contentType, url } to pass in a template's / inline campaign's `attachments` (PDF, DOCX, XLSX…). kind='image' → returns `url` and `markdown` (): paste the markdown into a plain-text body, or use the url in an <img src> of an HTML body.
Send ONE test email exactly as recipients will receive it (same footer, tracking and the template's attachments), with the subject prefixed '[בדיקה]'. Use templateId, or inline subject+body. variables = fixed values for {{variables}} ({ "שם החברה": "Acme" }); sampleName fills {{name}}. Variables left unfilled appear as [name] so you can spot them. Always test before sending a campaign to a large list.
List all email marketing campaigns for the organization (status, schedule, recipient counts — no heavy fields).
Get a single email campaign by id (content source, variable mapping, audience, Excel recipients, schedule, status).
Results of an email campaign: stats { total, sent, opened, clicked, failed, bounced } (opened includes clicked; clicked = recipients who clicked a link) and one row per recipient { email, name, status (sent|opened|clicked|failed|bounced), sentAt, openedAt, openCount, clicked, clickCount, clickedUrls[], lastClickedAt, replied, errorMessage }. Also clicksByLink [{ url, recipients }] = how many different recipients clicked each link/button. Every link in a campaign mail is tracked automatically. Mail-scanner/bot clicks are excluded; 'opened' is pixel-based (Apple Mail / blocked images distort it) so prefer clicks as the stronger engagement signal. To find who did NOT open / did NOT click, filter the recipient rows (opened/status/clicked). Only mails sent after the tracking release carry click data.
Read-only: how many people a CRM segment resolves to BEFORE creating an email campaign. Pass contactFilters (same shape as gambot_create_email_campaign) or the campaignId of a saved campaign. Returns { matchedContacts, withEmail, withoutEmail, unsubscribed, willReceive (= emails that would actually be sent), sample (≤10 { name, email, phoneNumber }), filters (the normalised filters), warnings }. An invalid filter is rejected with the exact problem. Nothing is created or sent.
Create an email marketing campaign — the same engine as the app (scheduling, durable resumable send, no duplicates). CONTENT: a saved templateId, OR inline subject+body (plain text or HTML; markdown images allowed) with optional attachments (from gambot_upload_email_media; for template campaigns the files live on the template). VARIABLES: {{names}} in the content are resolved per recipient — fixed value (templateVariables: { name: 'value' } or { name: { contactField } }) → CRM contact field → the Excel row's variables → same-name match; template variableDefaults are applied automatically. AUDIENCE (choose one): contactFilters for a CRM segment — { logic:'AND'|'OR', filters:[ { filterType:'group', operator:'equals', groupValue:['<tag name from gambot_list_tags>'] }, { filterType:'contactField', fieldName:'<field key from gambot_get_contact_fields>', operator:'equals', value:'<text>' } ] } (a Boolean/checkbox field takes value 'true' or 'false' — 'false' also matches contacts on which it was never set; operators: equals, notEquals, contains, notContains, startsWith, endsWith, isEmpty, isNotEmpty, greaterThan, lessThan, before, after…). An invalid filter is rejected with the reason, and the response's recipientCount is the number of people who will actually receive it (call gambot_get_email_audience_preview first to check the segment). OR excelRecipients ([{ email, name, variables:{ <variableName>: value } }]) for a list — an Excel-based campaign is saved in the exact shape the web app uses, so the spreadsheet (email / name / variable columns and mapping) is visible and editable in the campaign screen. Convert the user's Excel/CSV rows into excelRecipients yourself. SCHEDULE: runAt (ISO) + timezone, optional scheduleType 'once'|'repeated' with interval/intervalNumber/endCondition. run=true creates AND sends immediately. Sending to many people is a bulk action — confirm audience + content with the user first and send a test (gambot_send_test_email). Returns { campaignId, status, recipientCount, warnings }.
Update a Draft/Scheduled email campaign — send only the fields that change (same fields as gambot_create_email_campaign; excelRecipients replaces the list). Re-registers the schedule when runAt/timezone change. Running/Completed campaigns cannot be edited.
Delete an email campaign and cancel its schedule. Already-sent emails are not recalled — confirm with the user first.
Run (send) a saved email campaign now. Uses the durable, resumable engine — safe for large audiences, no duplicates. Failures (no mailbox connected, empty audience…) are returned as errors. Confirm with the user before sending to a large audience.
List calendar events in a date range from a connected Google/Microsoft calendar (Settings → Connections). Pass provider ('google'/'microsoft' or a connection id; blank ⇒ first connected calendar) and an optional startDate/endDate (ISO-8601; default = current month).
List the organization's connected Facebook/Meta Lead Ads pages. Each item's connectionId is what you pass to gambot_list_facebook_lead_forms and gambot_create_facebook_lead_bot.
List the leadgen forms of a connected Facebook page. Pass a connectionId (from gambot_list_facebook_lead_connections; blank ⇒ the org's first Facebook Lead Ads connection). Returns [{ id, name, status }].
Create a bot that auto-replies the moment a new lead arrives from a Facebook/Meta lead form. Provide a connectionId (from gambot_list_facebook_lead_connections) and a reply (replyTemplateName or replyText). Optionally restrict to specific formIds (from gambot_list_facebook_lead_forms; blank ⇒ any form on the page). The reply is sent to the lead's WhatsApp; lead fields are available as placeholders like {{Step_1_facebook_lead_data_full_name}}. ── BEFORE CREATING: look at the existing bots (this tool also returns `existingBotsBefore`); if a matching bot exists, update/enable it instead (gambot_update_bot / gambot_set_bot_status). Duplicates (same name, or same active trigger) are rejected with DUPLICATE_BOT.
MCP server for the Gambot WhatsApp Business API - send WhatsApp messages & templates, manage CRM, leads & campaigns from Claude, Cursor & any AI agent.
The README includes setup instructions such as "command": "npx",.
The source code is linked from the repository URL on this page.
If the README contains a parseable MCP configuration block, it is shown in the Config tab.
NetFoundry LLM Gateway is an OpenAI-compatible API proxy that routes requests across multiple LLM providers using zero-trust networking. Zero trust LLM gateway. OpenAI-compatible proxy with semantic routing and load bala

Free SEO Audit MCP server for Claude - captures and stores all the raw data you need for a complete technical SEO audit. Google Search Console + a first-party crawl + DataForSEO + Majestic SEO merged into one prioritised
Console, Backend and CLI to manage Capgo Instant update and Native build for Capacitor apps Build and upload to app store your mobile app
Local tools that let your AI use Mail, Calendar, Contacts, Teams, Slack, WhatsApp, OneDrive, Google Drive, Notion, Outlook and Office files on Mac and Windows. Runs on your computer.

Hosted Google Search / SERP MCP server from HasData, no Google Cloud project. Organic results, AI Overview, People Also Ask, AI Mode, news and shopping for Claude, Cursor and any MCP client.
Comments