Developers

ChatGPT App Integration Guide

Last updated September 14, 2026

Overview

TheBayStayHomes — AI-assisted vacation-rental operations for property owners and hosts. The application exposes a Model Context Protocol (MCP) server so a host can connect an AI assistant such as ChatGPT and ask operational questions about their own properties. This page is the reference for anyone wiring an OpenAI Apps SDK layer on top of that backend. It contains no secrets.

1. MCP server

  • Endpoint: https://thebaystayhomes.com/mcp
  • Transport: MCP Streamable HTTP (POST, JSON-RPC)
  • Protected-resource metadata: https://thebaystayhomes.com/.well-known/oauth-protected-resource
  • Requests without a valid bearer token receive HTTP 401.

2. OAuth authorization flow

OAuth 2.1 with PKCE. The application is the resource server; the authorization server is the project's managed authentication service, discovered from the protected-resource metadata above. Dynamic client registration is supported, so a compatible client can register itself.

  1. Client fetches protected-resource metadata and discovers the authorization server.
  2. Client registers dynamically (or uses a pre-registered client id).
  3. Client starts an authorization request with PKCE.
  4. The host signs in (email or Google) and lands on the consent screen at https://thebaystayhomes.com/.lovable/oauth/consent, which names the client and states what it can read and change.
  5. On approval the client exchanges the code for an access token and refresh token.
  6. Every MCP call sends Authorization: Bearer <access token>.

3. Scopes and permissions

There are no granular OAuth scopes. Approval grants the fixed permission set below, and the server re-checks it on every single call:

  • The token must be an OAuth client token issued by this authorization server.
  • The account must be an authorised host of this application.
  • Read access is limited to the seven read tools listed below.
  • Write access is limited to the status field of a direct booking request.
  • No SQL, no arbitrary queries, no deletes, no financial edits, no message sending.

4. Tool reference

ToolTypeInputsReturns
get_today_operations
One snapshot of today: arrivals, departures, same-day turnovers, cleanings, cleanings needing confirmation, open stay requests, booking requests awaiting a decision.
Readproperty (optional)date, arrivals_today[], departures_today[], same_day_turnovers[], cleanings_today[], cleanings_needing_confirmation[], open_stay_requests[], booking_requests_awaiting_decision[]
list_calendar
Reservations across Airbnb, Vrbo and direct bookings for a date range.
Readstart_date, end_date (optional, default today → +90d), property, booking_source (airbnb | vrbo | direct)property, check_in, check_out, nights, booking_source, status, guest_first_name, same_day_turnover
list_cleanings
Scheduled cleanings and turnovers.
Readstart_date, end_date (optional), property, cleanercleaning_date, property, cleaner, checkout_source, departing_guest_first_name, next_check_in, gap_days, turnover
list_unconfirmed_cleanings
Near-term cleanings that still need confirming with the cleaner.
Readdays (optional, default 7), propertycleaning_date, property, cleaner, needs_attention_because, next_check_in
list_stay_requests
Early check-in, late check-out and luggage drop-off requests from guests.
Readstart_date, end_date, property, status, kind (all optional)id, kind, status, property, guest_first_name, requested_date, requested_time, guest_message, host_notes
get_availability
Open and booked date ranges for one property.
Readproperty, start_date, end_date (all required)available[], booked[], first_available_night
list_booking_requests
Direct booking requests awaiting host review.
Readdays (optional, default 90), status, propertyid, status, property, guest_first_name, check_in, check_out, party_size, guest_note, received_at
list_bookings
Legacy alias of list_booking_requests, kept so existing connections keep working.
ReadSame as list_booking_requestsSame as list_booking_requests
update_booking_status
Set the status of one direct booking request.
Writeid (required), status: new | confirmed | declined | cancelled (required), host_notes (optional)The updated booking request row

Property values are slugs: whale-away, bay-watch, beautiful-home-wakefield, stylish-condo-wakefield. Dates are YYYY-MM-DD.

5. Read vs write classification

  • Read (safe, idempotent): get_today_operations, list_calendar, list_cleanings, list_unconfirmed_cleanings, list_stay_requests, get_availability, list_booking_requests, list_bookings.
  • Write (requires host confirmation in the conversation): update_booking_status.

6. Example calls

Today's operations:

{ "name": "get_today_operations", "arguments": {} }

{
  "date": "2026-09-14",
  "arrivals_today": [
    { "property": "Bay Watch", "guest_first_name": "Seth",
      "booking_source": "Vrbo", "nights": 6, "check_out": "2026-09-20" }
  ],
  "departures_today": [],
  "same_day_turnovers": [],
  "cleanings_today": [],
  "open_stay_requests": [],
  "booking_requests_awaiting_decision": []
}

Calendar for a range:

{ "name": "list_calendar",
  "arguments": { "start_date": "2026-10-01", "end_date": "2026-10-31",
                 "property": "whale-away" } }

{
  "range": { "start_date": "2026-10-01", "end_date": "2026-10-31" },
  "reservations": [
    { "property": "Whale Away", "check_in": "2026-10-03", "check_out": "2026-10-07",
      "nights": 4, "booking_source": "Airbnb", "status": "booked",
      "guest_first_name": "Kathleen", "same_day_turnover": false }
  ]
}

Availability:

{ "name": "get_availability",
  "arguments": { "property": "bay-watch",
                 "start_date": "2026-11-01", "end_date": "2026-11-30" } }

{
  "property": "bay-watch",
  "available": [ { "from": "2026-11-01", "to": "2026-11-12" } ],
  "booked": [ { "from": "2026-11-12", "to": "2026-11-16", "booking_source": "Vrbo" } ],
  "first_available_night": "2026-11-01"
}

Write action:

{ "name": "update_booking_status",
  "arguments": { "id": "6f1c...-uuid", "status": "confirmed",
                 "host_notes": "Called guest, dates agreed." } }

{ "booking_request": { "id": "6f1c...-uuid", "property_slug": "bay-watch",
    "check_in": "2026-08-01", "check_out": "2026-08-07", "status": "confirmed" } }

7. Authentication requirements

  • Bearer token on every request; unauthenticated calls return 401.
  • Copied browser session tokens are rejected — the token must carry an OAuth client claim from the authorization server.
  • Every tool resolves the signed-in host server-side and re-checks host authorisation before touching any data. Ids supplied by the client are never trusted for authorisation; they are only used to locate a record the host is already allowed to reach.
  • Output filtering is applied server-side: guest email addresses, phone numbers, payouts, reservation codes and payment details are not returned to any tool caller.
  • Internal errors are logged server-side; clients receive short, generic messages.

8. Policy links

9. Notes for an Apps SDK layer

  • Start broad questions with get_today_operations; fall back to the narrow tools when the host names a date range or one property.
  • Treat update_booking_status as a confirmation-gated action: restate the property, guest and dates before calling it.
  • The backend is currently provisioned for a single host account. A per-host data scope is applied in one shared server-side guard, which is where multi-tenant filtering will be enforced before a second host is onboarded.