Use Cases
Log In

MCP Tools

The tools of the MCP server. Arguments are JSON, nested arguments are shown as parent[child]. Files are publicly accessible URLs, data URLs (data:image/png;base64,...) or Base64 strings; big files are uploaded with create_file_upload and passed as its file_url. Photos, logos and designs can also be objects with the file and its crop rectangle (height, width, x, y), in percents of the image.

get_account

Returns the signed in user: email and available credits (in cents).

Takes no arguments.

list_payment_methods

Lists the cards saved on the account, for `send_campaign`.

Takes no arguments.

list_templates

Lists the templates the user can mail with: sizes, prices (in cents per piece), photo slots and whether they are own design templates (artwork upload) or preset templates (filled from `template_data`). `production_specs` gives the artwork size, trim, safe zone and ink-free zone (in inches, from the top left of the artwork) and the official guide PDFs; follow them when making artwork for own design templates.

Takes no arguments.

get_template

Returns one template.

Arguments

id
integer or string
Required

The template ID or UID.

preview_template

Renders a preset template with the given content, without creating a campaign. Returns the HTML of the front and the back. Photos, the agent photo and the logo are URLs here.

Arguments

id
integer or string
Required

The template ID or UID.

template_data
object
Optional
template_data[address]
string
Optional

The listing address, usually on the front.

template_data[description]
string
Optional

The listing description, usually on the back.

template_data[label]
string
Optional

A label, e.g. "Just Listed" or "Just Sold".

template_data[back_title]
string
Optional
template_data[landing_page_url]
string
Optional

Rendered as text or as a QR code depending on the template.

template_data[price]
integer
Optional

In dollars.

template_data[bedrooms]
number
Optional

Whole or half numbers, e.g. 2.5.

template_data[bathrooms]
number
Optional

Whole or half numbers, e.g. 2.5.

template_data[square_footage]
integer
Optional
template_data[lot_size]
number
Optional
template_data[lot_size_type]
string
Optional

One of square_feet, arces .

template_data[maintenance]
integer
Optional

Annual maintenance cost in dollars.

template_data[taxes]
integer
Optional

Annual taxes in dollars.

template_data[variables]
array
Optional

Extra variables some templates render.

template_data[variables][][key]
string
Required
template_data[variables][][value]
string
Required
template_data[photos]
array of string
Optional
agent
object
Optional
agent[first_name]
string
Optional
agent[last_name]
string
Optional
agent[email]
string
Optional
agent[cell_phone]
string
Optional

Formatted as (555) 555-5555 or 555-555-5555.

agent[landline]
string
Optional

Formatted as (555) 555-5555 or 555-555-5555.

agent[license_number]
string
Optional
agent[photo]
string
Optional
sender
object
Optional
sender[name]
string
Optional
sender[street_address]
string
Optional
sender[suite]
string
Optional
sender[city]
string
Optional
sender[state]
string
Optional
sender[zip]
string
Optional
sender[logo]
string
Optional
qr_codes
object
Optional

QR codes printed on top of the design. Scans are tracked, see `get_qr_scans`.

qr_codes[front]
array
Optional

QR code overlays per side. Positions and sizes are in inches from the top-left corner. Letters only have a front.

qr_codes[front][][url]
string
Required

The URL the QR code points to.

qr_codes[front][][size]
number
Required

Side length in inches.

qr_codes[front][][x]
number
Required
qr_codes[front][][y]
number
Required
qr_codes[back]
array
Optional

QR code overlays per side. Positions and sizes are in inches from the top-left corner. Letters only have a front.

qr_codes[back][][url]
string
Required

The URL the QR code points to.

qr_codes[back][][size]
number
Required

Side length in inches.

qr_codes[back][][x]
number
Required
qr_codes[back][][y]
number
Required

create_file_upload

For files too big to pass as a data URL or Base64 string (more than a few hundred kilobytes), when you can make HTTP requests or the user can run a command. Returns an upload valid for an hour: POST the file as multipart/form-data to `upload.url`, the `upload.fields` first and the file last as `file` (`curl` is the command, with <path> to replace). Then pass `file_url` wherever a file is taken, for a day. At most 25 MB.

Arguments

filename
string
Required

The file name with its extension, e.g. `front.pdf` or `recipients.csv`.

create_campaign

Creates a draft campaign. Nothing is required, an empty draft is created without parameters. Fill it in here or later with `update_campaign`. Returns the campaign with its `edit_url`. Thumbnails and the proof render in the background, fetch them with `get_campaign`.

Arguments

name
string
Optional

The campaign name.

template_id
integer or string
Optional

The ID or UID of the template, see `list_templates`. Own design templates are picked from the size of the first design when left out.

postage_class
string
Optional

`standard` is only available for templates with a standard price.

One of first_class, standard .

designs
array of files
Optional

Own design templates only: the artwork, an image or a single page PDF sized to the mailpiece including bleed (see the `production_specs` of the template). The first is the front, the second the back. With only a front the back is left white. Letters take one design.

template_data
object
Optional

Preset templates only: the content rendered on the mailpiece.

template_data[address]
string
Optional

The listing address, usually on the front.

template_data[description]
string
Optional

The listing description, usually on the back.

template_data[label]
string
Optional

A label, e.g. "Just Listed" or "Just Sold".

template_data[back_title]
string
Optional
template_data[landing_page_url]
string
Optional

Rendered as text or as a QR code depending on the template.

template_data[price]
integer
Optional

In dollars.

template_data[bedrooms]
number
Optional

Whole or half numbers, e.g. 2.5.

template_data[bathrooms]
number
Optional

Whole or half numbers, e.g. 2.5.

template_data[square_footage]
integer
Optional
template_data[lot_size]
number
Optional
template_data[lot_size_type]
string
Optional

One of square_feet, arces .

template_data[maintenance]
integer
Optional

Annual maintenance cost in dollars.

template_data[taxes]
integer
Optional

Annual taxes in dollars.

template_data[variables]
array
Optional

Extra variables some templates render.

template_data[variables][][key]
string
Required
template_data[variables][][value]
string
Required
template_data[photos]
array of files
Optional

The listing photos; the template needs one for each of its `photo_aspect_ratios`.

agent
object
Optional

Preset templates only: the agent shown on the mailpiece.

agent[first_name]
string
Optional
agent[last_name]
string
Optional
agent[email]
string
Optional
agent[cell_phone]
string
Optional

Formatted as (555) 555-5555 or 555-555-5555.

agent[landline]
string
Optional

Formatted as (555) 555-5555 or 555-555-5555.

agent[license_number]
string
Optional
agent[photo]
file
Optional

A file (URL, data URL or Base64 string), or an object with the file and its crop. Without a crop the image is cropped to the center.

sender
object
Optional

The return address, `name` is usually the company name. Required before sending.

sender[name]
string
Optional
sender[street_address]
string
Optional
sender[suite]
string
Optional
sender[city]
string
Optional
sender[state]
string
Optional
sender[zip]
string
Optional
sender[logo]
file
Optional

A file (URL, data URL or Base64 string), or an object with the file and its crop. Without a crop the image is cropped to the center.

targeting_method
string
Optional

`map` mails the homes nearest to an address, `own_list` mails a list of recipients.

One of map, own_list .

map_targeting
object
Optional

With `targeting_method: map`.

map_targeting[postcard_quantity]
integer
Required

How many homes to mail.

map_targeting[center]
object
Optional

The homes nearest to this point are mailed.

map_targeting[center][address]
string
Optional

Geocoded when no coordinates are given.

map_targeting[center][coordinates]
array of number
Optional

[latitude, longitude]

map_targeting[filters]
object
Optional
map_targeting[filters][property_type]
string
Optional

One of all, single_family, multi_family .

map_targeting[filters][bedrooms]
object
Optional
map_targeting[filters][bedrooms][from]
number
Optional
map_targeting[filters][bedrooms][to]
number
Optional
map_targeting[filters][bathrooms]
object
Optional
map_targeting[filters][bathrooms][from]
number
Optional
map_targeting[filters][bathrooms][to]
number
Optional
map_targeting[filters][square_feet]
object
Optional
map_targeting[filters][square_feet][from]
number
Optional
map_targeting[filters][square_feet][to]
number
Optional
map_targeting[filters][lot_size]
object
Optional
map_targeting[filters][lot_size][from]
number
Optional
map_targeting[filters][lot_size][to]
number
Optional
map_targeting[filters][year_built]
object
Optional
map_targeting[filters][year_built][from]
number
Optional
map_targeting[filters][year_built][to]
number
Optional
map_targeting[filters][sold_for]
object
Optional

Last sale price in dollars.

map_targeting[filters][sold_for][from]
number
Optional
map_targeting[filters][sold_for][to]
number
Optional
map_targeting[filters][sold_at]
object
Optional

Year of the last sale.

map_targeting[filters][sold_at][from]
number
Optional
map_targeting[filters][sold_at][to]
number
Optional
recipients
array
Optional

With `targeting_method: own_list`, instead of `csv`. Replaces the current recipients.

recipients[][recipient]
string
Required

The name, e.g. "Current Resident".

recipients[][address]
string
Required
recipients[][city]
string
Required
recipients[][state]
string
Required
recipients[][zip]
string
Required
csv
string
Optional

With `targeting_method: own_list`, instead of `recipients`: a CSV with the columns Name,Address,City,State,Zip (URL, data URL or Base64). Replaces the current recipients. Rows missing a field are set aside, see `list_incomplete_addresses`.

send_copy_to_sender
boolean
Optional

Mail one extra piece to the sender.

send_copy_to_company_address
boolean
Optional

Whether the copy goes to the sender address (default) or to `copy_address`.

copy_address
object
Optional

Where the copy goes when `send_copy_to_company_address` is false.

copy_address[name]
string
Optional
copy_address[street_address]
string
Optional
copy_address[suite]
string
Optional
copy_address[city]
string
Optional
copy_address[state]
string
Optional
copy_address[zip]
string
Optional
qr_codes
object
Optional

QR codes printed on top of the design. Scans are tracked, see `get_qr_scans`.

qr_codes[front]
array
Optional

QR code overlays per side. Positions and sizes are in inches from the top-left corner. Letters only have a front.

qr_codes[front][][url]
string
Required

The URL the QR code points to.

qr_codes[front][][size]
number
Required

Side length in inches.

qr_codes[front][][x]
number
Required
qr_codes[front][][y]
number
Required
qr_codes[back]
array
Optional

QR code overlays per side. Positions and sizes are in inches from the top-left corner. Letters only have a front.

qr_codes[back][][url]
string
Required

The URL the QR code points to.

qr_codes[back][][size]
number
Required

Side length in inches.

qr_codes[back][][x]
number
Required
qr_codes[back][][y]
number
Required
notification_email
string
Optional

Where the receipt and the mailing updates are sent.

discount_code
string
Optional
meta_data
array
Optional

Your own key / value pairs, `list_campaigns` can filter by them.

meta_data[][key]
string
Required
meta_data[][value]
string
Required
validation
string
Optional

Reject the call unless the campaign is complete up to this step: `template`, `content` (designs or template data, sender) or `targeting`.

One of template, content, targeting .

update_campaign

Updates a draft campaign. Only the given fields change.

Arguments

id
integer
Required

The campaign ID.

name
string
Optional

The campaign name.

template_id
integer or string
Optional

The ID or UID of the template, see `list_templates`. Own design templates are picked from the size of the first design when left out.

postage_class
string
Optional

`standard` is only available for templates with a standard price.

One of first_class, standard .

designs
array of files
Optional

Own design templates only: the artwork, an image or a single page PDF sized to the mailpiece including bleed (see the `production_specs` of the template). The first is the front, the second the back. With only a front the back is left white. Letters take one design.

template_data
object
Optional

Preset templates only: the content rendered on the mailpiece.

template_data[address]
string
Optional

The listing address, usually on the front.

template_data[description]
string
Optional

The listing description, usually on the back.

template_data[label]
string
Optional

A label, e.g. "Just Listed" or "Just Sold".

template_data[back_title]
string
Optional
template_data[landing_page_url]
string
Optional

Rendered as text or as a QR code depending on the template.

template_data[price]
integer
Optional

In dollars.

template_data[bedrooms]
number
Optional

Whole or half numbers, e.g. 2.5.

template_data[bathrooms]
number
Optional

Whole or half numbers, e.g. 2.5.

template_data[square_footage]
integer
Optional
template_data[lot_size]
number
Optional
template_data[lot_size_type]
string
Optional

One of square_feet, arces .

template_data[maintenance]
integer
Optional

Annual maintenance cost in dollars.

template_data[taxes]
integer
Optional

Annual taxes in dollars.

template_data[variables]
array
Optional

Extra variables some templates render.

template_data[variables][][key]
string
Required
template_data[variables][][value]
string
Required
template_data[photos]
array of files
Optional

The listing photos; the template needs one for each of its `photo_aspect_ratios`.

agent
object
Optional

Preset templates only: the agent shown on the mailpiece.

agent[first_name]
string
Optional
agent[last_name]
string
Optional
agent[email]
string
Optional
agent[cell_phone]
string
Optional

Formatted as (555) 555-5555 or 555-555-5555.

agent[landline]
string
Optional

Formatted as (555) 555-5555 or 555-555-5555.

agent[license_number]
string
Optional
agent[photo]
file
Optional

A file (URL, data URL or Base64 string), or an object with the file and its crop. Without a crop the image is cropped to the center.

sender
object
Optional

The return address, `name` is usually the company name. Required before sending.

sender[name]
string
Optional
sender[street_address]
string
Optional
sender[suite]
string
Optional
sender[city]
string
Optional
sender[state]
string
Optional
sender[zip]
string
Optional
sender[logo]
file
Optional

A file (URL, data URL or Base64 string), or an object with the file and its crop. Without a crop the image is cropped to the center.

targeting_method
string
Optional

`map` mails the homes nearest to an address, `own_list` mails a list of recipients.

One of map, own_list .

map_targeting
object
Optional

With `targeting_method: map`.

map_targeting[postcard_quantity]
integer
Required

How many homes to mail.

map_targeting[center]
object
Optional

The homes nearest to this point are mailed.

map_targeting[center][address]
string
Optional

Geocoded when no coordinates are given.

map_targeting[center][coordinates]
array of number
Optional

[latitude, longitude]

map_targeting[filters]
object
Optional
map_targeting[filters][property_type]
string
Optional

One of all, single_family, multi_family .

map_targeting[filters][bedrooms]
object
Optional
map_targeting[filters][bedrooms][from]
number
Optional
map_targeting[filters][bedrooms][to]
number
Optional
map_targeting[filters][bathrooms]
object
Optional
map_targeting[filters][bathrooms][from]
number
Optional
map_targeting[filters][bathrooms][to]
number
Optional
map_targeting[filters][square_feet]
object
Optional
map_targeting[filters][square_feet][from]
number
Optional
map_targeting[filters][square_feet][to]
number
Optional
map_targeting[filters][lot_size]
object
Optional
map_targeting[filters][lot_size][from]
number
Optional
map_targeting[filters][lot_size][to]
number
Optional
map_targeting[filters][year_built]
object
Optional
map_targeting[filters][year_built][from]
number
Optional
map_targeting[filters][year_built][to]
number
Optional
map_targeting[filters][sold_for]
object
Optional

Last sale price in dollars.

map_targeting[filters][sold_for][from]
number
Optional
map_targeting[filters][sold_for][to]
number
Optional
map_targeting[filters][sold_at]
object
Optional

Year of the last sale.

map_targeting[filters][sold_at][from]
number
Optional
map_targeting[filters][sold_at][to]
number
Optional
recipients
array
Optional

With `targeting_method: own_list`, instead of `csv`. Replaces the current recipients.

recipients[][recipient]
string
Required

The name, e.g. "Current Resident".

recipients[][address]
string
Required
recipients[][city]
string
Required
recipients[][state]
string
Required
recipients[][zip]
string
Required
csv
string
Optional

With `targeting_method: own_list`, instead of `recipients`: a CSV with the columns Name,Address,City,State,Zip (URL, data URL or Base64). Replaces the current recipients. Rows missing a field are set aside, see `list_incomplete_addresses`.

send_copy_to_sender
boolean
Optional

Mail one extra piece to the sender.

send_copy_to_company_address
boolean
Optional

Whether the copy goes to the sender address (default) or to `copy_address`.

copy_address
object
Optional

Where the copy goes when `send_copy_to_company_address` is false.

copy_address[name]
string
Optional
copy_address[street_address]
string
Optional
copy_address[suite]
string
Optional
copy_address[city]
string
Optional
copy_address[state]
string
Optional
copy_address[zip]
string
Optional
qr_codes
object
Optional

QR codes printed on top of the design. Scans are tracked, see `get_qr_scans`.

qr_codes[front]
array
Optional

QR code overlays per side. Positions and sizes are in inches from the top-left corner. Letters only have a front.

qr_codes[front][][url]
string
Required

The URL the QR code points to.

qr_codes[front][][size]
number
Required

Side length in inches.

qr_codes[front][][x]
number
Required
qr_codes[front][][y]
number
Required
qr_codes[back]
array
Optional

QR code overlays per side. Positions and sizes are in inches from the top-left corner. Letters only have a front.

qr_codes[back][][url]
string
Required

The URL the QR code points to.

qr_codes[back][][size]
number
Required

Side length in inches.

qr_codes[back][][x]
number
Required
qr_codes[back][][y]
number
Required
notification_email
string
Optional

Where the receipt and the mailing updates are sent.

discount_code
string
Optional
meta_data
array
Optional

Your own key / value pairs, `list_campaigns` can filter by them.

meta_data[][key]
string
Required
meta_data[][value]
string
Required
validation
string
Optional

Reject the call unless the campaign is complete up to this step: `template`, `content` (designs or template data, sender) or `targeting`.

One of template, content, targeting .

get_campaign

Returns a campaign: its content, targeting, `recipient_count`, `price` (in cents), status, thumbnails, proof and the steps it has completed.

Arguments

id
integer
Required

The campaign ID.

list_campaigns

Lists the campaigns, newest first.

Arguments

page
integer
Optional
per_page
integer
Optional
search
string
Optional

Matches the name or the address.

status
string
Optional

One of all, draft, sent .

targeting_method
string
Optional

One of all, map, recipients .

template_type
string
Optional

One of all, own_design, preset .

meta_data
array
Optional

Your own key / value pairs, `list_campaigns` can filter by them.

meta_data[][key]
string
Required
meta_data[][value]
string
Required

get_campaign_edit_url

Returns a link that signs the user in and opens the campaign in the RealMailers editor, for whatever is easier done by hand (cropping, the map, paying with a new card). The link expires after 30 minutes, get a new one each time.

Arguments

id
integer
Required

The campaign ID.

step
string
Optional

The step to open. When the campaign cannot be there yet, the furthest step it can be at opens.

One of template, content, user, company, targets, payment .

list_incomplete_addresses

Own list campaigns: the next batch of CSV rows set aside for missing a field, with `total`. They are not mailed until fixed.

Arguments

id
integer
Required

The campaign ID.

fix_incomplete_addresses

Completes rows from `list_incomplete_addresses`. Rows with every field are added to the recipients, the others stay set aside. Returns the next batch and `fixed_count`.

Arguments

id
integer
Required

The campaign ID.

rows
array
Required
rows[][id]
integer
Required

The row ID.

rows[][recipient]
string
Optional
rows[][company]
string
Optional
rows[][address1]
string
Optional
rows[][city]
string
Optional
rows[][state]
string
Optional
rows[][zip]
string
Optional

exclude_incomplete_addresses

Leaves rows from `list_incomplete_addresses` out of the mailing.

Arguments

id
integer
Required

The campaign ID.

ids
array of integer
Optional

The row IDs.

all
boolean
Optional

Exclude every incomplete row.

send_campaign

Pays for and schedules a complete draft campaign. This spends money: confirm the `price` from `get_campaign` with the user first. Monthly invoiced accounts are billed on their invoice. Others pay with credits and / or a saved card: when `get_account` shows credits, offer them to the user and pass their choice as `apply_credits`. When neither covers the price, or the card needs the user to confirm it, nothing is charged and a `payment_url` is returned for the user to pay in the browser.

Arguments

id
integer
Required

The campaign ID.

payment_method_id
string
Optional

A saved card from `list_payment_methods`.

apply_credits
boolean
Optional

Pay with the available credits first. Defaults to true.

scheduled_at
string
Optional

ISO-8601. When the mailpieces go to print, at least 15 minutes and less than 90 days from now. The campaign can be cancelled until then. Defaults to the cancellation window.

email
string
Optional

Where the receipt is sent.

cancel_campaign

Cancels a sent campaign which has not gone to print yet and refunds it.

Arguments

id
integer
Required

The campaign ID.

clone_campaign

Copies a campaign, sent or not, into a new draft.

Arguments

id
integer
Required

The campaign ID.

delete_campaign

Deletes a draft campaign.

Arguments

id
integer
Required

The campaign ID.

get_qr_scans

Lists the scans of the campaign QR codes.

Arguments

id
integer
Required

The campaign ID.

curl -X POST https://www.realmailers.com/mcp \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list"
  }'