Skip to main content
Glama

Send batch

send_batch
Destructive

Send one message to many people (a broadcast or campaign): pick recipients by segment_id, tags, contact_ids, or an explicit recipients list. Opted-out numbers, numbers without marketing consent, and people unsubscribed from topic_id are removed before sending. dry_run: true sends nothing and returns the count, cost, rejected rows and consent. scheduled_at sends at one instant; send_at_local (like 2026-11-10T17:00) sends at that time on each person's own clock.no_opt_in (recipients the send will skip for having no opt-in). Leave out from and TextKit picks a number approved for category (marketing unless you say otherwise), one per recipient; sender shows them, and with none approved it answers 400 and sends nothing. scheduled_at sends later (up to 30 days). shorten_links: true tracks link clicks: suggest it whenever the text has a link. Each recipient can carry external_id (their Mixpanel distinct_id) so the text's events land on their Mixpanel profile. With a live key it texts real people.

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": {
      "body": "<body>"
    },
    "name": "send_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYesThe message text. Merge tags fill per recipient
fromNoOne of your numbers, to pin the batch to it. Leave it out and TextKit picks a number approved for `category` (marketing unless you say otherwise), the same one per recipient. Nothing approved is a 400.
nameNoA name for the broadcast
tagsNoSend to contacts carrying any of these tags (instead of recipients).
dry_runNoValidate only: returns a BatchValidation and sends nothing.
list_idNoSend to the contacts in this list, as it is when the batch is created (instead of recipients).
categoryNoOptional. It can make the batch stricter (`marketing`), never looser: the sending number's registration and the wording decide ([which messages are marketing](/docs/compliance-checks#which-messages-are-marketing)). From a number with no registration, a batch is marketing.
topic_idNoSubscription topic. Recipients unsubscribed from it are removed at validation (`topic_unsubscribed`) and skipped at send time, like opt-outs. Omit to apply opt-outs only.
recipientsNoExplicit recipients, up to 10,000
segment_idNoSend to the contacts in this saved segment, evaluated when the batch is created (instead of recipients).
contact_idsNoSend to these contacts, by id
quiet_hoursNoOptional. What to do with a message in the recipient's quiet hours: `block` refuses it (403 quiet_hours), `defer` holds it until their next 9:00am. Omitted: each recipient in quiet hours is held until their 9:00am.
scheduled_atNoFuture ISO timestamp or epoch ms, up to 30 days out.
send_at_localNoInstead of `scheduled_at`: a date and time with no time zone, up to 30 days out, sent at that time in each recipient's own zone, read from the area code. Refused if it has passed for any recipient. Quiet hours still hold a time outside the window.
shorten_linksNoOptional. Rewrite every http(s) link to a tracked short link, per recipient, when each message is sent. Clicks show in GET /batches/{id}/results.
check_line_typesNoReject landlines (first 500 unique numbers are checked).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / recipients / items / properties / external_id
      Added value: +{
      +  "description": "Optional. The person's id in your analytics tool (their Mixpanel distinct_id; `mixpanel_distinct_id` is accepted too). With a Mixpanel integration connected, each event about this text lands on that profile in Mixpanel. Without it, the contact with this number that Mixpanel supplied is used.",
      +  "maxLength": 255,
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / send_at_local
      Added value: +{
      +  "description": "Instead of `scheduled_at`: a date and time with no time zone, up to 30 days out, sent at that time in each recipient's own zone, read from the area code. Refused if it has passed for any recipient. Quiet hours still hold a time outside the window.",
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • changedInput schema / properties / quiet_hours / description
      Previous value: -"Optional. What to do with a message in the recipient's quiet hours: `block` refuses it (403 quiet_hours), `defer` holds it until their next 8:00am. Omitted: each recipient in quiet hours is held until their 8:00am."New value: +"Optional. What to do with a message in the recipient's quiet hours: `block` refuses it (403 quiet_hours), `defer` holds it until their next 9:00am. Omitted: each recipient in quiet hours is held until their 9:00am."
  4. Changed1 schema field changed
    • changedInput schema / properties / from / description
      Previous value: -"One of your numbers. Optional while the key's mode has one number."New value: +"One of your numbers, to pin the batch to it. Leave it out and TextKit picks a number approved for `category` (marketing unless you say otherwise), the same one per recipient. Nothing approved is a 400."
  5. Changed6 schema fields changed
    • addedInput schema / properties / body / description
      Added value: +"The message text. Merge tags fill per recipient"
    • addedInput schema / properties / contact_ids / description
      Added value: +"Send to these contacts, by id"
    • addedInput schema / properties / name / description
      Added value: +"A name for the broadcast"
    • addedInput schema / properties / recipients / description
      Added value: +"Explicit recipients, up to 10,000"
    • addedInput schema / properties / recipients / items / properties / to / description
      Added value: +"Recipient's number in E.164"
    • addedInput schema / properties / recipients / items / properties / variables / description
      Added value: +"Merge values for this recipient, by name"
  6. Changed1 schema field changed
    • addedInput schema / properties / shorten_links
      Added value: +{
      +  "description": "Optional. Rewrite every http(s) link to a tracked short link, per recipient, when each message is sent. Clicks show in GET /batches/{id}/results.",
      +  "type": "boolean"
      +}
  7. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Goes well past the annotations (destructive/non-idempotent/openWorld already flag the risk) by disclosing what actually happens: opt-outs, missing marketing consent and topic unsubscribes are stripped before sending; missing sender approval yields a 400 and nothing is sent; scheduling caps at 30 days; a live key texts real people. It also states what dry_run returns (count, cost, rejected rows, consent), which annotations cannot convey.

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

Conciseness3/5

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

Front-loaded and information-dense, but it is a run-on paragraph with duplicated content: scheduled_at is explained twice ('sends at one instant' then 'sends later (up to 30 days)') and `from` is covered in both the description and again with nearly identical wording. The dangling fragment 'no_opt_in (recipients the send will skip for having no opt-in)' has no antecedent and reads as an editing artifact.

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 16-parameter mutation tool with no output schema, the description covers the risky and non-obvious paths: consent filtering, quiet hours, per-recipient local scheduling, sender selection failure, and what dry_run returns. It is thinner on the normal live-send response (a batch object id polled via get_batch/cancel_batch), which an agent must know to follow up.

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, but the prose adds real meaning beyond the schema: category can only tighten and never loosen compliance, external_id routes events to a Mixpanel distinct_id, and shorten_links rewrites per recipient at send time with clicks in GET /batches/{id}/results. Some passages merely restate schema text (notably `from` and scheduled_at limits).

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?

Opening clause pins a specific verb and resource: 'Send one message to many people (a broadcast or campaign)'. The 'one message to many people' framing implicitly separates it from the single-recipient send_message and from planning tools like plan_campaign; an agent can tell what this does without opening the schema.

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?

Gives concrete routing guidance among the recipient selectors (segment_id, tags, contact_ids, explicit recipients list) and conditions for dry_run, shorten_links, quiet_hours, and scheduled_at vs send_at_local. It never names or excludes the sibling tools an agent might pick instead (send_message, create_schedule, plan_campaign, recommend_message), so the when-not half is missing.

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.