Skip to main content
Glama

Create a mail order draft

postalform.create_order_draft

Prepare an existing PDF for mailing and return the order ID, total, hosted checkout URL, and checkout session. After buyer approval, a compatible client can pass a Stripe shared payment token to complete_checkout; otherwise present the hosted checkout URL. To prepare for MPP, set payment_protocol=mpp and buyer_email; receive a PDF preview, hosted checkout_url fallback and MPP challenge, then use postalform.pay_order with the order_id after buyer approval. Draft creation never pays. For x402, use postalform.create_machine_order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pdfYesThe PDF to mail. Accepts attachment objects ({ download_url, file_id }). Fallbacks: upload_token from postalform.create_pdf_upload, data:application/pdf;base64,..., or a public HTTPS download URL.
colorNoWhether to print in color (default: false).
certifiedNoWhether to add proof mail: USPS Certified Mail for US destinations, Canada Post Registered Mail through PostGrid for Canadian destinations, or PinGen registered mail for supported European destinations (default: false).
file_nameNoOptional display file name.
buyer_nameNoReceipt name; defaults to sender_name for MPP.
mail_classNoMail service level (standard, priority, express).
request_idNoOptional idempotency key. Reuse the same value if retrying the call.
buyer_emailNoRequired for MPP receipt delivery.
sender_nameYesSender's name (return address).
double_sidedNoWhether to print double-sided (default: true).
recipient_nameYesRecipient's name.
payment_protocolNoOptional payment path. Defaults to hosted checkout. Choose mpp to return a payment challenge for this same prepared order; buyer_email is required. Draft creation never pays.
sender_address_idNoLoqate address id for the sender (required when sender_address_type is Address).
sender_address_textNoHuman-readable sender address preview (required when sender_address_type is Address; optional for Manual).
sender_address_typeYesAddress suggestion type for the sender (from postalform.search_addresses). Use Manual to pass a structured address with countryCode when outside the US.
recipient_address_idNoLoqate address id for the recipient (required when recipient_address_type is Address).
sender_address_manualNoSender manual address fields (required when sender_address_type is Manual).
recipient_address_textNoHuman-readable recipient address preview (required when recipient_address_type is Address; optional for Manual).
recipient_address_typeYesAddress suggestion type for the recipient (from postalform.search_addresses). Use Manual to pass a structured address with countryCode when outside the US.
certified_return_receiptNoAdd Electronic Return Receipt for US Certified Mail. Ignored for Canada Post Registered Mail and PinGen registered-mail destinations (default: false).
recipient_address_manualNoRecipient manual address fields (required when recipient_address_type is Manual).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
viewYes
paymentNo
order_idYes
price_usdYes
page_countYes
preview_urlNo
sender_nameYes
checkout_urlYes
recipient_nameYes
checkout_sessionNo
payment_protocolNo
sender_address_textYes
recipient_address_textYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • changedInput schema / properties / recipient_name / maxLength
      Previous value: -32New value: +255
    • changedInput schema / properties / sender_name / maxLength
      Previous value: -32New value: +255
    • addedOutput schema / properties / recipient_name / maxLength
      Added value: +255
    • addedOutput schema / properties / recipient_name / minLength
      Added value: +1
    • addedOutput schema / properties / sender_name / maxLength
      Added value: +255
    • addedOutput schema / properties / sender_name / minLength
      Added value: +1
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations (readOnlyHint=false, destructiveHint=false, openWorldHint=true) establish the mutation and open-world profile, and the description adds genuinely useful behavioral context beyond them: 'Draft creation never pays' and the multi-step MPP flow ending in postalform.pay_order. Return contents are spelled out but an output schema already exists, so some of that is redundant.

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

Conciseness4/5

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

The purpose and return payload are front-loaded, and each subsequent sentence handles a distinct payment path. It is dense with protocol jargon across four sentences, but nothing is clearly wasted; a slightly tighter MPP sentence would help.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 21-parameter mutation tool with an output schema, the description supplies the missing pieces: which payment paths exist, how they chain to sibling tools, and the explicit guarantee that no payment occurs at draft time. An agent has everything needed to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 21 parameters, including payment_protocol, buyer_email, and the address fields. The description's mention of payment_protocol=mpp plus buyer_email adds a workflow-level coupling but largely restates what the schema fields already state, so the baseline 3 is appropriate.

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

Purpose5/5

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

The description states a specific verb and resource ('Prepare an existing PDF for mailing') and immediately enumerates what is returned (order ID, total, hosted checkout URL, checkout session). It also distinguishes itself from siblings by routing x402 use to postalform.create_machine_order and the letter/form variants are implicitly excluded by the PDF scope.

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

Usage Guidelines5/5

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

It gives explicit when-to-use routing: hosted checkout by default, MPP when payment_protocol=mpp and buyer_email are set, and x402 via a different tool. It names the downstream alternatives (complete_checkout, postalform.pay_order) and the condition that selects each, leaving little to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources