Skip to main content
Glama

Buy and send a prepared certified letter

authorize_certified_letter
Idempotent

Buys and sends a letter that prepare_certified_letter prepared IN THIS CONVERSATION, after the person approved the exact total here. Call it only when (1) you have told the person the exact total, the recipient and the service, and they said yes to that total in this conversation, and (2) your platform has given you a Stripe shared payment token (spt_...) granted to Piloxa for that amount. Piloxa holds the payment, hands the letter to the printer, and charges only once the printer accepts it; if the printer refuses, the hold is released and nothing is charged. ALWAYS pass one idempotency_key per purchase and reuse it on every retry: the same key never charges twice and returns what already happened. If the total, the document or the address changed since the person approved, nothing is charged and you must ask again. Without a token, or if paying here is unavailable, nothing is charged and approval_url is returned: give it to the person, who pays there. The result carries transaction_state: AWAITING_APPROVAL, AUTHORIZED, VENDOR_ACCEPTED, MAILED, DELIVERED, RETURNED, FAILED or CANCELLED. Say a letter was sent only at VENDOR_ACCEPTED or later. At AUTHORIZED with failure OUTCOME_UNCERTAIN, do NOT retry: call get_certified_letter_status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mailing_idYesThe mailing_id prepare_certified_letter returned in this conversation.
payer_emailYesWhere the receipt, the tracking and the mailing record go.
user_approvedYesTrue only when the person explicitly approved this exact total, recipient and service in this conversation.
document_sha256NoOptional: the document_sha256 prepare_certified_letter returned. If the document changed since, nothing is charged.
idempotency_keyYesOne key per purchase, 16 to 100 letters, digits or _ . : -. Reuse the same key on every retry of this purchase; a new key is a new purchase attempt.
approval_statementNoThe words the person was shown and said yes to, for the record, e.g. "Send this letter to Acme Property Management by USPS Certified Mail with return receipt for" followed by the exact total.
expected_total_centsYesThe exact total the person approved, in cents: the total_cents or estimated_total_cents Piloxa returned. If the current total differs, nothing is charged.
shared_payment_tokenNoA Stripe shared payment token (spt_...) your platform issued to Piloxa for this purchase, limited to the approved amount.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
mailedYes
chargedYes
failureNo
receiptNo
serviceNo
currencyNo
replayedNoTrue when this answers an earlier call with the same idempotency key, or a purchase already under way.
recipientNo
referenceNoThe Piloxa mailing reference, once the letter exists as a mailing.
mailing_idNo
amount_centsNo
approval_urlNoWhere the person can review and pay instead.
practice_runNo
state_meaningNo
document_sha256No
amount_held_centsNo
printer_referenceNo
transaction_stateYes
amount_charged_centsNo
usps_tracking_numberNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only cover readOnly/destructive/idempotent/openWorld, so the description carries real weight and delivers: funds are held then charged only on printer acceptance, release with no charge if the printer refuses, no charge plus re-approval if total/document/address changed, and idempotency_key reuse guarantees a single charge. It also enumerates every transaction_state value and states the correct user-facing claim threshold (VENDOR_ACCEPTED or later), which annotations could never convey.

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?

Dense and front-loaded — the core action and its gating conditions come first, with payment/state details after. It is on the long side and the payment-mechanics sentences could be tightened, but nearly every clause carries actionable information for a tool that moves money.

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 money-moving, open-world purchase tool this is complete: approval preconditions, token requirement, hold/settle semantics, idempotency contract, change-detection behavior, fallback payment path, and state-machine interpretation are all present. An output schema exists, and the description still adds the state semantics an agent needs to phrase results correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds cross-parameter semantics the schema cannot: expected_total_cents is what the person approved and a mismatch aborts the charge, and one idempotency_key must be reused across retries so the same key never charges twice. The remaining parameters are simply echoed from their schema descriptions.

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?

States a specific verb and resource ('Buys and sends a letter') and ties it to the exact upstream tool that produced the input ('that prepare_certified_letter prepared IN THIS CONVERSATION'), which cleanly separates it from get_certified_letter_status and the quote/prepare siblings. An agent can tell what this does without opening the schema.

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

Usage Guidelines5/5

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

Gives two explicit, checkable preconditions (person approved the exact total/recipient/service in this conversation; a Stripe spt_ token granted to Piloxa exists) and an explicit when-not path: without a token nothing is charged and approval_url is returned for the person to pay. It also routes retry behavior away from this tool at OUTCOME_UNCERTAIN toward get_certified_letter_status.

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