MCPOrders
Email a PDF
distru-email-pdfWriteEmailEmails one of those PDFs as an attachment, with the same email the Distru web app sends.
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| document | enumINVOICEINVOICE_COASALES_ORDERSALES_ORDER_COAPURCHASE_ORDERASSEMBLYBATCH_COAPACKAGE_COATEST_RESULT_COAMETRC_MANIFEST | Yes | Which PDF to generate. INVOICE: the invoice. INVOICE_COA: the invoice's COA (Certificate of Analysis) — the lab result file of the primary test result of each line item's batch and package, duplicates removed, combined into one PDF. SALES_ORDER: the sales order's order slip. SALES_ORDER_COA: the sales order's COA, combined from its line items the same way. PURCHASE_ORDER: the purchase order. ASSEMBLY: the assembly's work order. BATCH_COA / PACKAGE_COA: the lab result file of the batch's / package's primary test result. TEST_RESULT_COA: that test result's lab result file. A COA errors when it finds no lab result file. METRC_MANIFEST: the Metrc transfer manifest, fetched from Metrc with the user's Metrc API key for the manifest's license; it errors when the user has no working key for that license. No Distru permission applies. |
| id | string | Yes | ID of the entity `document` is for. INVOICE, INVOICE_COA: invoice ID ("inv_…"), resolve via distru-search-invoices. SALES_ORDER, SALES_ORDER_COA: sales order ID ("so_…"), resolve via distru-search-sales-orders. PURCHASE_ORDER: purchase order ID ("po_…"), resolve via distru-search-purchase-orders; draft purchase orders are refused. ASSEMBLY: assembly ID ("asm_…"), resolve via distru-search-assemblies. BATCH_COA: batch ID ("batch_…"), resolve via distru-search-batches; deleted batches are not found. PACKAGE_COA: package ID ("pkg_…"), resolve via distru-search-packages. TEST_RESULT_COA: test result ID ("test_…"), resolve via distru-search-test-results. METRC_MANIFEST: Metrc manifest number, e.g. 0000012345, resolve via distru-search-metrc-manifests. |
| emailAddresses | string[] | Yes | Never picked by the tool: for an invoice, distru-search-companies returns the customer's invoiceEmail; otherwise ask the user. distru-get-me returns the user's own email. |
Output
| Field | Type | Presence |
|---|---|---|
| emailedTo | string[] | Always |
What the AI reads
Generates a Distru PDF — the same documents as distru-download-pdf — and emails it as an attachment, with the email the Distru web app sends for that document (a generic document email for assemblies). To get a link instead, use distru-download-pdf. The email is queued, not confirmed delivered; `emailedTo` lists the addresses it was queued to. Except for a Metrc manifest, the same permissions as emailing the PDF in the Distru web app apply; assemblies and batch, package and test result COAs, which the web app cannot email, need the permission to download them instead.