Skip to content

Repository files navigation

Linq Resy Agent

A Resy reservation agent accessible via iMessage. Text the bot to search restaurants, check availability, and book tables — all through natural conversation.

Built on Linq Blue and powered by Claude (Anthropic).

What it does

  • Search restaurants — find places on Resy by name, cuisine, or location
  • Check availability — see open time slots for any date and party size
  • Book tables — make real Resy reservations via text
  • Manage reservations — view upcoming bookings and cancel when needed
  • Natural conversation — Claude handles the back-and-forth, remembers context

Architecture

User ──iMessage──▶ Linq Blue ──webhook──▶ linq-resy-agent ──▶ Claude (tool-use loop)
                                               │                    │
                                               │     ◀── tools ◀────┘
                                               │     resy_search
                                               │     resy_find_slots
                                               │     resy_book
                                               │     resy_cancel
                                               │     resy_reservations
                                               ▼
User ◀─iMessage── Linq Blue ◀───API──── Response

Quick Start

Prerequisites

Setup

npm install
cp .env.example .env

Edit .env and fill in your keys. For RESY_AUTH_TOKEN:

  1. Go to resy.com and sign in
  2. Open DevTools (F12) → Network tab
  3. Click around to trigger any API request to api.resy.com
  4. Copy the x-resy-auth-token header value

Run

npm run dev

# In another terminal
ngrok http 3000

Set your ngrok URL as the webhook in your Linq Blue dashboard.

Project Structure

src/
├── index.ts              # Express server, webhook handler, orchestration
├── auth/                 # Magic link onboarding, credential encryption
│   ├── routes.ts         # /auth/setup page and credential submission
│   ├── encryption.ts     # AES-256-GCM credential encryption
│   ├── magicLink.ts      # Token generation and verification
│   ├── db.ts             # In-memory user/credential store
│   └── userContext.ts    # Load credentials per request (env fallback)
├── claude/
│   └── client.ts         # Claude API, system prompt, Resy tool definitions
├── bookings/
│   ├── client.ts         # Resy API client (search, slots, book, cancel)
│   ├── types.ts          # Resy type definitions
│   └── index.ts          # Barrel export
├── linq/
│   └── client.ts         # Linq Blue API (send messages, reactions, effects)
├── state/
│   └── conversation.ts   # Conversation history and user profiles (in-memory)
├── utils/
│   └── redact.ts         # Phone number redaction for logs
└── webhook/
    ├── handler.ts        # Webhook processing and phone filtering
    └── types.ts          # Webhook event types

Auth Modes

Dev mode — Set RESY_AUTH_TOKEN in .env and all users share your Resy account. No onboarding needed.

SMS OTP (default) — Users verify via Resy's native SMS OTP flow. Text the bot → receive a code → verify with your account email → connected. No manual token copying needed.

Inline JWT — Power users can paste their x-resy-auth-token directly (starts with eyJ...). Useful when SMS is rate-limited.

All credentials are encrypted (AES-256-GCM) and stored per-user.

Resy Tools

Tool Description
resy_search Search restaurants by keyword and location
resy_find_slots Find available time slots for a venue/date/party size
resy_book Book a reservation using a config token
resy_cancel Cancel a reservation using a resy token
resy_reservations List upcoming reservations
resy_profile Get user's Resy profile (name, email, member info)
resy_sign_out Disconnect Resy account and clear credentials

Deployment

Docker

docker build -t linq-resy-agent .
docker run -p 3000:3000 --env-file .env linq-resy-agent

Also supports Railway, Fly.io, and Heroku (Procfile included).

Built with

  • Linq Blue — iMessage/RCS messaging API
  • Claude (Anthropic) — AI reasoning with tool use
  • Resy — Restaurant reservation platform

License

MIT

About

A Resy reservation agent accessible via iMessage. Built on Linq Blue and Claude.

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages