Skip to main content
Glama

create_batch_mail

Create a batch draft from a template link and a recipient list; nothing is charged. template_url is a public https:// link to a PDF at the mail type's size, or to a PNG/JPG postcard graphic that is set on a page at that size (design 4×6 in at 300 dpi = 1200×1800 px). Recipients go inline (an array of {name, line1, line2, city, state, zip}; company accepted) or as recipients_url, a CSV link. Malformed rows and duplicates are skipped and listed, never charged. A one-page postcard gets an address side printed with the return address. Field kits, all optional: every other recipient key (or a nested fields object) is a field, printed by {{tag}} in message or qr.url (fallback: {{tag|text}}) and into PDF form fields of the same name; qr puts a code unique to each piece on it (link opens qr.url, confirm opens a one-button mailbox.bot page, verify proves the recipient gets mail at the address: a QR code plus a short code the person enters where they are signed in, your app via POST /v1/batch-mail/verify with their ref, or read back to the owner for the dashboard; set qr.url to that page and a scan opens it with the code filled in), with scans and confirmations per piece on get_batch_mail and as batch.piece.scanned / batch.piece.confirmed webhooks (a "ref" key on each recipient comes back with them); stock weatherproof, one printed insert (insert_url + insert_stock) and mail_on (a date to mail on) as well. The result carries the exact price, the first recipients and any image warnings; then call get_batch_mail_proof and give the person its proof_url, which opens in any browser for an hour, to see the template and a sample address label before confirm_batch_mail charges credits. Requires mailbox_md_version from get_mailbox_md. A key that requires approval saves the draft for the account owner to pay in the dashboard. Postcards from 1 recipient (a $2.00 small-batch fee under 10); letters, flyers and pamphlets from 10; up to 10,000.

Input Schema

NameRequiredDescriptionDefault
qrNoOptional: a QR code unique to each piece, https://mailbox.bot/q/<code>. Postcards: on the address side, bottom left. Letters and inserts: bottom right of page 1 (keep about 3 × 1 in clear). Scans store counts and times only.
colorNoColor printing for letters, flyers and pamphlets, charged per color page (postcards are always full color). Default false.
stockNostandard (default) or weatherproof: tear- and water-resistant synthetic sheets for notices and small signs posted outdoors, letters and flyers only, +85¢ per sheet.
duplexNoPrint both sides of each sheet. Default false.
mail_onNoOptional date to mail on, YYYY-MM-DD (Pacific time), today to 60 days ahead. The facility mails on or after it.
messageNoOptional text with {{tags}}. On a letter it is the letter itself (Times 12 pt, 1 in margins; send no template_url). On a postcard it prints on the address side mailbox.bot adds, so the template must be the front only; it must fit once each recipient's fields are filled in.
job_nameYesA name the owner will recognise in the dashboard and in emails, e.g. "Spring open house postcards".
mail_typeYespostcard_4x6, postcard_6x9, letter (1–3 pages, 6 with duplex), flyer (1 page), pamphlet_light (4–8 pages), pamphlet_heavy (9–16 pages).
column_mapNoFor recipients_url only, when the CSV headers are not recognised: field (name, line1, line2, city, state, zip) → the header text in the file.
insert_urlNoOptional public https:// link to one insert sheet (PDF, PNG or JPG, US Letter, 1 or 2 pages) packed with every letter, flyer or pamphlet. Its PDF form fields named like your keys are filled per recipient.
recipientsNoInline recipients, up to 10,000 (postcards from 1, other types from 10). Skipped rows are reported by position (1 = first). Send this or recipients_url, not both.
return_zipNoReturn ZIP code.
return_cityNoReturn city.
return_nameNoReturn name. Defaults to the account's saved return address.
insert_stockNoThe insert's stock: paper (+30¢), weatherproof (+95¢) or label_sheet, one full 8.5 × 11 in weatherproof sticker printed on one side (+$1.45). Per piece; letters, flyers and pamphlets only.
return_line1NoReturn street address. Defaults to the account's saved return address.
return_line2NoReturn suite or unit.
return_stateNoReturn state, 2 letters.
template_urlNoPublic https:// link to the template (PDF, PNG or JPG, ≤10 MB). Signed cloud-storage links, CDN and GitHub raw URLs work; links that need a login, private hosts and IP addresses are refused. Required, except for a letter sent as message.
mailing_classNofirst_class (USPS First-Class Mail, 1–5 days, forwarded and returned; the default) or marketing_mail (USPS Marketing Mail, 3–10 days, 200+ recipients; not open until the facility's USPS permit is active). The class is USPS postage, not a description of the content: bills, statements and personal correspondence must go first_class.
recipients_urlNoPublic https:// link to a recipients CSV (columns name, address, address2, city, state, zip; ≤5 MB). Send this or recipients, not both.
return_companyNoReturn company line.
mailbox_md_versionYesYour current MAILBOX.md version from get_mailbox_md. Required for agent keys.

Output Schema

NameRequiredDescriptionDefault
resultYesThe draft: batch (status draft, pricing, recipients summary, links.proof), recipients_preview, template (how it was taken), warnings and next_step.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • addedInput schema / properties / insert_stock
      Added value: +{
      +  "description": "The insert's stock: paper (+30¢), weatherproof (+95¢) or label_sheet, one full 8.5 × 11 in weatherproof sticker printed on one side (+$1.45). Per piece; letters, flyers and pamphlets only.",
      +  "enum": [
      +    "paper",
      +    "weatherproof",
      +    "label_sheet"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / insert_url
      Added value: +{
      +  "description": "Optional public https:// link to one insert sheet (PDF, PNG or JPG, US Letter, 1 or 2 pages) packed with every letter, flyer or pamphlet. Its PDF form fields named like your keys are filled per recipient.",
      +  "format": "uri",
      +  "type": "string"
      +}
    • addedInput schema / properties / mail_on
      Added value: +{
      +  "description": "Optional date to mail on, YYYY-MM-DD (Pacific time), today to 60 days ahead. The facility mails on or after it.",
      +  "type": "string"
      +}
    • addedInput schema / properties / message
      Added value: +{
      +  "description": "Optional text with {{tags}}. On a letter it is the letter itself (Times 12 pt, 1 in margins; send no template_url). On a postcard it prints on the address side mailbox.bot adds, so the template must be the front only; it must fit once each recipient's fields are filled in.",
      +  "maxLength": 15000,
      +  "type": "string"
      +}
    • addedInput schema / properties / qr
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Optional: a QR code unique to each piece, https://mailbox.bot/q/<code>. Postcards: on the address side, bottom left. Letters and inserts: bottom right of page 1 (keep about 3 × 1 in clear). Scans store counts and times only.",
      +  "properties": {
      +    "expires_days": {
      +      "description": "confirm and verify: days the code works, from the mail date. Default 30.",
      +      "maximum": 90,
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    "label": {
      +      "description": "Printed beside the code and used as the confirm button, e.g. \"Sign posted\". Up to 40 characters.",
      +      "maxLength": 40,
      +      "type": "string"
      +    },
      +    "mode": {
      +      "description": "link: the code opens url. confirm: it opens a mailbox.bot page with one button (label), records the confirmation, then opens url when given. verify: address verification; the piece also prints a short code the person enters in your app, signed in (POST /v1/batch-mail/verify with their ref), and a scan opens url (your page) with the code after #; nothing on mailbox.bot verifies; the code expires.",
      +      "enum": [
      +        "link",
      +        "confirm",
      +        "verify"
      +      ],
      +      "type": "string"
      +    },
      +    "on": {
      +      "description": "piece (default) or insert.",
      +      "enum": [
      +        "piece",
      +        "insert"
      +      ],
      +      "type": "string"
      +    },
      +    "url": {
      +      "description": "https:// link, may hold {{tags}} (values are URL-encoded). Required for link.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "mode"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / stock
      Added value: +{
      +  "description": "standard (default) or weatherproof: tear- and water-resistant synthetic sheets for notices and small signs posted outdoors, letters and flyers only, +85¢ per sheet.",
      +  "enum": [
      +    "standard",
      +    "weatherproof"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / template_url / description
      Previous value: -"Public https:// link to the template (PDF, PNG or JPG, ≤10 MB). Signed cloud-storage links, CDN and GitHub raw URLs work; links that need a login, private hosts and IP addresses are refused."New value: +"Public https:// link to the template (PDF, PNG or JPG, ≤10 MB). Signed cloud-storage links, CDN and GitHub raw URLs work; links that need a login, private hosts and IP addresses are refused. Required, except for a letter sent as message."
    • changedInput schema / required
      Previous value: -[
      -  "job_name",
      -  "mail_type",
      -  "template_url",
      -  "mailbox_md_version"
      -]New value: +[
      +  "job_name",
      +  "mail_type",
      +  "mailbox_md_version"
      +]
  2. Changed2 schema fields changed
    • changedInput schema / properties / color / description
      Previous value: -"Colour printing for letters, flyers and pamphlets (postcards are always full colour). Default false."New value: +"Color printing for letters, flyers and pamphlets, charged per color page (postcards are always full color). Default false."
    • changedInput schema / properties / recipients / description
      Previous value: -"Inline recipients, 10 to 10,000. Skipped rows are reported by position (1 = first). Send this or recipients_url, not both."New value: +"Inline recipients, up to 10,000 (postcards from 1, other types from 10). Skipped rows are reported by position (1 = first). Send this or recipients_url, not both."
  3. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: nothing is charged at creation, malformed rows and duplicates are skipped and listed, the proof link expires in one hour, approval-requiring keys save a draft the owner pays for, and marketing_mail is not open until the USPS permit is active. It also flags that scans store counts and times only, a privacy-relevant behavior not in the annotations.

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

Conciseness2/5

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

One very long single paragraph stitched with semicolons, mixing workflow, pricing, QR semantics, stock options and mailing-class rules into an undifferentiated block. Much of it (stock +85¢, insert_stock options, mailing_class definitions) restates schema descriptions verbatim, so length is not fully earned and key routing information is buried mid-paragraph.

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?

Covers the hard parts for a 23-parameter, high-stakes creation tool: prerequisites, exclusivity of input modes, per-piece QR behaviors with webhook names, minimum quantities and the required confirm step. Output schema covers the return shape, and the description still notes the result carries exact price, first recipients and image warnings.

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 description adds cross-parameter rules the schema cannot express: template_url vs message mutual exclusion on letters, recipients vs recipients_url exclusivity, template pixel sizing at the mail type's dimensions, and the {{tag|text}} fallback for field kits. It slightly over-explains qr modes that the schema already documents in detail.

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

Purpose5/5

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

Opens with a precise verb+resource+scope: 'Create a batch draft from a template link and a recipient list; nothing is charged.' That immediately separates it from confirm_batch_mail (which charges) and send_outbound_mail (single piece). An agent can pick it 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 Guidelines5/5

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

Spells out the full downstream sequence: create draft → get_batch_mail_proof → hand proof_url to the person → confirm_batch_mail charges credits, plus the get_mailbox_md prerequisite and the approval-key fallback. It also states the volume gates (postcards from 1 with a $2 fee under 10; letters/flyers/pamphlets from 10; max 10,000).

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.