Inspiration

In many languages "have you eaten?" is how people say they care. When the person you care about lives in another city or country, you cannot put a bowl of soup in front of them.

What exists today is a gift card or a coupon app. It takes the money at once, works at one chain in one country, and the money is gone if the gift is never used. The sender also has to know the shops, the menu and often the language.

What it does

Have You Eaten? lets someone far away buy a person they care about a meal at a neighbourhood shop near that person.

  • The sender writes one sentence: "My mom in Busan has a cold, get her something warm tonight." An errand agent looks up shops near her, picks a dish and writes the card in her language.
  • PayPal holds the money (an order with intent AUTHORIZE) and takes none of it.
  • The recipient gets a link with the card, the dish and a code. She never sees a price. A host agent talks to her in her language. It can change the dish within what is held, pass on a thank-you, or take a polite no.
  • At the shop's counter she shows the code. A till agent takes exactly the price of what she ate with a final capture, which releases the rest of the hold, and pays the shop with a PayPal payout.
  • If the treat is declined, cancelled or not used in three days, the hold is voided and nothing is taken.
  • Other people's AI assistants can use the same desk over MCP: find_treats, send_treat, treat_status.

Every amount and every yes-or-no about money is decided in code, not by a model. After each settlement the code reads the order back from PayPal, and the page says "Confirmed with PayPal" only from that reading.

It runs on the PayPal sandbox, with 11 fictional shops in five cities.

How we built it

  • One Next.js app (React, TypeScript) on the PayPal sandbox.
  • PayPal: Orders v2 with intent AUTHORIZE, authorize, a final capture of part of the authorisation, void, and Payouts. Every read of an order goes through the PayPal Agent Toolkit's get_order. The other calls are plain REST.
  • Three agents (errand, host, till) share one tool loop. The model is Claude Haiku 5.5 through the Claude API (Anthropic's SDK); an OpenAI-compatible endpoint works too.
  • The rules are pure functions in lib/rules.ts. Each tool call of an agent passes through them before PayPal is called.
  • An MCP endpoint with three tools, and AG Grid for the ledger.
  • Menu prices are in the shop's own currency. The dollar price comes from a fixed exchange-rate table dated 2026-11-12, because PayPal does not support every local currency.

Challenges we ran into

  • Taking only what was eaten. The hold is larger than the dish, so the recipient has room to choose something else. At the counter a capture with final_capture: true takes the price and releases the rest. This had to be seen on the real sandbox before building on it.
  • A sandbox checkout needs a person to approve it in a browser. The automated end-to-end check therefore runs on a stand-in for PayPal that follows the same order states, and the real sandbox is checked with two scripts in which a person approves.
  • Deciding what the model may decide. It chooses a dish and writes words. It never sets an amount: the tools that take money have no arguments, and code refuses any step the rules do not allow.
  • Keeping the price from the recipient. The host agent is never given a price, so it cannot mention one.
  • PayPal does not support the Korean won, so orders are in US dollars and each dish is converted at a dated rate, rounded up to a cent.

Accomplishments that we're proud of

  • One whole treat on the real PayPal sandbox (2026-11-12, with the scripted stand-in as the model): $14.00 was held after a sandbox buyer approved; the recipient changed abalone porridge to vegetable porridge; at the counter $6.74 was captured, the authorisation closed and the other $7.26 was released; a payout of $6.74 to the shop account was accepted.
  • A model cannot serve a treat by saying so. In the end-to-end check, a till model that pays the shop first, never takes the payment and then reports "served" serves nothing, and no shop is paid.
  • A capture whose answer is lost is still found, because code reads PayPal back after every settlement, and the shop is paid once.
  • With the real model on the real sandbox: the errand agent chose abalone porridge for a mother with a cold and wrote the card in Korean, the host agent changed it to vegetable porridge when she said she cannot eat seafood, and the till agent took $6.74 of the $14.00 held and paid the shop. An 18-check eval passes, at about $0.001 of model cost per treat.

What we learned

  • A final capture of part of an authorisation closes it. On the sandbox, after $2.10 of a $5.00 hold was captured with final_capture: true, the order showed the authorisation as CAPTURED with a captured amount of 2.10.
  • A payout is accepted first and settled later. The sandbox answered PENDING, then PROCESSING. A ledger has to show that status, not a plain yes.
  • A payment agent is safest with narrow tools that take no amounts, and with PayPal's record trusted over the model's account of it.
  • A language model suits the part a far-away sender cannot do: choosing from a menu in another country and writing the card in another language. It does not suit arithmetic and limits.

What's next

  • A database, so treats outlive a restart.
  • Real shops, each with its own PayPal account and a sign-in for the counter screen.
  • Live exchange rates, payouts in the shop's own currency, and PayPal's fees.
  • Refunds for a treat that went wrong.
  • More cities.

Built With

Share this project:

Updates

Submission history