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 the batch record 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. Nothing is charged until the batch is confirmed, and a one-hour proof link shows the template and a sample address label first. Requires the current mailbox_md_version. 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.

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": {
      "job_name": "<job_name>",
      "mail_type": "<mail_type>",
      "mailbox_md_version": "<mailbox_md_version>"
    },
    "name": "create_batch_mail"
  }
}

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 is the front only; the text has to 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: USPS requires bills, statements and personal correspondence to 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_versionYesCurrent MAILBOX.md version number. 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. Changed3 schema fields changed
    • changedInput schema / properties / mailbox_md_version / description
      Previous value: -"Your current MAILBOX.md version from get_mailbox_md. Required for agent keys."New value: +"Current MAILBOX.md version number. Required for agent keys."
    • changedInput schema / properties / mailing_class / description
      Previous value: -"first_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."New value: +"first_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: USPS requires bills, statements and personal correspondence to go first_class."
    • changedInput schema / properties / message / description
      Previous value: -"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."New value: +"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 is the front only; the text has to fit once each recipient's fields are filled in."
  2. 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"
      +]
  3. 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."
  4. Added

TDQS

A4/5.0
Behavior5/5

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

Goes well past the annotations (which only declare non-read-only, open-world, non-idempotent, non-destructive): it states that nothing is charged until confirmation, that malformed rows and duplicates are skipped and listed rather than charged, that a one-hour proof link shows the template and a sample label first, that approval-gated keys park the draft in the dashboard, and that scans/confirmations surface as batch.piece.scanned/confirmed webhooks. These are exactly the side effects and costs an agent needs before committing.

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?

The first sentence is well front-loaded and almost no content is filler, but the middle is one enormous run-on with nested parentheses and semicolons covering QR verify flow, field kits, inserts and stock — a reader has to re-parse it several times. Information density is high; structural clarity is not.

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?

For a 23-parameter, nested-object, open-world creation tool this covers everything material: pricing and minimums per mail type, the small-batch fee, the no-charge-until-confirm guarantee, the proof step, the approval path, and the version requirement. With an output schema present it correctly does not need to enumerate return values, though it helpfully flags 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 meaning the schema does not: template resolution must match the mail type's size (1200×1800 px for 4×6 at 300 dpi), recipients and recipients_url are mutually exclusive, and template_url is unnecessary when a letter is sent as message. The QR mode explanation duplicates the schema's own enum descriptions, which dilutes the gain slightly.

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

Purpose4/5

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

Opens with a precise verb+resource+inputs: "Create a batch draft from a template link and a recipient list; nothing is charged." It implicitly separates itself from confirm_batch_mail ("Nothing is charged until the batch is confirmed") and from quoting tools, but never names the siblings estimate_batch_mail or confirm_batch_mail, so the distinction is inferred rather than stated.

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

Usage Guidelines3/5

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

Gives rich applicability constraints: postcards from 1 recipient, letters/flyers/pamphlets from 10, up to 10,000, marketing_mail needs 200+, agent keys need the current mailbox_md_version, and approval-requiring keys save a draft for the owner to pay. What is missing is explicit routing — it never says to use estimate_batch_mail for a no-draft quote or confirm_batch_mail to pay, so the agent must infer the workflow from the sibling names.

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.