{
  "tools": [
    {
      "name": "list_mail_products",
      "title": "List mail products",
      "description": "List the mail products (postcards, letters and fold cards): size, sides, fold, envelope, mail classes and presort minimums. To choose a piece, call list_templates instead.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "detail": {
            "description": "compact (MCP's default) or full: also the print specs and every template's slots, which is large.",
            "type": "string",
            "enum": [
              "compact",
              "full"
            ]
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "list_templates",
      "title": "List templates",
      "description": "Start here to choose a piece: one line per template, with audience_columns (the CSV columns it prints beyond name and address) and a preview_url (sample copy, open for one hour with no API key: send it to the person). Search with query in the user's words. requires_prescreened_list true is a prescreened credit offer: only for a consumer reporting agency's list (FCRA prescreen), never for a CDP, CRM or DMS customer list; prescreened: false leaves those out. owner \"partner\" lists your own saved templates. get_template gives one template's slots.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "product_code": {
            "description": "Only this product's templates, e.g. postcard_6x9.",
            "type": "string",
            "maxLength": 64
          },
          "use_case": {
            "description": "An exact use case tag, e.g. lease_pull_ahead.",
            "type": "string",
            "maxLength": 40
          },
          "query": {
            "description": "Words to match, best match first, e.g. \"lease pull-ahead\".",
            "type": "string",
            "maxLength": 200
          },
          "owner": {
            "description": "xcel, or partner (your saved templates); omit for both.",
            "type": "string",
            "enum": [
              "xcel",
              "partner"
            ]
          },
          "detail": {
            "description": "compact (the default): one line per template. full: also every slot and the compliance rules, which is large.",
            "type": "string",
            "enum": [
              "compact",
              "full"
            ]
          },
          "prescreened": {
            "description": "false: leave out the prescreened credit offers, as for any CDP, CRM or DMS customer list. true: only those.",
            "type": "boolean"
          },
          "source_audience": {
            "description": "Your CDP audience's ID or name: the templates mapped to it lead; unmapped, a name searches.",
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "get_template",
      "title": "Get template",
      "description": "Get one template in full, to write copy that fits: every slot (kind, max_length, required, sample, default, description), the compliance rules, use_cases, audience_columns, sample_copy and a preview_url.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "template_code": {
            "type": "string",
            "maxLength": 64,
            "description": "From list_templates, e.g. postcard_6x9_birthday, or your own p_ code."
          },
          "template_version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000,
            "description": "Your own templates (p_ codes) only: this version instead of the current one."
          }
        },
        "required": [
          "template_code"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "save_template",
      "title": "Save your own template",
      "description": "Save your own HTML template with typed copy slots as p_<code>; start from the product's starter, /docs/specs/<product_code>.starter.html. Each save of a code makes its next version, which generate_creative and preview_template use like Xcel's; template_version pins one. It must pass preflight with every slot's sample, or nothing is saved (422 template_invalid lists each fix); it never prints {{recipient.external_id}}, email or phone. At most 100 active templates, 50 active versions each (409: retire old ones). Xcel's licensed vehicle photos never print on it. Returns a preview_url to show the person.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "maxLength": 42,
            "description": "Lower-case letters, digits and _, e.g. spring_service, stored as p_<code>; send p_<code> to save a new version."
          },
          "product_code": {
            "type": "string",
            "maxLength": 64,
            "description": "The product it prints on, e.g. postcard_6x9; every version keeps it."
          },
          "name": {
            "type": "string",
            "maxLength": 80,
            "description": "The name listings show."
          },
          "description": {
            "type": "string",
            "maxLength": 2000,
            "description": "What the piece is for and who gets it; search reads it."
          },
          "html": {
            "type": "string",
            "maxLength": 200000,
            "description": "One <section class=\"xm-panel\" data-side=\"front\"> and one data-side=\"back\", an element with class xm-address holding {{recipient.address_block}}, {{brand.disclaimers}}, and {{copy.<slot>}} for each slot."
          },
          "slots": {
            "maxItems": 60,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Printed with {{copy.<name>}}."
                },
                "label": {
                  "type": "string",
                  "maxLength": 80
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "text",
                    "multiline",
                    "offer",
                    "disclosure",
                    "phone",
                    "date",
                    "vehicle"
                  ],
                  "description": "offer: prices and payments (they need the offer disclosure). disclosure: terms only the dealer states. phone, and names ending in _url, _link, _qr, _hours or signer, print from the profile when left out."
                },
                "max_length": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 5000,
                  "description": "The most characters the slot prints."
                },
                "required": {
                  "type": "boolean"
                },
                "sample": {
                  "description": "Example copy for previews. A required slot needs one.",
                  "type": "string",
                  "maxLength": 5000
                },
                "default": {
                  "description": "Optional slots: printed when a creative leaves the slot out.",
                  "type": "string",
                  "maxLength": 5000
                },
                "dealer_fact": {
                  "description": "A claim only the dealer can make (inventory, a person, an amount): the AI never writes it.",
                  "type": "boolean"
                },
                "description": {
                  "type": "string",
                  "maxLength": 300
                }
              },
              "required": [
                "name",
                "kind",
                "max_length"
              ]
            },
            "description": "The copy slots the HTML prints."
          },
          "use_cases": {
            "description": "Tags list_templates filters by, e.g. [\"service_retention\"].",
            "maxItems": 12,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 40
            }
          },
          "idempotency_key": {
            "description": "A UUID you send again on a retry, so the retry saves nothing twice.",
            "type": "string",
            "pattern": "^[\\x21-\\x7e]{1,255}$"
          }
        },
        "required": [
          "code",
          "product_code",
          "name",
          "description",
          "html",
          "slots"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "retire_template",
      "title": "Retire your own template",
      "description": "Retire one of your saved templates (a p_ code): no version of it is listed, previewed or used by a new creative again. Creatives already made from it are unchanged.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "template_code": {
            "type": "string",
            "maxLength": 64,
            "description": "Your p_ code."
          }
        },
        "required": [
          "template_code"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "preview_template",
      "title": "Preview template",
      "description": "Preview a template with your copy before any campaign exists: the same composition and preflight as generate_creative (each issue has a fix), and a preview_url a person can open for one hour with no API key (?format=pdf for the PDF): send the person the link. With dealer_id it prints that dealer's profile; without, the sample dealer Demo Motors. It never prints a customer, and saves nothing. Each preview counts against the hourly render limits (429 names the limit and its reset); opening the link counts nothing.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "copy": {
            "description": "Slot values by slot name, e.g. {\"headline\": \"Service Days\"}; \"\" leaves an optional slot empty. A slot you leave out prints its sample, or with dealer_id what the creative prints.",
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "maxLength": 5000
            }
          },
          "template_version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000,
            "description": "Your own templates (p_ codes) only: this version instead of the current one."
          },
          "dealer_id": {
            "description": "One of your dealers (Xcel id or your external id); omit for the sample dealer Demo Motors.",
            "type": "string",
            "maxLength": 100
          },
          "envelope": {
            "description": "Letters: closed_face adds the envelope face.",
            "type": "string",
            "enum": [
              "double_window",
              "closed_face"
            ]
          },
          "template_code": {
            "type": "string",
            "maxLength": 64,
            "description": "From list_templates, e.g. postcard_6x9_birthday, or your own p_ code."
          },
          "document": {
            "description": "none (default). html or pdf also returns the page inline: large, rarely needed.",
            "type": "string",
            "enum": [
              "none",
              "html",
              "pdf"
            ]
          }
        },
        "required": [
          "template_code"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "preview_artwork",
      "title": "Preview artwork",
      "description": "Check art for a product before any campaign: the artwork preflight (each issue with a fix), an artwork_id generate_creative takes for 7 days, and a preview_url (the review proof PDF, one hour, no API key) to send the person. Counts against the partner's hourly render limit (429); opening the link counts nothing.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "product_code": {
            "type": "string",
            "maxLength": 64,
            "description": "e.g. postcard_6x9."
          },
          "artwork": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "maxLength": 2000
              },
              "front": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "url"
                ]
              },
              "back": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "url"
                ]
              }
            },
            "description": "url: a PDF with a page per side; or front and back: a PNG or JPEG each (a letter's front is page 1)."
          }
        },
        "required": [
          "product_code",
          "artwork"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "openWorldHint": true
      }
    },
    {
      "name": "get_dealer_brand",
      "title": "Get dealer brand kit",
      "description": "Get what a new creative prints for a dealer (name, address, logo, colors and phone from its profile; disclosures set by Xcel) and the masked emails of its registered approvers. A creative cannot override these: change the profile instead.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "type": "string",
            "maxLength": 100,
            "description": "Xcel dealer id or your external dealer id."
          }
        },
        "required": [
          "dealer_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "get_account",
      "title": "Get account and live readiness",
      "description": "Who your key acts for and what is left before a live order: whether Xcel turned live ordering on, how many dealers have a registered approver and how many approvers still have to confirm, with next_step. Call it when the person asks whether they can go live; list_dealers shows each dealer's live_ready.",
      "inputSchema": {
        "type": "object",
        "properties": {}
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "list_dealers",
      "title": "List dealers",
      "description": "List your dealers a page at a time (next_after is the cursor), with external_id, profile_version, live_ready (false until an approver is registered) and ordering_enabled.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "default": 50,
            "description": "Dealers per page.",
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "after": {
            "description": "next_after from the previous page.",
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "get_dealer_profile",
      "title": "Get dealer profile",
      "description": "Get a dealer's profile: its version (send it as expected_version to update), the fields you own, the logos, approver_invitations, and the fields Xcel manages (read-only).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "type": "string",
            "maxLength": 100,
            "description": "Xcel dealer id or your external dealer id."
          },
          "version": {
            "description": "A past profile version to read; omit for the current one.",
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          }
        },
        "required": [
          "dealer_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "upsert_dealer",
      "title": "Create or update a dealer",
      "description": "Create a dealer (external_id, profile with name and address) or merge the fields you send into it. A sandbox key creates a test dealer. approver: the person who approves live orders; they confirm by email (approver_invitation). Disclosures, license number and spend cap are refused (xcel_managed_field).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "external_id": {
            "type": "string",
            "maxLength": 100,
            "pattern": "^[\\x21-\\x7e](?:[\\x20-\\x7e]*[\\x21-\\x7e])?$",
            "description": "Your unique id for the dealer; usable as dealer_id."
          },
          "profile": {
            "description": "name and address {line1, line2, city, state, zip} required; other fields as get_dealer_profile shows them.",
            "type": "object",
            "additionalProperties": {}
          },
          "expected_version": {
            "description": "Updates only: refuse unless the profile is at this version.",
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "approver": {
            "description": "Only as the user names them; never guess.",
            "type": "object",
            "properties": {
              "email": {
                "type": "string",
                "maxLength": 254,
                "format": "email"
              },
              "name": {
                "type": "string",
                "maxLength": 100
              }
            },
            "required": [
              "email"
            ]
          }
        },
        "required": [
          "external_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "update_dealer_profile",
      "title": "Update dealer profile",
      "description": "Merge changes into a dealer's profile (JSON merge patch: objects merge, null clears a field, lists replace). On version_conflict, read the profile again and reapply. Existing creatives keep their profile version: generate the creative again to use the change.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "type": "string",
            "maxLength": 100,
            "description": "Xcel dealer id or your external dealer id."
          },
          "expected_version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000,
            "description": "The profile version you read (get_dealer_profile.version)."
          },
          "changes": {
            "type": "object",
            "additionalProperties": {},
            "description": "Only the fields to change, e.g. {\"phones\": {\"main\": \"3125550100\"}}; null clears a field."
          }
        },
        "required": [
          "dealer_id",
          "expected_version",
          "changes"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "upload_dealer_logo",
      "title": "Upload dealer logo",
      "description": "Set a dealer's primary or reversed logo from content_base64 or an https url: PNG, JPEG or SVG, at most 3 MB, raster at least 600 px on the long side, not animated. Writes a new profile version.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "type": "string",
            "maxLength": 100,
            "description": "Xcel dealer id or your external dealer id."
          },
          "variant": {
            "default": "primary",
            "description": "primary (printed on the mail) or reversed (for dark backgrounds).",
            "type": "string",
            "enum": [
              "primary",
              "reversed"
            ]
          },
          "content_base64": {
            "description": "The file, base64. Send this or url.",
            "type": "string",
            "maxLength": 4194308
          },
          "url": {
            "description": "An https URL on a public host (no redirects). Send this or content_base64.",
            "type": "string",
            "maxLength": 2000
          },
          "expected_version": {
            "description": "Refuse (version_conflict) unless the profile is still at this version.",
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          }
        },
        "required": [
          "dealer_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "upload_dealer_asset",
      "title": "Upload dealer creative asset",
      "description": "Add a signature or photo the dealer owns the rights to, from an https url (up to 10 MB) or content_base64 (about 3 MB): PNG or JPEG (SVG for a signature). HTML prints it with merge_field; a built-in template signs with a matching signature. The same kind and label replaces the file. Writes a new profile version.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "type": "string",
            "maxLength": 100,
            "description": "Xcel dealer id or your external dealer id."
          },
          "kind": {
            "type": "string",
            "enum": [
              "signature",
              "store_photo",
              "staff_photo",
              "photo"
            ],
            "description": "What it is."
          },
          "label": {
            "description": "{{asset.<kind>.<label>}} names it. Required for a photo.",
            "type": "string",
            "maxLength": 60
          },
          "name": {
            "description": "The person, for a signature or staff photo.",
            "type": "string",
            "maxLength": 120
          },
          "title": {
            "description": "The person's job title.",
            "type": "string",
            "maxLength": 120
          },
          "department": {
            "description": "A signature's mail: sales or service.",
            "type": "string",
            "enum": [
              "sales",
              "service"
            ]
          },
          "content_base64": {
            "description": "The file, base64. Send this or url.",
            "type": "string",
            "maxLength": 4400000
          },
          "url": {
            "description": "An https URL on a public host (no redirects).",
            "type": "string",
            "maxLength": 2000
          },
          "expected_version": {
            "description": "Refuse unless the profile is at this version.",
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          }
        },
        "required": [
          "dealer_id",
          "kind"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "list_dealer_assets",
      "title": "List dealer creative assets",
      "description": "List a dealer's signatures and photos (kind, label, person, merge_field, print sharpness) and its slots: storefront, service drive, signature; which templates print each, and what they print without it.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "type": "string",
            "maxLength": 100,
            "description": "Xcel dealer id or your external dealer id."
          },
          "kind": {
            "description": "Only this kind.",
            "type": "string",
            "enum": [
              "signature",
              "store_photo",
              "staff_photo",
              "photo"
            ]
          }
        },
        "required": [
          "dealer_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "list_dealer_offers",
      "title": "List dealer offers",
      "description": "List a dealer's saved offers: id, label, text, terms, dates and status (active, scheduled, ended). generate_creative prints one by offer_id.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "type": "string",
            "maxLength": 100,
            "description": "Xcel dealer id or your external dealer id."
          }
        },
        "required": [
          "dealer_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "save_dealer_offer",
      "title": "Save dealer offer",
      "description": "Save an offer the dealer named, with its real terms and dates, for generate_creative's offer_id. Create with name, department and offer; with offer_id, change fields (null clears) or delete. Never invent an offer, figure or date: ask.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "type": "string",
            "maxLength": 100,
            "description": "Xcel dealer id or your external dealer id."
          },
          "offer_id": {
            "description": "Id or label; leave out to create.",
            "type": "string",
            "maxLength": 100
          },
          "delete": {
            "description": "With offer_id: remove it.",
            "type": "boolean"
          },
          "name": {
            "type": "string",
            "maxLength": 80,
            "description": "What the dealer calls it."
          },
          "department": {
            "type": "string",
            "enum": [
              "sales",
              "service",
              "parts"
            ],
            "description": "sales, service or parts."
          },
          "offer": {
            "type": "string",
            "maxLength": 40,
            "description": "The offer line, at most 40 characters."
          },
          "detail": {
            "description": "A line under the offer.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 70
              },
              {
                "type": "null"
              }
            ]
          },
          "disclosure": {
            "description": "Its terms; a payment, rate or term needs them.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 400
              },
              {
                "type": "null"
              }
            ]
          },
          "starts_on": {
            "description": "First good day, YYYY-MM-DD.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "ends_on": {
            "description": "Last good day, YYYY-MM-DD.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "expected_version": {
            "description": "Refuse unless the profile is at this version.",
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          }
        },
        "required": [
          "dealer_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "delete_dealer_asset",
      "title": "Delete dealer creative asset",
      "description": "Remove a signature or photo: new creatives can no longer print it; creatives and orders already made keep what they printed.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "type": "string",
            "maxLength": 100,
            "description": "Xcel dealer id or your external dealer id."
          },
          "asset_id": {
            "type": "string",
            "maxLength": 100,
            "description": "From list_dealer_assets."
          },
          "expected_version": {
            "description": "Refuse unless the profile is at this version.",
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          }
        },
        "required": [
          "dealer_id",
          "asset_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "upload_partner_asset",
      "title": "Upload partner asset",
      "description": "Add a photo every dealer can print: {{asset.photo.<label>}} prints it where the dealer has none with that label. PNG or JPEG by https url (10 MB) or content_base64 (3 MB). The same label replaces it.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "description": "What it shows."
          },
          "label": {
            "description": "Its {{asset.photo.<label>}}; default from name.",
            "type": "string",
            "maxLength": 60
          },
          "description": {
            "description": "When to use it.",
            "type": "string",
            "maxLength": 500
          },
          "content_base64": {
            "description": "The file, base64. Send this or url.",
            "type": "string",
            "maxLength": 4400000
          },
          "url": {
            "description": "An https URL on a public host (no redirects).",
            "type": "string",
            "maxLength": 2000
          }
        },
        "required": [
          "name"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "list_partner_assets",
      "title": "List partner assets",
      "description": "List your asset library: photos any dealer's mail can print, with label, merge_field and print sharpness.",
      "inputSchema": {
        "type": "object",
        "properties": {}
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "list_make_logos",
      "title": "List make logos",
      "description": "OEM make logos and the variant each prints on light and dark backgrounds. In HTML, {{dealer.make_logos}} prints a dealer's own.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "description": "Only this dealer's makes.",
            "type": "string",
            "maxLength": 100
          },
          "make": {
            "description": "e.g. Chevy: its files too.",
            "type": "string",
            "maxLength": 40
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "delete_partner_asset",
      "title": "Delete partner asset",
      "description": "Remove a library photo: new creatives can no longer print it; ones already made keep it.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "maxLength": 100,
            "description": "From list_partner_assets."
          }
        },
        "required": [
          "asset_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "prepare_order",
      "title": "Prepare an order",
      "description": "The fast path: from dealer_id, template_code and copy or a brief, one call creates the order and its creative, then takes the list. With source_url it imports it, renders the proof and quotes; without, the upload view takes the file and does the rest (elsewhere, give upload_page_url). A stopped step returns stopped, with its fix, and campaign_id: call again with it. Then show_proof and request_approval.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "campaign_id": {
            "description": "An order prepare_order started: it does what is left.",
            "type": "string"
          },
          "dealer_id": {
            "type": "string",
            "maxLength": 100,
            "description": "Xcel dealer id or your external dealer id."
          },
          "template_code": {
            "type": "string",
            "maxLength": 64,
            "description": "From list_templates, e.g. postcard_6x9_birthday, or your own p_ code."
          },
          "name": {
            "type": "string",
            "maxLength": 120,
            "description": "Default: the template's name."
          },
          "requested_mail_date": {
            "description": "Preferred mail date, YYYY-MM-DD, at most 180 days out.",
            "type": "string",
            "format": "date"
          },
          "copy": {
            "description": "Slot values by slot name, e.g. {\"headline\": \"Service Days\"}.",
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "maxLength": 5000
            }
          },
          "brief": {
            "description": "Claude writes the slots you leave out. No customer data.",
            "type": "object",
            "properties": {
              "goal": {
                "type": "string",
                "maxLength": 300,
                "description": "What the piece should achieve."
              },
              "offer": {
                "type": "string",
                "maxLength": 400,
                "description": "The offer with its real figures and end date."
              },
              "tone": {
                "type": "string",
                "maxLength": 100
              },
              "audience": {
                "description": "Who receives it, in general terms.",
                "type": "string",
                "maxLength": 300
              }
            },
            "required": [
              "goal",
              "offer"
            ]
          },
          "offer_id": {
            "description": "From list_dealer_offers.",
            "type": "string",
            "maxLength": 100
          },
          "source_url": {
            "type": "string",
            "maxLength": 4000,
            "description": "An https CSV link anyone can open for a few minutes."
          },
          "column_map": {
            "description": "{\"<your column>\": \"<our column>\"}, as upload_audience takes it.",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 200
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 64
            }
          },
          "idempotency_key": {
            "description": "A UUID to resend on a retry.",
            "type": "string",
            "pattern": "^[\\x21-\\x7e]{1,255}$"
          }
        }
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "openWorldHint": true
      }
    },
    {
      "name": "create_campaign",
      "title": "Create campaign",
      "description": "Create a draft campaign for one dealer and one product (the chosen template's product_code). Returns the campaign id and the next step.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "type": "string",
            "maxLength": 100,
            "description": "Xcel dealer id or your external dealer id."
          },
          "product_code": {
            "type": "string",
            "maxLength": 64,
            "description": "The chosen template's product_code, e.g. postcard_6x9."
          },
          "name": {
            "type": "string",
            "maxLength": 120,
            "description": "A name for the campaign, e.g. 'November service reminder'."
          },
          "requested_mail_date": {
            "description": "Preferred mail date, YYYY-MM-DD, at most 180 days out.",
            "type": "string",
            "format": "date"
          },
          "envelope": {
            "type": "string",
            "enum": [
              "double_window",
              "closed_face"
            ],
            "description": "Letters only: closed_face (the default, no window) or double_window. A fold card mails closed face."
          },
          "external_ref": {
            "type": "string",
            "maxLength": 100,
            "description": "Your id for the order (not unique), on every campaign response and webhook. Never customer data."
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 40
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 500
            },
            "description": "Your labels: up to 20 string values, returned like external_ref. Never customer data."
          },
          "idempotency_key": {
            "description": "A UUID to resend on a retry: within 24 h it returns the first campaign.",
            "type": "string",
            "pattern": "^[\\x21-\\x7e]{1,255}$"
          }
        },
        "required": [
          "dealer_id",
          "product_code",
          "name"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "list_campaigns",
      "title": "List campaigns",
      "description": "Find earlier orders, newest first, by dealer_id, status, external_ref or creation time; each carries its dealer_external_id, template_code and template_version. Page with starting_after = next_cursor while has_more is true. Lists your key's mode only.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "description": "Only this dealer's campaigns (Xcel id or your external id).",
            "type": "string",
            "maxLength": 100
          },
          "status": {
            "description": "Only campaigns in this status.",
            "type": "string",
            "enum": [
              "draft",
              "proof_ready",
              "awaiting_approval",
              "approved",
              "submitted",
              "in_production",
              "at_usps",
              "in_postal_network",
              "delivery_estimated",
              "completed",
              "cancelled"
            ]
          },
          "external_ref": {
            "description": "Only campaigns with this external_ref (exact match).",
            "type": "string",
            "maxLength": 100
          },
          "created_after": {
            "description": "A date-time with an offset, or a date (midnight UTC).",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "string",
                "format": "date"
              }
            ]
          },
          "created_before": {
            "description": "A date-time with an offset, or a date (midnight UTC).",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "string",
                "format": "date"
              }
            ]
          },
          "limit": {
            "default": 25,
            "description": "Campaigns per page.",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "starting_after": {
            "description": "next_cursor from the previous page, with the same filters.",
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "upload_audience",
      "title": "Upload audience",
      "description": "Rows never pass through a tool or the chat; never ask for rows to be pasted. source_url (an https CSV link) does it in one call. Else call without it: apps that show views open an upload view where the person drops the file, and it finishes the upload itself; elsewhere give the person upload_page_url or PUT to upload_url, then call again with uploaded_audience_id and any column_map. Returns counts and warnings, never rows. Columns: first_name, last_name, address1, zip (city and state come from it) and the template's audience_columns. Name your record-id column external_id, or map it. Phone and email are optional: used to match results, never printed.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "include_suppression_list": {
            "description": "Signed upload only: also return suppression_upload_url for a do-not-mail CSV (address1, zip), PUT the same way; never put rows in the chat.",
            "type": "boolean"
          },
          "campaign_id": {
            "type": "string",
            "description": "From create_campaign."
          },
          "source_url": {
            "type": "string",
            "maxLength": 4000,
            "description": "An https link to the CSV that anyone can open for a few minutes. Never stored or logged."
          },
          "uploaded_audience_id": {
            "description": "The audience_id from the first call, after the PUT.",
            "type": "string",
            "maxLength": 64
          },
          "column_map": {
            "description": "{\"<your column>\": \"<our column>\"}, e.g. {\"customer_id\": \"external_id\"}. Ours: the required columns, address2, external_id, vin, vehicle_year, vehicle_make, vehicle_model or a column the template reads. Common spellings need no map. To change it, complete the same audience_id again with suggested_column_map.",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 200
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 64
            }
          },
          "vehicle_source": {
            "description": "History to print first; a service mailing sends \"serviced\".",
            "type": "string",
            "enum": [
              "owned",
              "sold",
              "serviced"
            ]
          }
        },
        "required": [
          "campaign_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "openWorldHint": true
      }
    },
    {
      "name": "generate_creative",
      "title": "Generate creative",
      "description": "Make the campaign's creative from template_code with copy, template_code with a brief (Claude writes the slots you leave out; your copy wins; ai_copy returns the draft, ready or needs_edit), your own html, or print-ready art as artwork (check it with preview_artwork; uploads are REST only). The brand kit (logo, colors, address, disclosures) is locked, and store details you leave out print from the dealer's profile (profile_slots). Never send a prescreened credit offer as artwork. Returns preflight issues, each with a fix.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "template_code": {
            "description": "From list_templates, for this campaign's product: Xcel's or your own p_ code.",
            "type": "string",
            "maxLength": 64
          },
          "template_version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000,
            "description": "Your own templates (p_ codes) only: this version instead of the current one."
          },
          "html": {
            "description": "Your own creative HTML instead of a template. Must keep {{brand.disclaimers}} and an element with class xm-address.",
            "type": "string",
            "maxLength": 200000
          },
          "artwork": {
            "type": "object",
            "properties": {
              "url": {
                "description": "https, on a public host; fetched once.",
                "type": "string",
                "maxLength": 2000
              },
              "artwork_id": {
                "description": "From preview_artwork or a REST upload.",
                "type": "string",
                "maxLength": 64
              },
              "front": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "artwork_id": {
                    "type": "string",
                    "maxLength": 64
                  }
                }
              },
              "back": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "artwork_id": {
                    "type": "string",
                    "maxLength": 64
                  }
                }
              }
            },
            "description": "Static art at the product's file size (/docs/specs/<product_code>.pdf): a PDF with a page per side, or a PNG or JPEG each for front and back. Xcel prints the address block over it."
          },
          "copy": {
            "description": "Slot values by slot name, e.g. {\"headline\": \"Service Days\"}, with {{recipient.<column>}} merge fields; \"\" leaves an optional slot empty.",
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "maxLength": 5000
            }
          },
          "offer_id": {
            "description": "A dealer offer (list_dealer_offers) for the offer slots; your copy wins.",
            "type": "string",
            "maxLength": 100
          },
          "brief": {
            "description": "Template creatives only: Claude writes the slots you leave out. It never writes phones, disclosures, hours, web addresses, QR links, signers or dealer facts, and states credit or lease figures only from offer_terms. No customer data.",
            "type": "object",
            "properties": {
              "goal": {
                "type": "string",
                "maxLength": 300,
                "description": "What the piece should achieve."
              },
              "offer": {
                "type": "string",
                "maxLength": 400,
                "description": "The offer with its real figures and end date, e.g. '$49.95 synthetic oil change, ends December 31'. Copy uses only figures given here or in offer_terms."
              },
              "tone": {
                "description": "e.g. 'friendly and plain-spoken'.",
                "type": "string",
                "maxLength": 100
              },
              "audience": {
                "description": "Who receives it, in general terms; never names or customer data.",
                "type": "string",
                "maxLength": 300
              },
              "offer_terms": {
                "description": "Credit or lease terms. Without them, copy states no payment, APR, term or amount due; with them, the offer disclosure is filled from them.",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "finance",
                      "lease"
                    ],
                    "description": "finance (Reg Z) or lease (Reg M)."
                  },
                  "term_months": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 120,
                    "description": "Number of monthly payments."
                  },
                  "monthly_payment_cents": {
                    "description": "Required for a lease.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100000000
                  },
                  "apr_percent": {
                    "description": "Finance only, and required for finance.",
                    "type": "number",
                    "minimum": 0,
                    "maximum": 36
                  },
                  "down_payment_cents": {
                    "description": "Finance only; required with monthly_payment_cents.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100000000
                  },
                  "amount_financed_cents": {
                    "description": "Finance only.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100000000
                  },
                  "due_at_signing_cents": {
                    "description": "Lease only, and required for a lease.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100000000
                  },
                  "miles_per_year": {
                    "description": "Lease only.",
                    "type": "integer",
                    "minimum": 1000,
                    "maximum": 100000
                  },
                  "excess_mileage_cents": {
                    "description": "Per mile over the allowance. Lease only.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 500
                  },
                  "conditions": {
                    "description": "Your fine print, printed after the terms, e.g. 'Tax, title and fees extra.'",
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "required": [
                  "type",
                  "term_months"
                ]
              }
            },
            "required": [
              "goal",
              "offer"
            ]
          },
          "calls": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "print": {
                    "type": "string",
                    "enum": [
                      "tracking",
                      "store",
                      "own"
                    ],
                    "description": "tracking: an UpDash number ringing the store; store: its own line; own: own_number."
                  },
                  "own_number": {
                    "type": "string",
                    "maxLength": 30
                  },
                  "ring": {
                    "description": "With tracking: main, sales, service, parts or 10 digits.",
                    "type": "string",
                    "maxLength": 30
                  }
                },
                "required": [
                  "print"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The phone the pieces print. Omit to keep the last choice; null: the dealer's Calls setting."
          },
          "campaign_id": {
            "type": "string",
            "description": "From create_campaign."
          }
        },
        "required": [
          "campaign_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "openWorldHint": true
      }
    },
    {
      "name": "render_proof",
      "title": "Render proof",
      "description": "Render the proof for the current creative and audience, check preflight and the address block, and move the campaign to proof_ready. The print file and review proof show customer records, so neither is returned: show_proof shows the pages to the person. Limited per hour (429 names the limit and its reset): render once the creative and audience are final.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "campaign_id": {
            "type": "string",
            "description": "From create_campaign."
          }
        },
        "required": [
          "campaign_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "validate_campaign",
      "title": "Validate campaign",
      "description": "Check readiness for proof, quote and approval: audience, creative, preflight (each issue with a fix), small-run handling, earliest mail date, the dealer's spend cap and, live, what approval still lacks (live_gaps).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "campaign_id": {
            "type": "string",
            "description": "From create_campaign."
          }
        },
        "required": [
          "campaign_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "get_quote",
      "title": "Get quote",
      "description": "Quote the campaign at its mailable count, for the current creative and audience; it expires (default 7 days). Under the Marketing Mail presort minimum it quotes First-Class or the weekly pooled run. Prices are Xcel's published ones at the partner's volume tier (named in notes). dealer_spend_remaining_cents is what is left of the dealer's monthly cap; an order over it is refused.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "mail_class": {
            "description": "A postcard mails first_class only; default for others: marketing_mail.",
            "type": "string",
            "enum": [
              "marketing_mail",
              "first_class"
            ]
          },
          "campaign_id": {
            "type": "string",
            "description": "From create_campaign."
          }
        },
        "required": [
          "campaign_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "request_approval",
      "title": "Request human approval",
      "description": "Ask a person at the dealer to approve the order, bound to the current creative, audience and quote. max_spend_cents is the most the user told you to spend, in cents: never your own estimate, never higher; if they gave none, ask. Live: Xcel emails a registered approver the review link and returns the approval id and status; with show_proof they can decide in the chat. Sandbox: also review_url. Only the approver decides; you cannot approve it. On a prescreened credit offer the approver also confirms the list.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "quote_id": {
            "type": "string",
            "maxLength": 64,
            "description": "quote.id from get_quote."
          },
          "max_spend_cents": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 10000000000,
            "description": "The most the user told you to spend, in cents; at least the quote total."
          },
          "approver_email": {
            "description": "Live: one of the dealer's registered approvers (get_dealer_brand); omit when there is one. Sandbox: any address.",
            "type": "string",
            "maxLength": 254,
            "format": "email"
          },
          "campaign_id": {
            "type": "string",
            "description": "From create_campaign."
          }
        },
        "required": [
          "quote_id",
          "max_spend_cents",
          "campaign_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "show_proof",
      "title": "Show proof",
      "description": "Show the person the proof in the chat (apps with MCP Apps views: ChatGPT, Claude), its pages as they print. After request_approval the approver decides there with a code Xcel emails them (sandbox: the developer). You get the status, never pages or rows.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "campaign_id": {
            "type": "string",
            "description": "From create_campaign."
          }
        },
        "required": [
          "campaign_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "get_proof_view",
      "title": "Proof view pages",
      "description": "Proof view only: the pages' links and what the approver confirms.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "campaign_id": {
            "type": "string",
            "description": "From create_campaign."
          }
        },
        "required": [
          "campaign_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "send_approval_code",
      "title": "Email the approver a code",
      "description": "Proof view only: email the live order's approver the code that decides it.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "approval_id": {
            "type": "string",
            "maxLength": 64,
            "description": "The pending approval the view shows."
          },
          "view_key": {
            "description": "The view's key, from get_proof_view.",
            "type": "string",
            "maxLength": 400
          },
          "campaign_id": {
            "type": "string",
            "description": "From create_campaign."
          }
        },
        "required": [
          "approval_id",
          "campaign_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "decide_approval",
      "title": "Approver's decision",
      "description": "Proof view only: the approver approves or rejects, a live order with their emailed code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "approval_id": {
            "type": "string",
            "maxLength": 64,
            "description": "The pending approval the view shows."
          },
          "decision": {
            "type": "string",
            "enum": [
              "approve",
              "reject"
            ],
            "description": "The approver's decision."
          },
          "code": {
            "description": "Live: the 6-digit code Xcel emailed the approver.",
            "type": "string",
            "pattern": "^\\d{6}$"
          },
          "confirm": {
            "description": "Approve: the approver reviewed the proof, quantity and total.",
            "type": "boolean"
          },
          "note": {
            "description": "The approver's note.",
            "type": "string",
            "maxLength": 2000
          },
          "prescreen_confirm": {
            "description": "A prescreened offer: the approver confirms the list.",
            "type": "boolean"
          },
          "prescreen_list_date": {
            "description": "With prescreen_confirm: the list's date, YYYY-MM-DD.",
            "type": "string",
            "maxLength": 40
          },
          "view_key": {
            "description": "The view's key, from get_proof_view.",
            "type": "string",
            "maxLength": 400
          },
          "campaign_id": {
            "type": "string",
            "description": "From create_campaign."
          }
        },
        "required": [
          "approval_id",
          "decision",
          "campaign_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "submit_campaign",
      "title": "Submit campaign",
      "description": "Submit an approved campaign for production, with the approval_id and an idempotency_key you make once per order and reuse on retries. Refused unless the approver approved it, nothing changed since, and the total is within max spend and the dealer's spend cap.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "approval_id": {
            "type": "string",
            "maxLength": 64,
            "description": "approval_id from request_approval, after the approver approved it."
          },
          "campaign_id": {
            "type": "string",
            "description": "From create_campaign."
          },
          "idempotency_key": {
            "type": "string",
            "pattern": "^[\\x21-\\x7e]{1,255}$",
            "description": "A unique key per order (a UUID). Reuse it only to retry the same submission."
          }
        },
        "required": [
          "approval_id",
          "campaign_id",
          "idempotency_key"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "get_campaign_status",
      "title": "Get campaign status",
      "description": "Get the campaign's status, audience counts, creative and approval state, and the next step to take. Poll it to learn the approver's decision. USPS-derived statuses are processing scans, not proof of delivery.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "campaign_id": {
            "type": "string",
            "description": "From create_campaign."
          }
        },
        "required": [
          "campaign_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "get_campaign_results",
      "title": "Get campaign results",
      "description": "Get the production timeline, and results once Xcel's tracking reports them: aggregates and a page of per-lead results keyed by your external_id (page with leads_after), never names or addresses. USPS scans are processing scans, not delivery proof. A matched sale or repair order is evidence that a recipient bought, not proof the mail caused it: say so when you report results. Sandbox: simulated results from in_postal_network on, and responders from delivery_estimated.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "leads_after": {
            "description": "leads.next_after from the previous page.",
            "type": "string",
            "pattern": "^xm[a-z2-7]{16}$"
          },
          "leads_limit": {
            "default": 100,
            "description": "Leads per page.",
            "type": "integer",
            "minimum": 1,
            "maximum": 500
          },
          "external_id": {
            "description": "One person's leads: your record id, exact.",
            "type": "string",
            "maxLength": 128
          },
          "updated_after": {
            "description": "Only leads changed after this time.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "string",
                "format": "date"
              }
            ]
          },
          "campaign_id": {
            "type": "string",
            "description": "From create_campaign."
          }
        },
        "required": [
          "campaign_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "save_standing_order",
      "title": "Create or change a standing order",
      "description": "Save one dealer's repeating mailing: product, template creative and copy, the most one run may cost, approver, and how long to skip people already mailed. Create with dealer_id, name, product_code, creative and max_spend_cents; with standing_order_id, change what the next run does (null clears a field). Each run builds an ordinary order through request_approval: start_standing_order_run, a cadence that fetches source_url, or an emailed report whose subject holds inbound_subject. A person at the dealer approves every run. max_spend_cents is a budget a person set: never your estimate; ask if none was given.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "standing_order_id": {
            "description": "Change this standing order; omit to create one.",
            "type": "string",
            "maxLength": 100
          },
          "dealer_id": {
            "description": "Create only: Xcel dealer id or your external dealer id.",
            "type": "string",
            "maxLength": 100
          },
          "name": {
            "type": "string",
            "maxLength": 120,
            "description": "Each run's campaign is named after it and the run's date."
          },
          "product_code": {
            "description": "Create only: the product every run mails, e.g. postcard_6x9.",
            "type": "string",
            "maxLength": 64
          },
          "mail_class": {
            "description": "Create only: first_class or marketing_mail. A postcard mails first_class only; a letter or card defaults to marketing_mail.",
            "type": "string",
            "enum": [
              "marketing_mail",
              "first_class"
            ]
          },
          "creative": {
            "type": "object",
            "properties": {
              "template_code": {
                "type": "string",
                "maxLength": 64,
                "description": "From list_templates, for the product: Xcel's or your own p_ code."
              },
              "template_version": {
                "description": "Your own templates (p_ codes) only: this version instead of the current one.",
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              },
              "copy": {
                "description": "Slot values by slot name, with {{recipient.<column>}} merge fields; \"\" leaves an optional slot empty.",
                "type": "object",
                "additionalProperties": {
                  "type": "string",
                  "maxLength": 5000
                }
              }
            },
            "required": [
              "template_code"
            ],
            "description": "The template creative each run makes, as generate_creative takes it. Store details left out print from the dealer's profile."
          },
          "max_spend_cents": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 10000000000,
            "description": "The most one run may cost, in cents: a budget a person set (the dealer's monthly budget), never your estimate."
          },
          "status": {
            "description": "Change only: paused stops new runs; active starts them again.",
            "type": "string",
            "enum": [
              "active",
              "paused"
            ]
          },
          "approver_email": {
            "description": "Live: one of the dealer's registered approvers (get_dealer_brand); omit when there is one. Sandbox: any address.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 254,
                "format": "email"
              },
              {
                "type": "null"
              }
            ]
          },
          "skip_mailed_within_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 730,
            "description": "Skip anyone this standing order mailed within this many days (default 90; 0 turns it off)."
          },
          "submit_on_approval": {
            "description": "Default true: an approved run's order submits itself. false: you submit it with submit_campaign.",
            "type": "boolean"
          },
          "source_url": {
            "description": "An https link that serves the current list as CSV whenever it is fetched; cadence fetches it on schedule. Never returned with its query.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ]
          },
          "cadence": {
            "description": "When the daily job fetches source_url and starts a run: {\"every\": \"month\", \"day\": 1-28} or {\"every\": \"week\", \"weekday\": 1-7}. Needs source_url.",
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "every": {
                        "type": "string",
                        "const": "month"
                      },
                      "day": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 28,
                        "description": "Day of the month, 1 to 28 (every month has it)."
                      }
                    },
                    "required": [
                      "every",
                      "day"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "every": {
                        "type": "string",
                        "const": "week"
                      },
                      "weekday": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 7,
                        "description": "Day of the week, 1 Monday to 7 Sunday."
                      }
                    },
                    "required": [
                      "every",
                      "weekday"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "column_map": {
            "description": "{\"<your column>\": \"<our column>\"}, e.g. {\"customer_id\": \"external_id\"}, as upload_audience takes it.",
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "maxLength": 200
                },
                "additionalProperties": {
                  "type": "string",
                  "maxLength": 64
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "vehicle_source": {
            "description": "History to print first; a service mailing sends \"serviced\".",
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "owned",
                  "sold",
                  "serviced"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "external_id": {
            "description": "Create only: your id for it, unique among your standing orders that are not ended. Never customer data.",
            "type": "string",
            "maxLength": 100
          },
          "inbound_subject": {
            "description": "Take lists by email: the audience's title as the emailed report's subject shows it (update_dealer_inbound_email sets up the address).",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "idempotency_key": {
            "description": "Create only: a UUID to resend on a retry; within 24 h it returns the first standing order.",
            "type": "string",
            "pattern": "^[\\x21-\\x7e]{1,255}$"
          }
        }
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "list_standing_orders",
      "title": "List standing orders",
      "description": "Find your standing orders, newest first, by dealer_id, status or external_id; page with starting_after = next_cursor while has_more is true. Lists your key's mode only. get_standing_order gives one with its runs.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "description": "Only this dealer's standing orders (Xcel id or your external id).",
            "type": "string",
            "maxLength": 100
          },
          "status": {
            "description": "Only standing orders in this status.",
            "type": "string",
            "enum": [
              "active",
              "paused",
              "ended"
            ]
          },
          "external_id": {
            "description": "Only the standing order with this external_id.",
            "type": "string",
            "maxLength": 100
          },
          "limit": {
            "default": 25,
            "description": "Standing orders per page.",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "starting_after": {
            "description": "next_cursor from the previous page, with the same filters.",
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "get_standing_order",
      "title": "Get standing order",
      "description": "Get one standing order, its ten newest runs (status, counts, campaign_id, approval_id, error) and the next step. A run's order is a campaign: follow it with get_campaign_status. runs_after pages to older runs.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "standing_order_id": {
            "type": "string",
            "maxLength": 100,
            "description": "From save_standing_order or list_standing_orders."
          },
          "runs_after": {
            "description": "runs_next_cursor from the previous call: the next ten older runs.",
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "standing_order_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "end_standing_order",
      "title": "End a standing order",
      "description": "End a standing order for good: no run starts again; its runs, their orders and its history stay. A run already waiting on its approver goes on, and its order submits only when you submit it. To stop for a while, save it with status paused instead (save_standing_order).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "standing_order_id": {
            "type": "string",
            "maxLength": 100,
            "description": "From save_standing_order or list_standing_orders."
          }
        },
        "required": [
          "standing_order_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "start_standing_order_run",
      "title": "Start a standing order run",
      "description": "Start a run now: read the list, skip anyone this standing order mailed within its window, and build the order through request_approval. Rows never pass through a tool: send source_url (an https link to this run's CSV), or omit it for the standing order's own. Returns the run (status, counts, campaign_id) and the approval (sandbox: review_url). nothing_to_mail makes no order; one run builds at a time.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "standing_order_id": {
            "type": "string",
            "maxLength": 100,
            "description": "From save_standing_order or list_standing_orders."
          },
          "source_url": {
            "description": "An https link to this run's CSV, fetched once. Omit to fetch the standing order's own source_url.",
            "type": "string",
            "maxLength": 4000
          },
          "column_map": {
            "description": "This run's column_map; omit for the standing order's.",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 200
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 64
            }
          },
          "vehicle_source": {
            "description": "This run's vehicle_source; omit for the standing order's.",
            "type": "string",
            "enum": [
              "owned",
              "sold",
              "serviced"
            ]
          }
        },
        "required": [
          "standing_order_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "get_dealer_inbound_email",
      "title": "Get dealer inbound email",
      "description": "Get the dealer's address for emailed lists in your key's mode: whether it is on, the address, the senders allowed, the standing orders that take email (inbound_subject) and any Gmail forwarding code waiting. The address is a secret: give it only to the person who sets up the report.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "type": "string",
            "maxLength": 100,
            "description": "Xcel dealer id or your external dealer id."
          }
        },
        "required": [
          "dealer_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "update_dealer_inbound_email",
      "title": "Update dealer inbound email",
      "description": "Turn the dealer's address for emailed lists on or off, set who may email lists, or rotate it (the old address stops at once). Then give a standing order an inbound_subject, and have the platform email that audience's report to the address: each email starts a run.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dealer_id": {
            "type": "string",
            "maxLength": 100,
            "description": "Xcel dealer id or your external dealer id."
          },
          "enabled": {
            "description": "true takes emailed lists (the first true gives the address); false refuses them.",
            "type": "boolean"
          },
          "senders": {
            "description": "Addresses or @domain entries allowed to email lists, e.g. your platform's sending address; replaces the list. Empty allows anyone: set it.",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 254,
              "pattern": "^(?:[^\\s@<>,;]+@[^\\s@<>,;]+\\.[^\\s@<>,;]+|@[^\\s@<>,;]+\\.[^\\s@<>,;]+)$"
            }
          },
          "rotate": {
            "description": "true gives the dealer a new address; the old one stops at once.",
            "type": "boolean",
            "const": true
          },
          "idempotency_key": {
            "description": "A UUID to resend on a retry, so a retried rotation rotates once.",
            "type": "string",
            "pattern": "^[\\x21-\\x7e]{1,255}$"
          }
        },
        "required": [
          "dealer_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "advance_test_campaign",
      "title": "Advance a sandbox order",
      "description": "Sandbox keys only: move a submitted sandbox order to its next production status, or to `to`. Results are simulated from in_postal_network on, and responders from delivery_estimated. Simulated dates follow the timeline, not the quoted dates. A live key is refused (403 test_mode_only).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "to": {
            "description": "The status to move to; omit for the next one; \"completed\" does it all in one call. Orders only move forward.",
            "type": "string",
            "enum": [
              "submitted",
              "in_production",
              "at_usps",
              "in_postal_network",
              "delivery_estimated",
              "completed"
            ]
          },
          "campaign_id": {
            "type": "string",
            "description": "From create_campaign."
          }
        },
        "required": [
          "campaign_id"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "openWorldHint": false
      }
    }
  ]
}
