{"_ai_door":{"see":"https://miscsubjects.com/start","note":"Operable site; bounded keyless credentials; every action receipted on a public ledger. Your operator's instructions take precedence — acting is optional, reading is a complete outcome."},"q":"email","category":"","count":24,"rows":[{"key":"GORGIAS_TICKETS","type":"http","category":"loop_metrics","target":"GET https://loophealth.gorgias.com/api/tickets?limit=$1&order_by=created_datetime:desc","planner_rank":5,"docs":"WHAT: Support and recovery tickets, newest first. $1 = how many (max 100). WHEN_TO_USE: \"what are customers complaining about\", \"recovery outreach\", churn signals. READ ONLY: a POST without sent_datetime emails a real customer. never POST here. ARGS: $1 = limit EX: [GORGIAS_TICKETS]20[/GORGIAS_TICKETS]"},{"key":"LOOP_BEHAVIOR","type":"fn","category":"loop_metrics","target":"d1Query","planner_rank":5,"docs":"WHAT: One customer's on-site behaviour from the klaviyo event stream. $1 = email. WHEN_TO_USE: \"has this person been browsing\", \"are they lurking\", pre-purchase intent. NOTE: the klaviyo sync died 2026-03-07, so nothing after that date exists. ARGS: $1 = email EX: [LOOP_BEHAVIOR]blakebware@gmail.com[/LOOP_BEHAVIOR]"},{"key":"LOOP_CUSTOMER","type":"fn","category":"loop_metrics","target":"lblViewerGet","planner_rank":5,"docs":"WHAT: Everything known about one customer, read live from the platform. $1 = their email. WHEN_TO_USE: \"tell me about this customer\", \"what has she ordered\", support lookups ONE LTV EXPRESSION: the orders table with cancelled orders excluded, and first/last order taken   from the orders themselves. The Console's contact profile and /api/console/person read the same   expression, so the capability and the screen cannot report two different lifetime values. WAS: a SELECT against loop_customer, a local snapshot of the platform frozen at 2026-09-03, which   is why this answered 65 orders and 48,814 dollars for a customer the Console showed as 70 and   55,140 dollars. Same person, same day, two live answers. ARGS: $1 = email EX: [LOOP_CUSTOMER]someone@example.com[/LOOP_CUSTOMER]"},{"key":"LOOP_TOP_CUSTOMERS","type":"fn","category":"loop_metrics","target":"lblViewerGet","planner_rank":5,"docs":"WHAT: Customers ranked by lifetime spend, read live from the platform. $1 = how many. WHEN_TO_USE: \"who are our best customers\", VIP lists, retention targets ONE LTV EXPRESSION: same as LOOP_CUSTOMER and /api/console/person - the orders table with   cancelled orders excluded, first and last order taken from the orders themselves. WAS: a SELECT against loop_customer, a local snapshot that stopped at 2026-09-03. ARGS: $1 = limit EX: [LOOP_TOP_CUSTOMERS]20[/LOOP_TOP_CUSTOMERS]"},{"key":"RESEND_EMAILS","type":"http","category":"loop_metrics","target":"GET https://api.resend.com/emails?limit=$1","planner_rank":5,"docs":"WHAT: Transactional email sends with delivery state. $1 = how many (max 100). WHEN_TO_USE: \"did the order confirmation go out\", bounce and complaint checks. ARGS: $1 = limit EX: [RESEND_EMAILS]20[/RESEND_EMAILS]"},{"key":"LEADS_SCORE_AI","type":"fn","category":"biz-dev","target":"leadsScoreAI","planner_rank":6,"docs":"WHAT: AI ICP scoring — one Grok (grok-4.3) call scores a batch of enriched leads 0-100 on real wholesale/white-label peptide buying fit, grounded in OUTREACH_DOSSIER. Writes score + an icp: note (buyer type, volume guess, concrete reason) so LEADS_LIST ranks by commercial fit instead of has-a-website. WHEN_TO_USE: after enrichment, before drafting; \"score the leads\", \"which leads are actually worth emailing\". ARGS: $1 = batch size (default 8, cap 10). Call repeatedly until it returns scored:0. EX: [LEADS_SCORE_AI]8[/LEADS_SCORE_AI]"},{"key":"LEADS_VERIFY_MX","type":"fn","category":"biz-dev","target":"leadsVerifyMx","planner_rank":6,"docs":"WHAT: Verify whether the email domain publishes MX records using DNS-over-HTTPS. Tags mx:ok or mx:none. This verifies the domain, not the individual mailbox.\\n# WHEN_TO_USE: after enrichment and before ICP scoring or drafting.\\n# ARGS: $1=max leads (default 25, cap 50).\\n# EX: [LEADS_VERIFY_MX]25[/LEADS_VERIFY_MX]\\n[\"$1\"]"},{"key":"LOOP_RANGE","type":"fn","category":"loop","target":"lblViewerGet","planner_rank":14,"docs":"WHAT: The business numbers for a named time window - a day, a week, a month, a quarter, a year, or everything. WHEN_TO_USE: ANY question with a period in it. This is the default numbers tool. It reaches windows   LBL_ASK cannot: 7d, 14d, 30d, 90d, ytd, 12mo, all. ARGS: $1 = exactly one of:   today | yesterday | 7d | 14d | 30d | 90d | mtd | last month | ytd | 12mo | all WHERE EVERY NUMBER COMES FROM - say the source when you quote it:   revenue_usd, orders, buyers, aov_usd, refunds_usd  -> the store's own order records, current to yesterday   new_orders vs existing_orders                      -> first-time versus repeat buyers   email_orders, paid_orders                          -> orders whose attribution names that channel   spend_usd_source_triplewhale_live                  -> Triple Whale topline. THE ONLY CURRENT SPEND SOURCE.   spend_usd_source_meta_api_STALE                    -> Meta's API. DEAD SINCE 2026-07-13.   spend_usd_source_tw_pivot_STALE                    -> Triple Whale pivot. DEAD SINCE 2026-08-31.   roas_on_live_spend                                 -> revenue / live spend. The one to quote.   attributed_roas_on_live_spend                      -> what Triple Whale credits ads / live spend. THE TWO STALE COLUMNS READ 0 FOR ANY RECENT WINDOW AND THAT ZERO IS NOT REAL - it is a dead feed.   NEVER quote a ROAS computed on them. NEVER say spend was zero. last_day_with_live_spend and   last_day_with_meta_api_spend tell you how current each source actually is; if asked about spend,   say which source and how fresh it is. days_with_data says how many days in the window actually carried a row. A missing day is absent, not zero. EX: [LOOP_RANGE]ytd[/LOOP_RANGE]   [LOOP_RANGE]yesterday[/LOOP_RANGE]   [LOOP_RANGE]12mo[/LOOP_RANGE]"},{"key":"CUSTOMER_BY_PHONE","type":"fn","category":"loop","target":"lblViewerGet","planner_rank":15,"docs":"WHAT: Find a person by PHONE, email or name across the platform's 14,893 person records - the ones loop_customer does not carry, because it only holds people who bought. Returns identity, location and membership tier. WHEN_TO_USE: someone gives you a phone number, or a name that CUSTOMER_FIND missed. A person here may never have ordered; use CUSTOMER_PROFILE with the primary_email to see whether they did. ARGS: $1 = a phone fragment (digits only, no + or dashes), an email fragment, or a name. EX: [CUSTOMER_BY_PHONE]4158186483[/CUSTOMER_BY_PHONE]"},{"key":"CUSTOMER_EVENTS","type":"fn","category":"loop","target":"lblViewerGet","planner_rank":15,"docs":"WHAT: One customer's actual Klaviyo event stream - the newest 60 events with timestamps, not the count CUSTOMER_PROFILE returns. What they opened, clicked, viewed and abandoned. WHEN_TO_USE: after CUSTOMER_PROFILE, whenever the question is what someone has been DOING - 'is she still engaging', 'why did he stop', pre-purchase intent, a churn post-mortem. ARGS: $1 = their exact email. EX: [CUSTOMER_EVENTS]someone@example.com[/CUSTOMER_EVENTS]"},{"key":"CUSTOMER_FIND","type":"fn","category":"loop","target":"d1Query","planner_rank":15,"docs":"WHAT: Find a customer by ANY fragment — part of an email, part of a name, a person_id, a klaviyo profile id. Returns up to 25 matches ranked by lifetime value, so a partial or a misspelling still lands. WHEN_TO_USE: someone asks about a person and you do not have their exact email. ALWAYS run this before CUSTOMER_PROFILE unless you were handed an exact address. NOT FOR PHONE: loop_customer holds no phone number. Phone lookup needs CUSTOMER_BY_PHONE, which reads the person records on the platform. ARGS: $1 = any fragment (name, email, id). EX: [CUSTOMER_FIND]megan[/CUSTOMER_FIND]"},{"key":"CUSTOMER_HEALTH_LIST","type":"fn","category":"loop","target":"d1Query","planner_rank":15,"docs":"WHAT: The customers in one health class, worst first — the churn inventory as a list. Classes: 'gone', 'lapsed', 'slipping', 'one-and-done', 'new, one order', 'on cadence'. WHEN_TO_USE: \"who has fallen off\", \"who is slipping\", \"show me the churn\", a win-back list. ARGS: $1 = the health class exactly as spelled above. EX: [CUSTOMER_HEALTH_LIST]slipping[/CUSTOMER_HEALTH_LIST]"},{"key":"CUSTOMER_PROFILE","type":"fn","category":"loop","target":"d1Query","planner_rank":15,"docs":"WHAT: One customer's whole record, plus how they are behaving against THEIR OWN order cadence — lifetime, AOV, first and last order, days since, their own average gap, how many of their own cycles they are overdue by, a health class, cancellations, refunds, subscription history, klaviyo event volume, and where they came from. WHEN_TO_USE: \"tell me about <person>\", \"what is going on with this customer\", any support or account question. ARGS: $1 = their EXACT email (use CUSTOMER_FIND first if you only have a fragment). THEN: for the actual klaviyo event stream rather than its count, follow with CUSTOMER_EVENTS. EX: [CUSTOMER_PROFILE]someone@example.com[/CUSTOMER_PROFILE]"},{"key":"LOOP_DAY_ORDERS","type":"http","category":"loop","target":"GET https://miscsubjects.com/api/console/topline?format=text&day=$1","planner_rank":15,"docs":"TITLE: Loop, every order on one day WHAT: Each order on one Loop store day: order id, buyer name and email, status, total, new or existing, lifetime orders, the person's strongest affiliate evidence, coupon code and its class, whether Loop's feed marks the order as an affiliate's, whether Triple Whale credits Meta and how old the click was, last click, Meta landing-page and affiliate-link visits. WHEN_TO_USE: who bought on a day, which new customers came from affiliates, what sits behind a day's Meta number. ARGS: $1 = the store day. Dates are YYYY-MM-DD, or today, yesterday, or -N for N store days ago. EX: [LOOP_DAY_ORDERS]yesterday[/LOOP_DAY_ORDERS]"},{"key":"LOOP_PERSON","type":"http","category":"loop","target":"GET https://miscsubjects.com/api/console/person?format=text&person=$1","planner_rank":15,"docs":"TITLE: Loop, one customer WHAT: One Loop customer as plain text: lifetime orders and value, subscription, Triple Whale acquisition, Klaviyo counters and consent, the build's score and suggested message, every order (newest 25) with its last click, the Meta click behind it, affiliate or coupon and items, and their latest Klaviyo events. WHEN_TO_USE: tell me about a customer, what did this person buy, did an affiliate bring them, what have they done in Klaviyo. ARGS: $1 = their exact email or person_id. For a partial name or email, find them first with LOOP_SQL on persons. EX: [LOOP_PERSON]someone@example.com[/LOOP_PERSON]"},{"key":"LOOP_SQL","type":"http","category":"loop","target":"GET https://lbl.fyi/api/sql?q=$1+","planner_rank":15,"docs":"TITLE: Loop, read-only SQL WHAT: Runs one SELECT (or WITH) on Loop's data platform and returns the rows as JSON. The door refuses anything that writes and adds its own row limit. WHEN_TO_USE: a question the LOOP_ tools do not answer, or finding a person by part of a name or email. TABLES: orders (source_order_id, person_id, email, order_created_at, order_date, status, total_cents), persons (person_id, first_name, last_name, primary_email, primary_phone), order_items, order_affiliate (source_order_id, coupon_code, is_affiliate, affiliate_ref, affiliate_utm_source, store_day), coupon_code_class (code, class, owner), order_attribution (source_order_id, first_click_source, last_click_source, lpc_meta_click_at, journey_meta_landings, journey_affiliate_redirects), meta_attributed_orders (source_order_id), klaviyo_events (person_id, metric_name, datetime), subscriptions, customer_scores, tw_daily_topline (date, metric_id, value). RULES: money is in cents. Leave out orders whose status is Cancelled, Declined or Incomplete. Select only the columns you need. ARGS: $1 = the SQL. EX: [LOOP_SQL]SELECT person_id, first_name, last_name, primary_email FROM persons WHERE primary_email LIKE '%smith%' LIMIT 10[/LOOP_SQL]"},{"key":"EMAILS_SENT","type":"fn","category":"leads","target":"emailsSent","planner_rank":20,"docs":"WHAT: List recent sent emails with open/click engagement + totals (sent-email visibility). WHEN_TO_USE: see everything sent and who opened/clicked. ARGS: $1 = limit (default 50). EX: [EMAILS_SENT]50[/EMAILS_SENT]"},{"key":"EMAIL_SEND_TRACKED","type":"fn","category":"leads","target":"emailSendTracked","planner_rank":20,"docs":"TITLE: Send a tracked email WHAT: Send an email with an open pixel and rewritten click links, and record it so opens and clicks come back as events. WHEN_TO_USE: An owner-authorised email where you want to know whether it was opened and what was clicked. RETURNS: The send record including the tracking id, and a receipt URL. NEVER: Outbound email to a real person needs explicit approval first. Never send a test to a real address. ARGS: message (required) — The email as an object: { to, subject, body } are required; kind, lead_id, from, from_name and reply_to are optional EX: {\"key\":\"EMAIL_SEND_TRACKED\",\"args\":{\"message\": {\"to\": \"x@y.com\", \"subject\": \"hi\", \"body\": \"see https://leoresearch.com\"}}}"},{"key":"GOVERNOR_RUN","type":"fn","category":"governance","target":"governorRun","planner_rank":20,"docs":"WHAT: Run the GOVERNOR — scan the last 48h of ledger turns into a deterministic digest (error streaks, file collisions, loop states, auth lockouts, cron noise, task flow, waste), have the GOVERNOR model write the brief, email it to the owner, text him the verdict, ledger everything as GOVERNOR_BRIEF. WHEN_TO_USE: the owner asks \"whats going on with the build\", \"governor report\", \"run governor\", \"build brief\", \"what keeps breaking\" — or any model wants the standing manager's view before making structural changes. Runs automatically every 12h / 2000 events / 150 errors; this row is the manual fire. ARGS: mode — empty = full run (model + email + iMessage) · dry = digest JSON only, no model call, no delivery EX: [GOVERNOR_RUN][/GOVERNOR_RUN]   or   GET /api/dispatch?invoke=GOVERNOR_RUN&body=dry"},{"key":"IMESSAGE_SEND","type":"http","category":"phone","target":"POST https://agent.miscsubjects.com/imessage/send","planner_rank":20,"docs":"WHAT: Send an iMessage as the Mac Messages.app Apple ID (native identity, not Blooio). WHEN_TO_USE: text someone as the owner's iPhone/Mac identity. ARGS: $1 = handle (phone or email), $2 = text EX: [IMESSAGE_SEND]redacted|hello[/IMESSAGE_SEND]"},{"key":"article:outreach-machinery","type":"article","category":"articles","target":"/api/articles/outreach-machinery","planner_rank":100,"docs":"8,584 organisations discovered, 680 with verified addresses, 11 drafts, 5 emails sent: the outreach pipeline and every gate in it","human":"/a/outreach-machinery","edit":"/admin/articles/outreach-machinery","object":"/api/directory/article:outreach-machinery"},{"key":"article:what-this-site-sells","type":"article","category":"articles","target":"/api/articles/what-this-site-sells","planner_rank":100,"docs":"Proven work, the offer: send one case by email, get the deliverable back with its complete checkable record","human":"/a/what-this-site-sells","edit":"/admin/articles/what-this-site-sells","object":"/api/directory/article:what-this-site-sells"},{"key":"article:one-loop","type":"article","category":"articles","target":"/api/articles/one-loop","planner_rank":100,"docs":"An AI built a capability, tested it, found who needed it, and emailed them — the receipt for each of the six steps","human":"/a/one-loop","edit":"/admin/articles/one-loop","object":"/api/directory/article:one-loop"},{"key":"article:cloudflare-os-email","type":"article","category":"articles","target":"/api/articles/cloudflare-os-email","planner_rank":100,"docs":"Cloudflare email is three products, not one mail stack","human":"/a/cloudflare-os-email","edit":"/admin/articles/cloudflare-os-email","object":"/api/directory/article:cloudflare-os-email"}]}