{"agent":"claude","input":"Draft a dunning email for Stripe invoice in_1QxR7mHk2Lw9Pa3T, whose payment just failed. Read only: use stripe_api_read and never stripe_api_write. 1) GET /v1/invoices/in_1QxR7mHk2Lw9Pa3T: customer, customer_name, customer_email, amount_due, amount_remaining, currency, attempt_count, next_payment_attempt, billing_reason, collection_method, number, hosted_invoice_url. 2) GET /v1/invoice_payments with invoice in_1QxR7mHk2Lw9Pa3T; for its payment_intent, GET /v1/payment_intents/{id} and read last_payment_error.decline_code, code and advice_code. 3) GET /v1/invoices with customer set to that customer and status paid, limit 100: count paid invoices, the first one's date, and any earlier invoice whose attempt_count is above 1. 4) Write the email from Dana Okafor, Billing, Fieldline Software. By decline_code: expired_card asks for a new card; insufficient_funds or card_velocity_exceeded asks for another payment method and says nothing about funds; authentication_required asks them to pay on the invoice link so their bank can confirm it; fraudulent, lost_card, stolen_card, merchant_blacklist and any unknown code say only that the card was declined. Give the amount, the invoice number, the next automatic retry date if next_payment_attempt is set, and hosted_invoice_url. Thank a customer of more than 12 months for their time with us; for billing_reason subscription_create, write a short check-in instead of a reminder. Under 140 words, no threats, no late fees, no account suspension. Return JSON {invoice, customer_email, decline_code, attempt_count, next_retry, months_as_customer, earlier_failures, subject, body, notes_for_billing}.","connections":["stripe"]}