@fortrip/agent-contract 4.3.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -30
- package/dist/index.js +111 -72
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1068,6 +1068,9 @@ interface FlagSpec {
|
|
|
1068
1068
|
type: "string" | "number" | "boolean";
|
|
1069
1069
|
/** Given once per item; its field is a list. */
|
|
1070
1070
|
multiple?: boolean;
|
|
1071
|
+
/** The command runs without it though the tool needs its field:
|
|
1072
|
+
* `orders cancel` without `--max-penalty` cancels nothing. */
|
|
1073
|
+
optional?: boolean;
|
|
1071
1074
|
/** What a `boolean` flag sends when its field isn't boolean:
|
|
1072
1075
|
* `--rooms` sends `include: "rooms"`. */
|
|
1073
1076
|
value?: string;
|
|
@@ -2259,7 +2262,6 @@ declare const hotel: z.ZodObject<{
|
|
|
2259
2262
|
}, z.core.$strip>;
|
|
2260
2263
|
type Hotel = z.infer<typeof hotel>;
|
|
2261
2264
|
|
|
2262
|
-
/** What the rate includes to eat; `known: false` leaves the rest null. */
|
|
2263
2265
|
declare const meals: z.ZodObject<{
|
|
2264
2266
|
known: z.ZodBoolean;
|
|
2265
2267
|
included: z.ZodNullable<z.ZodArray<z.ZodType<(string & {}) | "breakfast" | "lunch" | "dinner", unknown, z.core.$ZodTypeInternals<(string & {}) | "breakfast" | "lunch" | "dinner", unknown>>>>;
|
|
@@ -2271,7 +2273,6 @@ declare const meals: z.ZodObject<{
|
|
|
2271
2273
|
locale: z.ZodNullable<z.ZodType<"en" | "zh" | (string & {}), unknown, z.core.$ZodTypeInternals<"en" | "zh" | (string & {}), unknown>>>;
|
|
2272
2274
|
}, z.core.$strip>>;
|
|
2273
2275
|
}, z.core.$strip>;
|
|
2274
|
-
/** Fees paid at the property, in its currency, not converted. */
|
|
2275
2276
|
declare const payAtProperty: z.ZodObject<{
|
|
2276
2277
|
disclosure: z.ZodType<(string & {}) | "complete" | "incomplete", unknown, z.core.$ZodTypeInternals<(string & {}) | "complete" | "incomplete", unknown>>;
|
|
2277
2278
|
items: z.ZodArray<z.ZodObject<{
|
|
@@ -2285,7 +2286,6 @@ declare const payAtProperty: z.ZodObject<{
|
|
|
2285
2286
|
collectedAt: z.ZodType<"unknown" | (string & {}) | "property", unknown, z.core.$ZodTypeInternals<"unknown" | (string & {}) | "property", unknown>>;
|
|
2286
2287
|
}, z.core.$strip>>;
|
|
2287
2288
|
}, z.core.$strip>;
|
|
2288
|
-
/** The cancellation terms read at `asOf`. */
|
|
2289
2289
|
declare const cancellation: z.ZodObject<{
|
|
2290
2290
|
status: z.ZodType<"unknown" | (string & {}) | "free" | "partial_penalty" | "non_refundable", unknown, z.core.$ZodTypeInternals<"unknown" | (string & {}) | "free" | "partial_penalty" | "non_refundable", unknown>>;
|
|
2291
2291
|
asOf: z.ZodString;
|
|
@@ -2373,7 +2373,6 @@ declare const offer: z.ZodObject<{
|
|
|
2373
2373
|
}, z.core.$strip>;
|
|
2374
2374
|
}, z.core.$strip>;
|
|
2375
2375
|
type Offer = z.infer<typeof offer>;
|
|
2376
|
-
/** How many offers each selection step removed (§9.3). */
|
|
2377
2376
|
declare const omitted: z.ZodObject<{
|
|
2378
2377
|
byNationality: z.ZodNumber;
|
|
2379
2378
|
byFilters: z.ZodNumber;
|
|
@@ -2676,9 +2675,6 @@ declare const order: z.ZodObject<{
|
|
|
2676
2675
|
chargeCurrency: z.ZodString;
|
|
2677
2676
|
localCurrencyAtCheckout: z.ZodBoolean;
|
|
2678
2677
|
localCharge: z.ZodNullable<z.ZodType<Money, unknown, z.core.$ZodTypeInternals<Money, unknown>>>;
|
|
2679
|
-
/** The ways to pay other than `url`, while the order can be paid that
|
|
2680
|
-
* way: a `com.stripe.payments` handler takes a shared payment token
|
|
2681
|
-
* through `pay_order`. Empty when there is none. */
|
|
2682
2678
|
handlers: z.ZodArray<z.ZodObject<{
|
|
2683
2679
|
id: z.ZodString;
|
|
2684
2680
|
type: z.ZodString;
|
|
@@ -2694,18 +2690,11 @@ declare const order: z.ZodObject<{
|
|
|
2694
2690
|
business_profile: z.ZodString;
|
|
2695
2691
|
}, z.core.$strip>;
|
|
2696
2692
|
}, z.core.$strip>>;
|
|
2697
|
-
/** What a payment credential for `pay_order` must allow, with
|
|
2698
|
-
* `handlers`: at least `maxAmount`, in minor units (cents) of
|
|
2699
|
-
* `currency`, lowercase as Stripe takes it, and valid until at least
|
|
2700
|
-
* `expiresAt`, past which the order can't be paid. `null` when
|
|
2701
|
-
* `handlers` is empty. */
|
|
2702
2693
|
credentialLimits: z.ZodNullable<z.ZodObject<{
|
|
2703
2694
|
maxAmount: z.ZodNumber;
|
|
2704
2695
|
currency: z.ZodString;
|
|
2705
2696
|
expiresAt: z.ZodString;
|
|
2706
2697
|
}, z.core.$strip>>;
|
|
2707
|
-
/** Paying with Alipay or WeChat Pay through `pay_order`'s `method`.
|
|
2708
|
-
* `null` when it is neither offered for the order nor open on it. */
|
|
2709
2698
|
wallets: z.ZodNullable<z.ZodObject<{
|
|
2710
2699
|
open: z.ZodBoolean;
|
|
2711
2700
|
current: z.ZodNullable<z.ZodType<(string & {}) | "wechat_pay" | "alipay", unknown, z.core.$ZodTypeInternals<(string & {}) | "wechat_pay" | "alipay", unknown>>>;
|
|
@@ -2719,9 +2708,6 @@ declare const order: z.ZodObject<{
|
|
|
2719
2708
|
}, z.core.$strip>>;
|
|
2720
2709
|
}, z.core.$strip>>;
|
|
2721
2710
|
}, z.core.$strip>;
|
|
2722
|
-
/** Whether the user can cancel the order now and, when they can, its
|
|
2723
|
-
* penalty under the accepted terms (read a minute ahead) and the refund,
|
|
2724
|
-
* what was paid less the penalty, both in the charge currency. */
|
|
2725
2711
|
cancel: z.ZodObject<{
|
|
2726
2712
|
available: z.ZodBoolean;
|
|
2727
2713
|
reason: z.ZodType<(string & {}) | "non_refundable" | "needs_attention" | "cancellable" | "already_cancelled" | "in_progress" | "not_confirmed" | "stay_started" | "refused" | "terms_unknown", unknown, z.core.$ZodTypeInternals<(string & {}) | "non_refundable" | "needs_attention" | "cancellable" | "already_cancelled" | "in_progress" | "not_confirmed" | "stay_started" | "refused" | "terms_unknown", unknown>>;
|
|
@@ -2875,9 +2861,6 @@ declare const orderList: z.ZodObject<{
|
|
|
2875
2861
|
chargeCurrency: z.ZodString;
|
|
2876
2862
|
localCurrencyAtCheckout: z.ZodBoolean;
|
|
2877
2863
|
localCharge: z.ZodNullable<z.ZodType<Money, unknown, z.core.$ZodTypeInternals<Money, unknown>>>;
|
|
2878
|
-
/** The ways to pay other than `url`, while the order can be paid that
|
|
2879
|
-
* way: a `com.stripe.payments` handler takes a shared payment token
|
|
2880
|
-
* through `pay_order`. Empty when there is none. */
|
|
2881
2864
|
handlers: z.ZodArray<z.ZodObject<{
|
|
2882
2865
|
id: z.ZodString;
|
|
2883
2866
|
type: z.ZodString;
|
|
@@ -2893,18 +2876,11 @@ declare const orderList: z.ZodObject<{
|
|
|
2893
2876
|
business_profile: z.ZodString;
|
|
2894
2877
|
}, z.core.$strip>;
|
|
2895
2878
|
}, z.core.$strip>>;
|
|
2896
|
-
/** What a payment credential for `pay_order` must allow, with
|
|
2897
|
-
* `handlers`: at least `maxAmount`, in minor units (cents) of
|
|
2898
|
-
* `currency`, lowercase as Stripe takes it, and valid until at least
|
|
2899
|
-
* `expiresAt`, past which the order can't be paid. `null` when
|
|
2900
|
-
* `handlers` is empty. */
|
|
2901
2879
|
credentialLimits: z.ZodNullable<z.ZodObject<{
|
|
2902
2880
|
maxAmount: z.ZodNumber;
|
|
2903
2881
|
currency: z.ZodString;
|
|
2904
2882
|
expiresAt: z.ZodString;
|
|
2905
2883
|
}, z.core.$strip>>;
|
|
2906
|
-
/** Paying with Alipay or WeChat Pay through `pay_order`'s `method`.
|
|
2907
|
-
* `null` when it is neither offered for the order nor open on it. */
|
|
2908
2884
|
wallets: z.ZodNullable<z.ZodObject<{
|
|
2909
2885
|
open: z.ZodBoolean;
|
|
2910
2886
|
current: z.ZodNullable<z.ZodType<(string & {}) | "wechat_pay" | "alipay", unknown, z.core.$ZodTypeInternals<(string & {}) | "wechat_pay" | "alipay", unknown>>>;
|
|
@@ -2918,9 +2894,6 @@ declare const orderList: z.ZodObject<{
|
|
|
2918
2894
|
}, z.core.$strip>>;
|
|
2919
2895
|
}, z.core.$strip>>;
|
|
2920
2896
|
}, z.core.$strip>;
|
|
2921
|
-
/** Whether the user can cancel the order now and, when they can, its
|
|
2922
|
-
* penalty under the accepted terms (read a minute ahead) and the refund,
|
|
2923
|
-
* what was paid less the penalty, both in the charge currency. */
|
|
2924
2897
|
cancel: z.ZodObject<{
|
|
2925
2898
|
available: z.ZodBoolean;
|
|
2926
2899
|
reason: z.ZodType<(string & {}) | "non_refundable" | "needs_attention" | "cancellable" | "already_cancelled" | "in_progress" | "not_confirmed" | "stay_started" | "refused" | "terms_unknown", unknown, z.core.$ZodTypeInternals<(string & {}) | "non_refundable" | "needs_attention" | "cancellable" | "already_cancelled" | "in_progress" | "not_confirmed" | "stay_started" | "refused" | "terms_unknown", unknown>>;
|
package/dist/index.js
CHANGED
|
@@ -333,7 +333,7 @@ var destination = z5.discriminatedUnion(
|
|
|
333
333
|
countryCode: countryCode.describe("ISO 3166-1 alpha-2 country, e.g. JP.")
|
|
334
334
|
}),
|
|
335
335
|
strictInput({
|
|
336
|
-
kind: z5.literal("locality", { error: "kind must be locality" }).describe("A locality
|
|
336
|
+
kind: z5.literal("locality", { error: "kind must be locality" }).describe("A locality listed in an earlier search response."),
|
|
337
337
|
placeId: placeId.describe("placeId of the locality."),
|
|
338
338
|
radiusMeters
|
|
339
339
|
})
|
|
@@ -580,7 +580,7 @@ var maximumPenaltyError = "maximumPenalty must be a number of 0 or more: the ord
|
|
|
580
580
|
var cancelOrderInput = strictInput({
|
|
581
581
|
orderId: orderId.describe("The orderId of the order to cancel."),
|
|
582
582
|
maximumPenalty: z5.number({ error: maximumPenaltyError }).min(0, { error: maximumPenaltyError }).describe(
|
|
583
|
-
`The penalty the user agreed to
|
|
583
|
+
`The penalty the user agreed to: a JSON number equal to the order's cancel.penalty.amount, e.g. 120.5 for "120.50".`
|
|
584
584
|
)
|
|
585
585
|
});
|
|
586
586
|
var sharedPaymentTokenRe = /^spt_[A-Za-z0-9]{1,250}$/;
|
|
@@ -962,6 +962,7 @@ var cancelFlags = flagsOf(cancelOrderInput, [
|
|
|
962
962
|
flag: "max-penalty",
|
|
963
963
|
field: "maximumPenalty",
|
|
964
964
|
type: "number",
|
|
965
|
+
optional: true,
|
|
965
966
|
placeholder: "<amount>",
|
|
966
967
|
description: "The penalty the user agreed to, exactly as `orders get` shows it, in the order's currency, e.g. `12.50`. Without it, the command cancels nothing: it shows the penalty and the refund."
|
|
967
968
|
}
|
|
@@ -972,7 +973,7 @@ var payFlags = flagsOf(payOrderInput, [
|
|
|
972
973
|
field: "sharedPaymentToken",
|
|
973
974
|
type: "string",
|
|
974
975
|
placeholder: "<spt_\u2026>",
|
|
975
|
-
description: "Required unless --wallet. The spt_\u2026 token the user's Link wallet issued for this order."
|
|
976
|
+
description: "Required unless --wallet. The spt_\u2026 token the user's Link wallet issued for this order. For agents that can request a token from the user's Link wallet; people pay by the order's link or --wallet."
|
|
976
977
|
},
|
|
977
978
|
{
|
|
978
979
|
flag: "wallet",
|
|
@@ -1051,7 +1052,7 @@ var COMMANDS = [
|
|
|
1051
1052
|
{
|
|
1052
1053
|
group: "orders",
|
|
1053
1054
|
name: "cancel",
|
|
1054
|
-
summary: "
|
|
1055
|
+
summary: "Without --max-penalty it shows the penalty and refund and cancels nothing; with the penalty the user agreed to, it cancels the order under its terms",
|
|
1055
1056
|
tool: "cancel_order",
|
|
1056
1057
|
flags: cancelFlags,
|
|
1057
1058
|
positionals: [positional(cancelOrderInput, "orderId")]
|
|
@@ -1059,7 +1060,7 @@ var COMMANDS = [
|
|
|
1059
1060
|
{
|
|
1060
1061
|
group: "orders",
|
|
1061
1062
|
name: "pay",
|
|
1062
|
-
summary: "Pay an order with a Link
|
|
1063
|
+
summary: "Pay an order with a Link token (US and Canada) or with Alipay or WeChat Pay, instead of its payment link",
|
|
1063
1064
|
tool: "pay_order",
|
|
1064
1065
|
flags: payFlags,
|
|
1065
1066
|
positionals: [positional(payOrderInput, "orderId")]
|
|
@@ -1259,16 +1260,16 @@ function strictify(schema) {
|
|
|
1259
1260
|
// src/guide-data.generated.ts
|
|
1260
1261
|
var FRAGMENTS = {
|
|
1261
1262
|
"booking": "{{#if claude-skill cli}}\n## Ordering\n\n{{/if}}\n- Call `{{tool:hotels book}}` only for the offer the user picked, with at least one guest per room{{#if claude-skill cli}}, named as the user gave them{{/if}}; never invent guests.{{#if claude-skill cli}} Room 1 is the offer's first room, and a room takes no more guests than it sleeps.{{/if}}\n- Guest names: Latin letters as on the passport (M\xFCller \u2192 Mueller), first and last name 1\u2013{{limit:guestName}} characters each{{#if cli}}, as `--guest 1:John:Smith` (room 1, first name, last name){{/if}}.\n{{#if claude-skill cli}}\n- The contact's first and last name (up to {{limit:contactFirstName}} characters each), email and phone (with its country code) are all required. Special requests must be in English and aren't guaranteed.\n{{/if}}\n- `{{tool:hotels book}}` can take about two minutes{{#if cli}}: allow the command at least 3 minutes{{/if}}. If it times out, {{#if cli}}run it again with identical flags{{/if}}{{#if mcp claude-skill}}call it again with the same details{{/if}}: it returns the same order.\n{{#if mcp}}\n- On `offer_changed`, show the user every change and ask again before ordering the new offer.\n{{/if}}\n{{#if cli}}\n- `{{tool:hotels book}}` takes only these fields: a `--body` with any other field (such as `nationality`) is rejected with exit 2.\n{{/if}}\n",
|
|
1262
|
-
"errors": "{{#if claude-skill cli}}\n## Errors\n\n{{#if claude-skill}}A tool error{{/if}}{{#if cli}}An error on stderr{{/if}} carries `code`, `message` and `retryable`, and `retryAfterSeconds` when waiting helps; many carry `details`. Search errors are under Search. Ordering errors:\n\n| `code` | Do this |\n|---|---|\n| `offer_changed` (409) | The price or terms changed since the offer: `changes` lists every change (`worse` says which are worse for the user) and `offer` is the new offer. Show the user every change and ask again; if they still want it, order the new offer, and confirm the new order before giving its link |\n| `offer_expired` (409) | Get offers again and let the user choose again |\n| `offer_unavailable` (422) | The offer is sold out or was refused: get offers again and let the user choose again |\n| `order_in_progress` (409) | The same order is still being created: wait `retryAfterSeconds`, then {{#if claude-skill}}call again with the same details{{/if}}{{#if cli}}run the command again with identical flags{{/if}} |\n| `offer_already_ordered` (409) | This offer was already ordered with other details: show that order (`orderId`) instead. An offer is ordered once |\n| `order_exists` (409) | This stay already has an open order for one of these guests (`orderId`, `status`): show it instead of ordering again. A party with none of its guests can order the stay from a new offer (get offers again), and so can the user once the stay's order is confirmed, cancelled or refused by the hotel. It also answers when the stay's earlier order failed at the hotel with its outcome unknown, or the stay has had {{limit:ordersPerStay}} orders; for those, the user emails {{support}} |\n| `order_attempts_exhausted` (409) | This order can't be tried again: the user emails {{support}} with its `reference` |\n| `order_removed` (410) | The order was never completed and no payment is held: get offers again and order the new offer (the order keeps its `orderId`) |\n| `stay_unsupported` (422) | `mixed_occupancy`: order once per party; `max_nights`: at most `max` nights per order |\n| `stay_in_past` (422) | Check-in has passed in the hotel's time zone: ask for new dates |\n| `ordering_paused` (503) | Ordering is paused on Fortrip's side: tell the user, and try again only after `retryAfterSeconds`
|
|
1263
|
+
"errors": "{{#if claude-skill cli}}\n## Errors\n\n{{#if claude-skill}}A tool error{{/if}}{{#if cli}}An error on stderr{{/if}} carries `code`, `message` and `retryable`, and `retryAfterSeconds` when waiting helps; many carry `details`. Search errors are under Search. Ordering errors:\n\n| `code` | Do this |\n|---|---|\n| `offer_changed` (409) | The price or terms changed since the offer: `changes` lists every change (`worse` says which are worse for the user) and `offer` is the new offer. Show the user every change and ask again; if they still want it, order the new offer, and confirm the new order before giving its link |\n| `offer_expired` (409) | Get offers again and let the user choose again |\n| `offer_unavailable` (422) | The offer is sold out or was refused: get offers again and let the user choose again |\n| `order_in_progress` (409) | The same order is still being created: wait `retryAfterSeconds`, then {{#if claude-skill}}call again with the same details{{/if}}{{#if cli}}run the command again with identical flags{{/if}} |\n| `offer_already_ordered` (409) | This offer was already ordered with other details: show that order (`orderId`) instead. An offer is ordered once |\n| `order_exists` (409) | This stay already has an open order for one of these guests (`orderId`, `status`): show it instead of ordering again. A party with none of its guests can order the stay from a new offer (get offers again), and so can the user once the stay's order is confirmed, cancelled or refused by the hotel. It also answers when the stay's earlier order failed at the hotel with its outcome unknown, or the stay has had {{limit:ordersPerStay}} orders; for those, the user emails {{support}} |\n| `order_attempts_exhausted` (409) | This order can't be tried again: the user emails {{support}} with its `reference` |\n| `order_removed` (410) | The order was never completed and no payment is held: get offers again and order the new offer (the order keeps its `orderId`) |\n| `stay_unsupported` (422) | `mixed_occupancy`: order once per party; `max_nights`: at most `max` nights per order |\n| `stay_in_past` (422) | Check-in has passed in the hotel's time zone: ask for new dates |\n| `ordering_paused` (503) | Ordering is paused on Fortrip's side: tell the user, and try again only after `retryAfterSeconds` |\n\nAny code:\n\n- `invalid_request` (400): `details.issues` lists each bad field; fix them. For amenities, `details.filterable` lists those that can filter.\n- `cursor_invalid` (400): the page is gone; search again from the first page.\n- `not_found` (404): no such hotel, or no such order for this user.\n- `rate_limited` (429): wait `retryAfterSeconds`, then retry once.\n- `service_unavailable` (503) and `supplier_unavailable` (503 or 504): wait `retryAfterSeconds`, then retry once with the same details; if it fails again, tell the user.\n- Any other code: read `message`. If `retryable` is true, wait `retryAfterSeconds` and retry once; otherwise tell the user instead of guessing.\n{{/if}}\n",
|
|
1263
1264
|
"meals": '{{#if claude-skill cli}}\n## Presenting an offer\n\nGive the user, for each offer:\n\n- the room (`room.name`, beds, size) and the total, as above;\n- the meals: `meals.included` (breakfast, lunch, dinner) or `allInclusive`, with `guestsCoveredPerRoom`. Fewer than the guests per room means not everyone gets the meals (breakfast for 1 with 2 adults in the room): say who is covered. `unspecifiedMainMeals` counts main meals the hotel didn\'t name. With `known: false`, the meals are unknown: say so, and don\'t call it room only;\n- cancellation: `status` (`free`, `partial_penalty`, `non_refundable` or `unknown`), `freeCancellationEndsAt` (null with `free`: free until check-in) and the `penalties`. Times are in UTC: also give them in the hotel\'s `timeZone`;\n- confirmation: `mode` `instant` or `on_request` (within `withinMinutes`);\n- fees payable at the property (`payAtProperty.items`), in the property\'s currency. `disclosure: "incomplete"` means there can be fees not listed: say so.\n\nAn offer expires at `expiresAt`, about 30 minutes after it was made; after that, get offers again.\n\n"Not listed" is not "no": `listed: false` (amenities, policies, rooms), `null` and `unknown` mean the source didn\'t say. Tell the user it\'s unknown instead of turning it into "no".\n{{/if}}\n{{#if mcp}}\n- "Not listed" or "unknown" is not "no".\n{{/if}}\n',
|
|
1264
1265
|
"occupancy": "{{#if claude-skill cli}}\n## Rooms and guests\n\n- {{#if mcp claude-skill}}`stay.rooms` lists each room's party as `{ adults, childrenAges }`: two rooms of 2 adults, one with a child of 6, is `[{ adults: 2, childrenAges: [6] }, { adults: 2, childrenAges: [] }]`{{/if}}{{#if cli}}`--room <adults[:age,\u2026]>`, once per room, gives each room's party: two rooms of 2 adults, one with a child of 6, is `--room 2:6 --room 2`{{/if}}.\n- Ask each child's age; offers need it.\n- If the party doesn't split evenly across the rooms (3 adults in 2 rooms), ask the user how it splits.\n{{/if}}\n- Offers and orders take one party per call, every room the same: for different parties, order once per party.{{#if claude-skill cli}} `{{tool:hotels offers}}` answers `stay_unsupported` (`mixed_occupancy`) for mixed rooms; `{{tool:hotels search}}` accepts them but prices only from the dates, with the note `party_split_required`.{{/if}}\n{{#if claude-skill cli}}\n- Limits: 1\u2013{{limit:rooms}} rooms, 1\u2013{{limit:adultsPerRoom}} adults and 0\u2013{{limit:childrenPerRoom}} children (aged 0\u2013{{limit:childAgeMax}}) per room, 1\u2013{{limit:nightsSupplier}} nights, up to {{limit:offersHotels}} hotels per `{{tool:hotels offers}}` call. A longer stay answers `stay_unsupported` (`max_nights`): ask the user whether to split it into consecutive stays, each its own order.\n{{/if}}\n",
|
|
1265
|
-
"order": '{{#if claude-skill cli}}\n## Workflow\n\n1. **Search** with `{{tool:hotels search}}` for candidate hotels: a destination, `{{arg:text}}` or both, and the stay\'s dates and rooms for indicative prices.\n{{#if cli}}\n\n ```bash\n {{tool:hotels search}} --place-name Bangkok --country TH --check-in 2026-11-10 \\\n --check-out 2026-11-12 --room 2 --stars-min 4 --sort price_asc --limit 10\n ```\n\n{{/if}}\n2. **Details** (optional) with `{{tool:hotels get}}`, when the user asks about a hotel or a stated preference needs evidence (a pool, a policy, room size). For a details-only question, call it directly when you know the hotel\'s `hotelId`; otherwise find the hotel with `{{tool:hotels search}}`.\n{{#if cli}}\n\n ```bash\n {{tool:hotels get}} <hotelId> [--rooms]\n ```\n\n{{/if}}\n3. **Offers** with `{{tool:hotels offers}}` for a few shortlisted hotels, with the dates and rooms the user will order. It takes about 15 seconds. A hotel is available only once this returns an offer for it.\n{{#if cli}}\n\n ```bash\n {{tool:hotels offers}} --hotel <hotelId> --hotel <hotelId> --check-in 2026-11-10 \\\n --check-out 2026-11-12 --room 2 --room 2 [--require-free-cancellation]\n ```\n\n{{/if}}\n4. **Order** with `{{tool:hotels book}}`, once the user has picked one offer and given the guests and the contact (see Ordering).\n{{#if cli}}\n\n ```bash\n {{tool:hotels book}} --offer <offerId> --guest 1:John:Smith --guest 2:Mary:Smith \\\n --first-name John --last-name Smith --email john@example.com \\\n --phone "+8613800000000"\n ```\n\n{{/if}}\n5. **Confirm, then give the payment link**, as in "Before giving the payment link" below.\n6. **After payment**, check the order with `{{tool:orders get}}` (see After payment).\n\n## Search\n\n### Where\n\n- **A place by name:** {{#if mcp claude-skill}}`{ kind: "place_name", name, countryCode }`{{/if}}{{#if cli}}`--place-name <name> --country <CC>`{{/if}}, in any language (Kyoto or \u4EAC\u90FD). The country is required: ask the user when it isn\'t clear. Names match exactly, ignoring only case and spacing: accents, hyphens, apostrophes and periods count ("K\xF6ln" or "Cologne", not "Koln"; "St. Moritz", not "St Moritz").\n- If several places bear the name, the answer is `destination_ambiguous` with up to {{limit:candidatesShown}} candidates and their hotel counts: ask the user which one they mean, then search it by its `placeId`; never pick one yourself.\n- `destination_not_found` with `no_match` means no place of that name in that country: check the spelling and accents, or try another name for the place. Its `nameAsText` counts the hotels that a `{{arg:text}}` search for the name would find.\n- **A place from an earlier answer:** {{#if mcp claude-skill}}`{ kind: "place", placeId }`{{/if}}{{#if cli}}`--place <placeId>`{{/if}}.\n- **Near a point:** {{#if mcp claude-skill}}`{ kind: "point", location: { lat, lng } }`{{/if}}{{#if cli}}`--point <lat,lng>`{{/if}}, for "near X" when you know where X is.\n- **A whole country:** {{#if mcp claude-skill}}`{ kind: "country", countryCode }`{{/if}}{{#if cli}}`--country-only <CC>`{{/if}}, as for the Maldives.\n- Countries, regions (states, provinces), prefecture-level cities in China and main islands cover their whole area. Towns, neighbourhoods, districts, small islands and points cover a circle of {{limit:radiusMetersDefault}} meters; `{{arg:destination.radiusMeters}}` sets another, up to {{limit:radiusMetersMax}} meters, and narrows an area to a circle around its center.\n- **Localities:** an area search lists its `localities`, the towns its hotels belong to, each with a `placeId`, its hotel `count` and the places it `includes` (Patong is part of Phuket). To search one, pass it as {{#if mcp claude-skill}}`{ kind: "locality", placeId }`{{/if}}{{#if cli}}`--locality <placeId>`{{/if}}. A town that isn\'t a locality answers `destination_not_found` with `not_a_locality` and
|
|
1266
|
+
"order": '{{#if claude-skill cli}}\n## Workflow\n\n1. **Search** with `{{tool:hotels search}}` for candidate hotels: a destination, `{{arg:text}}` or both, and the stay\'s dates and rooms for indicative prices.\n{{#if cli}}\n\n ```bash\n {{tool:hotels search}} --place-name Bangkok --country TH --check-in 2026-11-10 \\\n --check-out 2026-11-12 --room 2 --stars-min 4 --sort price_asc --limit 10\n ```\n\n{{/if}}\n2. **Details** (optional) with `{{tool:hotels get}}`, when the user asks about a hotel or a stated preference needs evidence (a pool, a policy, room size). For a details-only question, call it directly when you know the hotel\'s `hotelId`; otherwise find the hotel with `{{tool:hotels search}}`.\n{{#if cli}}\n\n ```bash\n {{tool:hotels get}} <hotelId> [--rooms]\n ```\n\n{{/if}}\n3. **Offers** with `{{tool:hotels offers}}` for a few shortlisted hotels, with the dates and rooms the user will order. It takes about 15 seconds. A hotel is available only once this returns an offer for it.\n{{#if cli}}\n\n ```bash\n {{tool:hotels offers}} --hotel <hotelId> --hotel <hotelId> --check-in 2026-11-10 \\\n --check-out 2026-11-12 --room 2 --room 2 [--require-free-cancellation]\n ```\n\n{{/if}}\n4. **Order** with `{{tool:hotels book}}`, once the user has picked one offer and given the guests and the contact (see Ordering).\n{{#if cli}}\n\n ```bash\n {{tool:hotels book}} --offer <offerId> --guest 1:John:Smith --guest 2:Mary:Smith \\\n --first-name John --last-name Smith --email john@example.com \\\n --phone "+8613800000000"\n ```\n\n{{/if}}\n5. **Confirm, then give the payment link**, as in "Before giving the payment link" below.\n6. **After payment**, check the order with `{{tool:orders get}}` (see After payment).\n\n## Search\n\n### Where\n\n- **A place by name:** {{#if mcp claude-skill}}`{ kind: "place_name", name, countryCode }`{{/if}}{{#if cli}}`--place-name <name> --country <CC>`{{/if}}, in any language (Kyoto or \u4EAC\u90FD). The country is required: ask the user when it isn\'t clear. Names match exactly, ignoring only case and spacing: accents, hyphens, apostrophes and periods count ("K\xF6ln" or "Cologne", not "Koln"; "St. Moritz", not "St Moritz").\n- If several places bear the name, the answer is `destination_ambiguous` with up to {{limit:candidatesShown}} candidates and their hotel counts: ask the user which one they mean, then search it by its `placeId`; never pick one yourself.\n- `destination_not_found` with `no_match` means no place of that name in that country: check the spelling and accents, or try another name for the place. Its `nameAsText` counts the hotels that a `{{arg:text}}` search for the name would find.\n- **A place from an earlier answer:** {{#if mcp claude-skill}}`{ kind: "place", placeId }`{{/if}}{{#if cli}}`--place <placeId>`{{/if}}.\n- **Near a point:** {{#if mcp claude-skill}}`{ kind: "point", location: { lat, lng } }`{{/if}}{{#if cli}}`--point <lat,lng>`{{/if}}, for "near X" when you know where X is.\n- **A whole country:** {{#if mcp claude-skill}}`{ kind: "country", countryCode }`{{/if}}{{#if cli}}`--country-only <CC>`{{/if}}, as for the Maldives.\n- Countries, regions (states, provinces), prefecture-level cities in China and main islands cover their whole area. Towns, neighbourhoods, districts, small islands and points cover a circle of {{limit:radiusMetersDefault}} meters; `{{arg:destination.radiusMeters}}` sets another, up to {{limit:radiusMetersMax}} meters, and narrows an area to a circle around its center.\n- **Localities:** an area search lists its `localities`, the towns its hotels belong to, each with a `placeId`, its hotel `count` and the places it `includes` (Patong is part of Phuket). To search one, pass it as {{#if mcp claude-skill}}`{ kind: "locality", placeId }`{{/if}}{{#if cli}}`--locality <placeId>`{{/if}}. A town that isn\'t a locality answers `destination_not_found` with `not_a_locality` and, in `hub`, the locality it belongs to: search that locality, or the town itself with {{#if mcp claude-skill}}`kind: "place"`{{/if}}{{#if cli}}`--place`{{/if}} for a circle around it.\n- A price sort or price filter over more than {{limit:poolLimit}} hotels (in an area, or for text alone) answers `search_too_broad` with `matched` and the top `localities`: show them and ask the user which they prefer, unless the request already names one of them; search that one by its `placeId` as a locality, never by its name.\n\n### Text\n\n`{{arg:text}}` matches exact words in hotel names and addresses, in Chinese or English:\n\n- Every word must match as written: plurals, accents, spacing and abbreviations count ("hostel" and "hostels", "St Regis" and "Saint Regis" find different hotels). Hyphens and apostrophes don\'t (Ritz-Carlton finds Ritz Carlton).\n- In Chinese, matching follows word segmentation, so part of a name can match unrelated hotels (\u5E0C\u5C14 is not \u5E0C\u5C14\u987F).\n- Use only distinctive words: a hotel or brand name, a district or a landmark. Not "hotel", "near", "cheap" or "best".\n- Typos return nothing: "Shangahi" finds no hotel.\n- Place names belong in the destination: "Maldives" as text finds a hotel named Maldives in China.\n\n### Filters\n\n- Stars run from 1 to 5 in half steps{{#if mcp claude-skill}} (`filters.stars`){{/if}}. "4 stars" as {{#if mcp claude-skill}}`{ min: 4, max: 4 }`{{/if}}{{#if cli}}`--stars-min 4 --stars-max 4`{{/if}} leaves out 4.5: unless the user means exactly 4, use {{#if mcp claude-skill}}`{ min: 4 }`{{/if}}{{#if cli}}`--stars-min 4`{{/if}} or ask. Unrated hotels are left out whenever stars are filtered.\n- `{{arg:filters.amenities}}` takes only the amenities that can filter (such as pool, parking, wifi); others, such as gym or spa, show in `{{tool:hotels get}}` but can\'t filter. A hotel matches only when it lists the amenity, and about half the hotels list no amenities at all (`coverage.excludedNoFacilityData` counts those left out): "not listed" is not "absent".\n- `{{arg:filters.price.maxPerRoomNight}}` bounds the indicative price per room per night, in USD; hotels without one are left out and counted.\n\n### Results\n\n- `notes` explain the answer (a limited pool, a circle around an island, more hotels just outside it): pass on what matters to the user.\n- `coverage` has the counts: `matched` hotels, how many were priced and how many have a price.\n- A next page is {{#if mcp claude-skill}}`cursor` set to `nextCursor` and, optionally, `limit`{{/if}}{{#if cli}}`--cursor <nextCursor>` and, optionally, `--limit`{{/if}}; nothing else.\n{{/if}}\n{{#if mcp}}\n- A place name needs its `countryCode` (ask the user if unclear) and matches exactly (accents and periods count). On `destination_ambiguous`, ask the user which they mean, then search its `placeId`; never pick one yourself.\n- On `search_too_broad`, show its `localities` and ask the user which, unless they already named one; search it as `{ kind: "locality", placeId }`, never by name.\n- `text` matches whole words of hotel names and addresses: use a distinctive name, brand or landmark.\n{{/if}}\n',
|
|
1266
1267
|
"payment-link": "{{#if claude-skill cli}}\n## Before giving the payment link\n\n`{{tool:hotels book}}` answers with an unpaid order: `status` `awaiting_payment`, its `reference` (the support number), `price.total`, the stay and its terms, and `payment.url`, a Fortrip page that recaps the order and continues to payment on Stripe. Nothing is charged until the user pays.\n\n1. Show the order's total and currency, the stay (hotel, room, dates, rooms and guests per room) and every term: meals, cancellation (status, deadline, penalties) and fees payable at the property, unknowns included.\n2. End that reply by asking the user to confirm, and wait for a clear yes. Urgency is not consent.\n3. Then give `payment.url` exactly as returned: don't shorten, rebuild or re-encode it.\n\n{{/if}}\n{{#if mcp}}\n- Pay one way only: give `payment.url` or call `{{tool:orders pay}}`. First show the order's total and currency, the stay and every term, end that reply by asking the user to confirm, and wait for a clear yes. Then give `payment.url` exactly as returned, to this user only: anyone holding it can pay.\n{{/if}}\n{{#if claude-skill cli}}\n- `payment.url` works like a payment credential: anyone holding it can pay. Give it to this user only, never in shared channels, documents, logs or tickets. With `requiresSignIn: true` (an order started on the Fortrip website), the user signs in to pay.\n- The link expires at `payment.expiresAt`; the order is then `expired`. To order the stay again, get offers again, and confirm the new order with the user before giving its link.\n- Another order of the stay (another party, or a corrected guest name) needs a new offer: get offers again. When it replaces an unpaid order, tell the user to pay only the new link; the earlier one expires unpaid.\n- An order `awaiting_payment` whose `payment.url` is null had its link unreadable this time: read it again with `{{tool:orders get}}`.\n{{/if}}\n- Never ask for, accept or pass on payment card details; payment happens only through Stripe.{{#if claude-skill cli}} A card number in a guest name, the contact or the special requests is rejected{{#if cli}} with exit 2{{/if}}.{{/if}}\n{{#if claude-skill cli}}\n\n## Paying without the link\n\nAn order whose `payment.handlers` isn't empty (in {{#if claude-skill}}a result's text{{/if}}{{#if cli}}the text output{{/if}}, the line \"Pay without the link\") can also be paid through `{{tool:orders pay}}` with a Stripe shared payment token that the user's Link wallet grants for it. Use it only if you have a tool that can request such a token from the user's Link wallet: Link is for US and Canadian accounts, and caps a spend request at ${{limit:tokenPaymentMaxUsd}}, so `payment.handlers` is empty for a larger order. Otherwise give `payment.url`, and never ask the user to create, type or paste a token.\n\n1. Show the user the order's total and currency, the stay (hotel, room, dates, rooms and guests per room) and every term: meals, cancellation and fees payable at the property. End that reply by asking the user to confirm, and wait for a clear yes. The token comes from the user's wallet, never from card details.\n2. Request the token from the user's Link wallet with the handler's `config.business_profile` and `payment.credentialLimits`: `maxAmount` (in cents), `currency` and `expiresAt`.\n3. {{#if claude-skill}}Call{{/if}}{{#if cli}}Run{{/if}} `{{tool:orders pay}}` with the token and the order's `price.total`{{#if cli}} (`--token`, `--total`){{/if}}{{#if claude-skill}}, the token as `sharedPaymentToken` or in UCP's `payment.instruments`{{/if}}. The order is then `confirming`, its payment `authorized`: check it as after payment.\n\nThe charge is in USD: a card in another currency may add a foreign transaction fee. Pay one way only: either give `payment.url` or {{#if claude-skill}}call{{/if}}{{#if cli}}run{{/if}} `{{tool:orders pay}}`. Once `{{tool:orders pay}}` succeeds, `payment.url` stops working; a payment that fails leaves the link open. `payment_total_changed` means the total sent isn't the order's (`details.total`); the order's total hasn't changed: confirm it with the user, then {{#if claude-skill}}call{{/if}}{{#if cli}}run{{/if}} `{{tool:orders pay}}` again with it and the same token. `payment_declined`: the user picks another payment method in their wallet, or pays by link. `payment_action_required`: the card needs a verification this can't give: pay by link. `payment_credential_invalid`: request a new token with the order's `payment.credentialLimits`. `service_unavailable`: call `{{tool:orders pay}}` again with the same token, never a new one. A token pays one order only.\n\n## Paying with Alipay or WeChat Pay\n\nAn order whose result text has the line \"Pay with Alipay or WeChat Pay\" can be paid in the user's Alipay or WeChat wallet, with no token: it is for users who have a mainland-China wallet. {{#if claude-skill}}Call{{/if}}{{#if cli}}Run{{/if}} `{{tool:orders pay}}` {{#if claude-skill}}with `method` `alipay_wechat_pay`{{/if}}{{#if cli}}the way that line shows{{/if}} and the order's `price.total`, only after the user has confirmed.\n\n1. Show the user the order's total in USD, the stay (hotel, room, dates, rooms and guests per room) and every term: meals, cancellation and fees payable at the property. End that reply by asking the user to confirm, and wait for a clear yes. Pay one way only: `payment.url` or this.\n2. Then show `payment.wallets`: the WeChat Pay code as an image if you can, and both links (WeChat Pay and Alipay). The user pays once, by either. Alipay and WeChat Pay charge at once; if the hotel can't confirm, the payment is refunded in full. The total is in US dollars, and the wallets show it in yuan at their rate.\n3. Check the order with `{{tool:orders get}}` until it isn't `awaiting_payment`.\n\nA WeChat Pay code expires {{limit:wechatCodeMinutes}} minutes after it is made, and goes dead earlier if the user opens the Alipay link instead. Then `payment.wallets.wechatPay.qrData` is null: tell the user to open the WeChat link again, or {{#if claude-skill}}call{{/if}}{{#if cli}}run{{/if}} `{{tool:orders pay}}` again for a new code.\n\nWeChat can't scan a code shown on the same phone's screen. Offer both ways, since you can't tell which device the user is on: save the image and scan it from the album (WeChat, then Scan, then Album), or open the WeChat link on another screen; on a phone, the Alipay link opens the Alipay app.\n\n## After payment\n\nCheck the order with `{{tool:orders get}}`:\n\n- `confirming` while the hotel confirms, then `confirmed` with the hotel's `confirmationNumber`.\n- `failed`: no stay was booked; `payment.status` says whether the payment was released or refunded.\n- `needs_attention`: Fortrip is looking into it; the user can email {{support}} with the `reference`.\n- `manageUrl` is the user's own page for the order.\n{{/if}}\n",
|
|
1267
1268
|
"planning": "# Planning a hotel stay\n\nRead this when the request is more than one hotel for fixed dates: flexible dates, a budget, split stays, several destinations, or \"find me the best\". The rules in {{#if mcp}}the server instructions{{/if}}{{#if claude-skill}}SKILL.md{{/if}}{{#if cli}}`{{tool:guide}}`{{/if}} still apply (call order, destinations, one party per offer and order, confirming the order `{{tool:hotels book}}` returns before giving the payment link); this covers what to ask, how to compare and how to present.{{#if cli}} As there, `fortrip` is short for `npx -y fortrip@latest`.{{/if}}\n\n## What to collect\n\nKeep track of: dates (or the flexible window), nights, destination(s) with their country, rooms and the guests in each room, room constraints (beds, connecting rooms, accessibility), budget, and what the user said matters most (cheapest, most flexible, closest to X).\n\nOffers and orders take one party per call, every room the same, so if the party doesn't split evenly across the rooms, ask how it splits. Rooms for different parties are priced and ordered separately, each order with its own payment link.\n\nAsk only for what changes which hotels qualify or how they rank. \"4 stars\" as {{#if mcp claude-skill}}`{ min: 4, max: 4 }`{{/if}}{{#if cli}}`--stars-min 4 --stars-max 4`{{/if}} leaves out 4.5: unless the user means exactly 4, use {{#if mcp claude-skill}}`{ min: 4 }`{{/if}}{{#if cli}}`--stars-min 4`{{/if}} or ask. If children come along, ask each child's age; `{{tool:hotels offers}}` needs it. Don't ask for trip type or style: infer it from the conversation or leave it general. When a place name is ambiguous, ask which place the user means.\n\n## Evidence\n\n- A `{{tool:hotels search}}` price is an indicative estimate per room per night, not a quote. Never call a search result available or bookable, and once you have offers, compare offers only. A hotel without a search price can still have offers.\n- Use `{{tool:hotels get}}` only when a stated preference needs evidence (a pool, a policy, room size). An amenity or policy it doesn't list is unknown, not absent.\n- A hotel is available only once `{{tool:hotels offers}}` returned an offer for it.\n- Anything {{#if mcp claude-skill}}the tools{{/if}}{{#if cli}}the CLI{{/if}} didn't return, such as reviews, style, price trends or exchange rates other than `approx`, is unknown. Say so instead of filling it in.\n\n## Ranking\n\n1. Drop options that break a hard constraint (dates, guests, budget cap, required facility). Compare a budget in the unit the user gave it: per night, per room or for the whole stay. An offer's `price.total` covers the whole stay and every room, in USD.\n2. Keep only options with a live offer.\n3. Order by the user's stated main goal. Goals they didn't state don't count.\n4. Use other preferences only to break ties.\n\nUse the cheapest comparable offer as the baseline unless the user fixed the room type. Show at most three plans, each with its price difference from the baseline and what it trades off (meals, cancellation, location, confirmation). Keep hotel names as returned and dates in the user's notation.\n\nFor a split stay or several destinations, price each leg with its own `{{tool:hotels offers}}` call and add up the legs. Each leg is a separate `{{tool:hotels book}}` call, with its own confirmation and its own payment link.\n\n## Stop and say so\n\n- `{{tool:hotels offers}}` covers up to {{limit:offersHotels}} hotels per call and takes about 15 seconds, and its offers expire after about 30 minutes. If the request needs more hotels or date combinations than a few calls can cover, narrow it with the user, or present the result as a comparison of the hotels you priced, not the best overall.\n- When a search is too broad to price, show its localities and ask the user which they prefer, unless the request already names one of them; never pick one yourself.\n- Urgency is not consent. Call `{{tool:hotels book}}` only for the offer the user picked, and give its payment link only after the user confirms the total, currency, stay and terms of the order `{{tool:hotels book}}` returned.\n",
|
|
1268
1269
|
"presentation": "{{#if claude-skill}}\n## Presenting hotels\n\nIf your interface can show rich elements, show each hotel as a card with only what Fortrip's tools returned for it in this conversation: photo, name, stars, region and price, and once you have offers every term that changes the choice (meals and who they cover, cancellation, fees payable at the property, confirmation), an unknown one as unknown. Label a search's `price.fromPerRoomNight` as an estimate per room-night and an offer's `price.total` as the whole stay for all rooms, in USD, and draw a map only from returned `location` coordinates. Offer the choices you need to ask anyway (dates, a locality, which offer) as options to pick. Otherwise use a short list. Keep hotel names as returned, and never invent photos, ratings, reviews, prices, terms or coordinates.\n{{/if}}\n",
|
|
1269
1270
|
"prices": "{{#if claude-skill cli}}\n## Prices and currency\n\n- A search price (`price.fromPerRoomNight`) is indicative and not bookable: the lowest price of one unit (a room or, at a hostel, possibly a bed) per night, for any party and often any date, and it can be well above or below the offers. Call it an estimate, quote `{{tool:hotels offers}}` prices, and never call a search result available or bookable. `price: null` means there is no indicative price, not that the hotel is full; about half the hotels have none for given dates.\n{{/if}}\n{{#if mcp}}\n- Search prices are indicative, not bookable: quote `{{tool:hotels offers}}` prices.\n{{/if}}\n- {{#if claude-skill cli}}In an offer or order, {{/if}}`price.total` is the whole stay for all rooms and is what is charged, in USD for offers and the orders made from them.{{#if claude-skill cli}} `perNightAllRooms` is the total per night; to compare with a per-room budget, also divide by the rooms.{{/if}} Stripe's page may let the user pay in their card's local currency at Stripe's rate{{#if claude-skill cli}} (Adaptive Pricing): say so plainly, and that the USD total is the price{{/if}}. `approx`{{#if claude-skill cli}}, in `{{arg:displayCurrency}}`, with its `rateDate`,{{/if}} is an estimate, never the charge.\n{{#if claude-skill cli}}\n- `{{arg:displayCurrency}}`{{#if cli}} (or `FORTRIP_DISPLAY_CURRENCY`){{/if}} is `USD` or `CNY`: `CNY` adds `approx` in yuan to suit a user who thinks in it. It never changes the charge.\n- Fees payable at the property (`payAtProperty`) are separate, in the property's own currency, not converted.\n- After payment, `payment.localCharge` is what the card paid in its own currency. Orders made on the Fortrip website can be charged in another currency: `payment.chargeCurrency` says which.\n{{/if}}\n",
|
|
1270
1271
|
"scope": "{{#if claude-skill cli}}\n# Fortrip hotel stays\n\n{{/if}}\nFortrip: hotel search, live offers and orders with a payment link.{{#if claude-skill cli}} Not for flights, activities, or changing an existing order.{{/if}}\n\n{{#if mcp}}\nCall order: `{{tool:hotels search}}` \u2192 (optional) `{{tool:hotels get}}` \u2192 `{{tool:hotels offers}}` \u2192 `{{tool:hotels book}}`; after the user pays, `{{tool:orders get}}`; `{{tool:orders list}}` lists, `{{tool:orders cancel}}` cancels, `{{tool:orders pay}}` pays by token or Alipay/WeChat Pay. `{{tool:guide}}` returns Fortrip's guidance for flexible dates, budgets or several destinations.\n{{/if}}\n{{#if claude-skill}}\nThe tools are on Fortrip's MCP server, named `fortrip` in this plugin (a Fortrip connector added on claude.ai can show under its own name). They're written `fortrip:<tool>` below:\n{{/if}}\n{{#if cli}}\nThe `fortrip` CLI (npm package `fortrip`) calls Fortrip as the signed-in user and prints each answer as compact text (`--json` prints its JSON):\n{{/if}}\n{{#if claude-skill cli}}\n\n| {{#if claude-skill}}Tool{{/if}}{{#if cli}}Command{{/if}} | Returns |\n|---|---|\n| `{{tool:hotels search}}` | Hotels in a place, near a point or matching a name (`{{arg:text}}`), with indicative prices |\n| `{{tool:hotels get}}` | One hotel's address, check-in and check-out times, description, policies, amenities and rooms; no prices |\n| `{{tool:hotels offers}}` | Live offers (room, meals, total in USD, cancellation terms) for up to {{limit:offersHotels}} hotels |\n| `{{tool:hotels book}}` | An unpaid order for one offer, with its terms and a payment link |\n| `{{tool:orders get}}` | One order and its status, including whether the hotel confirmed it |\n| `{{tool:orders list}}` | The user's orders, newest first, including those made on the Fortrip website |\n| `{{tool:orders cancel}}` | Cancels an order under its terms, for the penalty the user agreed to, and refunds the rest |\n| `{{tool:orders pay}}` | Pays an order without its link, by a shared payment token from the user's wallet, or with Alipay or WeChat Pay |\n\nFor flexible dates, a budget, split stays, several destinations or \"find me the best\", {{#if claude-skill}}read [references/planning.md](references/planning.md){{/if}}{{#if cli}}also run `{{tool:guide}} planning`{{/if}} before searching.\n{{/if}}\n",
|
|
1271
|
-
"setup": "{{#if cli}}\n## Setup\n\nRun every command as `npx -y fortrip@latest <command>` (Node.js 22 or newer). The examples below shorten that to `fortrip`; `fortrip <command> --help` lists a command's flags. `{{tool:hotels search}}`, `{{tool:hotels offers}}` and `{{tool:hotels book}}` also take `--body '<json>'` (or `--body @file.json`), the raw request body; flags override its fields. Add `--json` to any command that calls Fortrip to get its answer as one line of JSON instead of text.\n\nWhen the user first asks about hotels, run `{{tool:whoami}}` before asking follow-up questions, so the sign-in can happen while they answer.\n\n{{/if}}\n{{#if claude-skill cli}}\n## Sign-in\n\n{{/if}}\nSign-in happens only in the browser. Never ask the user to paste a token.\n{{#if claude-skill}}\n\nIf none of these tools are available, Fortrip isn't connected: tell the user to add the Fortrip connector or plugin and sign in.\n{{/if}}\n{{#if mcp claude-skill}}\nIf a tool says the user isn't signed in, ask them to reconnect.\n{{/if}}\n{{#if cli}}\n\nIf a command exits with code **3** and stderr has `loginUrl`, show it to the user as a link together with `userCode`, e.g. \"Sign in to Fortrip: <loginUrl> (code <userCode>), then tell me when you're done.\" When they confirm, rerun the same command; it finishes the sign-in itself. Don't run `{{tool:login}}`: it waits for up to 10 minutes. Commands that exit 3 together share one `loginUrl`; show it once. If the rerun gives a different `loginUrl`, show that one.\n\nWhen Fortrip no longer accepts the saved sign-in (it was revoked, or it expired and couldn't be renewed), the command also exits 3 with a `loginUrl`; handle it the same way. The saved sign-in is kept until the user approves the new link.\n\nIn
|
|
1272
|
+
"setup": "{{#if cli}}\n## Setup\n\nRun every command as `npx -y fortrip@latest <command>` (Node.js 22 or newer). The examples below shorten that to `fortrip`; `fortrip <command> --help` lists a command's flags. `{{tool:hotels search}}`, `{{tool:hotels offers}}` and `{{tool:hotels book}}` also take `--body '<json>'` (or `--body @file.json`), the raw request body; flags override its fields. Add `--json` to any command that calls Fortrip to get its answer as one line of JSON instead of text.\n\nWhen the user first asks about hotels, run `{{tool:whoami}}` before asking follow-up questions, so the sign-in can happen while they answer.\n\n{{/if}}\n{{#if claude-skill cli}}\n## Sign-in\n\n{{/if}}\nSign-in happens only in the browser. Never ask the user to paste a token.\n{{#if claude-skill}}\n\nIf none of these tools are available, Fortrip isn't connected: tell the user to add the Fortrip connector or plugin and sign in.\n{{/if}}\n{{#if mcp claude-skill}}\nIf a tool says the user isn't signed in, ask them to reconnect.\n{{/if}}\n{{#if cli}}\n\nIf a command exits with code **3** and stderr has `loginUrl`, show it to the user as a link together with `userCode`, e.g. \"Sign in to Fortrip: <loginUrl> (code <userCode>), then tell me when you're done.\" When they confirm, rerun the same command; it finishes the sign-in itself. Don't run `{{tool:login}}`: it waits for up to 10 minutes. Commands that exit 3 together share one `loginUrl`; show it once. If the rerun gives a different `loginUrl`, show that one.\n\nWhen Fortrip no longer accepts the saved sign-in (it was revoked, or it expired and couldn't be renewed), the command also exits 3 with a `loginUrl`; handle it the same way. The saved sign-in is kept until the user approves the new link.\n\nIn a remote agent environment or a CI run without a browser, the user can set `FORTRIP_TOKEN` instead. Exit 3 with `tokenSource: \"FORTRIP_TOKEN\"` means Fortrip didn't accept that token: tell the user to replace or unset it.\n\n## Exit codes\n\n| Code | Meaning | What to do |\n|---|---|---|\n| 0 | Success; the answer on stdout | Continue |\n| 1 | Any other error: an error from Fortrip (see Errors), a network error or a timeout | Read the error on stderr. If `retryable` is true, wait `retryAfterSeconds` (or a few seconds) and retry once |\n| 2 | Invalid arguments, or `invalid_request` from Fortrip | Fix the flags; the error lists each bad field with a message |\n| 3 | Not signed in | Show `loginUrl` to the user, then rerun (above) |\n| 4 | Rate limited | Wait `retryAfterSeconds`, then retry once |\n\nOutput on stdout or stderr can carry `warning` (with `recoveryFile` when a sign-in couldn't be saved): pass it on to the user.\n{{/if}}\n",
|
|
1272
1273
|
"support": "{{#if claude-skill cli}}\n## Cancelling an order\n\n`{{tool:orders get}}` and `{{tool:orders list}}` say of each order whether the user can cancel it now (`cancel.available`), and then the penalty under its terms (`cancel.penalty`) and the refund, what was paid less the penalty (`cancel.refund`), both in the charge currency; otherwise `cancel.reason` says why not.\n\n1. Show the user the stay (hotel, dates), `cancel.penalty` and `cancel.refund` (amount and currency). A refund of 0 means nothing is paid back: say so plainly.\n2. End that reply by asking the user to confirm the cancellation, and wait for a clear yes.\n3. Then {{#if claude-skill}}call{{/if}}{{#if cli}}run{{/if}} `{{tool:orders cancel}}` with `{{arg:maximumPenalty}}` set to `cancel.penalty.amount` as shown. Never state a refund the order didn't return, and never choose or work out an amount yourself.\n\nThe order is then `cancelling`, and `cancelled` once the hotel has cancelled and the refund is issued: check it with `{{tool:orders get}}`. If the hotel refuses, the order is `confirmed` again with `cancel.reason` `refused`. `cancellation_changed` (409) means the penalty is now higher than the one the user agreed to: read the order again and ask the user again. `order_not_cancellable` (409) says why in `reason`.{{#if cli}} Without `--max-penalty`, `{{tool:orders cancel}}` cancels nothing: it prints the penalty and the refund and exits 2.{{/if}}\n\n## Changes and support\n\n{{/if}}\n{{#if mcp}}For changes{{/if}}{{#if claude-skill}}These tools can't change an order: for changes{{/if}}{{#if cli}}The CLI can't change an order: for changes{{/if}}, a cancellation that `{{tool:orders cancel}}` can't make, or other problems, the user emails {{support}} with the order's `reference` (never `payment.url`).\n"
|
|
1273
1274
|
};
|
|
1274
1275
|
|
|
@@ -1606,6 +1607,7 @@ var destination2 = openUnion("kind", [
|
|
|
1606
1607
|
})
|
|
1607
1608
|
]);
|
|
1608
1609
|
var count = z11.number().int();
|
|
1610
|
+
var hotels = (what) => count.nullable().describe(what);
|
|
1609
1611
|
var searchResult = openObject({
|
|
1610
1612
|
destination: destination2.nullable(),
|
|
1611
1613
|
text: openObject({
|
|
@@ -1626,17 +1628,31 @@ var searchResult = openObject({
|
|
|
1626
1628
|
"price_desc"
|
|
1627
1629
|
]),
|
|
1628
1630
|
coverage: openObject({
|
|
1629
|
-
matched: count
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1631
|
+
matched: count.describe(
|
|
1632
|
+
"Hotels that match the destination, the text and every filter but the price filter."
|
|
1633
|
+
),
|
|
1634
|
+
priced: hotels(
|
|
1635
|
+
"Hotels priced: those on this page, or with a price sort or price filter the whole priced set (pricing.scope); null without prices."
|
|
1636
|
+
),
|
|
1637
|
+
withPrice: hotels("Of those priced, how many have an indicative price; null when prices weren't asked for or are unavailable."),
|
|
1638
|
+
poolRadiusMeters: z11.number().nullable().describe(
|
|
1639
|
+
`When a price sort or price filter priced only the nearest ${LIMITS.poolLimit.toLocaleString("en-US")}: how far the farthest of them is from the center, in meters; otherwise null.`
|
|
1640
|
+
),
|
|
1641
|
+
excludedNoPrice: hotels("With a price filter: priced hotels left out for having no indicative price; otherwise null."),
|
|
1642
|
+
excludedNoFacilityData: hotels(
|
|
1643
|
+
"With an amenity filter: hotels left out for listing no facilities at all, though they may have the amenity; otherwise null."
|
|
1644
|
+
),
|
|
1645
|
+
withinMaxRadius: hotels(
|
|
1646
|
+
`For a radius under ${LIMITS.radiusMetersMax.toLocaleString("en-US")} m: how many would match within ${LIMITS.radiusMetersMax.toLocaleString("en-US")} m of the center; otherwise null.`
|
|
1647
|
+
),
|
|
1648
|
+
textAnywhere: hotels(
|
|
1649
|
+
"With text and a place: the hotels that match the text anywhere in the place's country; otherwise null."
|
|
1650
|
+
),
|
|
1651
|
+
localities: localities.nullable().describe("For an area: its top localities, the towns its matching hotels belong to; otherwise null."),
|
|
1652
|
+
nameAsText: hotels(
|
|
1653
|
+
"When a place_name search matched few hotels: how many in its country match the name as text; otherwise null."
|
|
1654
|
+
)
|
|
1655
|
+
}).describe("What the search covered: counts of hotels, each null when it doesn't apply."),
|
|
1640
1656
|
data: z11.array(hotelSummary),
|
|
1641
1657
|
nextCursor: z11.string().nullable().describe("Pass it back as cursor for the next page; null on the last page."),
|
|
1642
1658
|
notes: z11.array(
|
|
@@ -1722,11 +1738,17 @@ var hotel = openObject({
|
|
|
1722
1738
|
var meals = openObject({
|
|
1723
1739
|
known: z13.boolean(),
|
|
1724
1740
|
included: z13.array(openEnum(["breakfast", "lunch", "dinner"])).nullable(),
|
|
1725
|
-
unspecifiedMainMeals: z13.number().int().nullable()
|
|
1741
|
+
unspecifiedMainMeals: z13.number().int().nullable().describe(
|
|
1742
|
+
"Main meals a day beyond included that the rate doesn't name (e.g. 1 when a half-board rate doesn't say lunch or dinner); null when known is false."
|
|
1743
|
+
),
|
|
1726
1744
|
allInclusive: z13.boolean().nullable(),
|
|
1727
|
-
guestsCoveredPerRoom: z13.number().int().nullable()
|
|
1745
|
+
guestsCoveredPerRoom: z13.number().int().nullable().describe(
|
|
1746
|
+
"How many guests in each room the meals are for; fewer than the guests in the room means not everyone gets them. null when not stated."
|
|
1747
|
+
),
|
|
1728
1748
|
label: localizedText.nullable()
|
|
1729
|
-
})
|
|
1749
|
+
}).describe(
|
|
1750
|
+
"What the rate includes to eat. known false: the meals are unknown, not none, and included, unspecifiedMainMeals and allInclusive are null."
|
|
1751
|
+
);
|
|
1730
1752
|
var payAtProperty = openObject({
|
|
1731
1753
|
disclosure: openEnum(["complete", "incomplete"]),
|
|
1732
1754
|
items: z13.array(
|
|
@@ -1744,20 +1766,24 @@ var payAtProperty = openObject({
|
|
|
1744
1766
|
collectedAt: openEnum(["property", "unknown"])
|
|
1745
1767
|
})
|
|
1746
1768
|
)
|
|
1747
|
-
})
|
|
1769
|
+
}).describe(
|
|
1770
|
+
"Fees paid at the property, on top of price.total, in the property's currency, not converted. disclosure incomplete: there may be fees not listed."
|
|
1771
|
+
);
|
|
1748
1772
|
var cancellation = openObject({
|
|
1749
1773
|
status: openEnum(["free", "partial_penalty", "non_refundable", "unknown"]),
|
|
1750
|
-
asOf: instant,
|
|
1774
|
+
asOf: instant.describe("When these terms were read: status and penalties are as of this time."),
|
|
1751
1775
|
freeCancellationEndsAt: instant.nullable(),
|
|
1752
1776
|
penalties: z13.array(
|
|
1753
1777
|
openObject({ startsAt: instant.nullable(), amount: money })
|
|
1754
1778
|
),
|
|
1755
1779
|
timeZone: z13.string().nullable()
|
|
1756
|
-
});
|
|
1780
|
+
}).describe("The cancellation terms, read at asOf.");
|
|
1757
1781
|
var confirmation = openObject({
|
|
1758
|
-
mode: openEnum(["instant", "on_request", "unknown"])
|
|
1759
|
-
|
|
1760
|
-
|
|
1782
|
+
mode: openEnum(["instant", "on_request", "unknown"]).describe(
|
|
1783
|
+
"instant: the hotel confirms the booking as soon as it is made. on_request: the hotel confirms or refuses it later, within withinMinutes when stated. unknown: not stated."
|
|
1784
|
+
),
|
|
1785
|
+
withinMinutes: z13.number().int().nullable().describe("For on_request, the minutes the hotel takes to confirm; null when instant or not stated.")
|
|
1786
|
+
}).describe("How the hotel confirms a booking of this offer.");
|
|
1761
1787
|
var offer = openObject({
|
|
1762
1788
|
offerId,
|
|
1763
1789
|
type: openEnum(["hotel"]),
|
|
@@ -1770,7 +1796,9 @@ var offer = openObject({
|
|
|
1770
1796
|
}),
|
|
1771
1797
|
price: openObject({
|
|
1772
1798
|
total: money,
|
|
1773
|
-
perNightAllRooms: money
|
|
1799
|
+
perNightAllRooms: money.describe(
|
|
1800
|
+
"price.total divided by the nights: all rooms, one night. A search's fromPerRoomNight is for one room; divide by roomCount to compare."
|
|
1801
|
+
),
|
|
1774
1802
|
approx: openObject({
|
|
1775
1803
|
total: money,
|
|
1776
1804
|
perNightAllRooms: money,
|
|
@@ -1781,13 +1809,18 @@ var offer = openObject({
|
|
|
1781
1809
|
cancellation,
|
|
1782
1810
|
confirmation
|
|
1783
1811
|
});
|
|
1812
|
+
var removed = (step) => z13.number().int().describe(`Offers left out ${step}.`);
|
|
1784
1813
|
var omitted = openObject({
|
|
1785
|
-
byNationality:
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1814
|
+
byNationality: removed(
|
|
1815
|
+
"because the hotel sells them only to guests of some nationalities; Fortrip can't book them"
|
|
1816
|
+
),
|
|
1817
|
+
byFilters: removed("by filters"),
|
|
1818
|
+
dominated: removed(
|
|
1819
|
+
"because another offer of the same room is as good on price and every term, or can't be told apart from one kept"
|
|
1820
|
+
),
|
|
1821
|
+
unreadable: removed("because their details came back incomplete or inconsistent"),
|
|
1822
|
+
byLimit: removed("by limitPerHotel")
|
|
1823
|
+
}).describe("How many offers each selection step left out.");
|
|
1791
1824
|
var UNAVAILABLE_REASONS = [
|
|
1792
1825
|
"sold_out",
|
|
1793
1826
|
"no_matching_offers",
|
|
@@ -1809,7 +1842,9 @@ var hotelOffersResult = openObject({
|
|
|
1809
1842
|
unavailable: z13.array(
|
|
1810
1843
|
openObject({
|
|
1811
1844
|
hotelId,
|
|
1812
|
-
reason: openEnum(UNAVAILABLE_REASONS)
|
|
1845
|
+
reason: openEnum(UNAVAILABLE_REASONS).describe(
|
|
1846
|
+
"Why the hotel has no offers: sold_out (nothing left for the stay), no_matching_offers (the filters left none), nationality_restricted (the hotel sells this stay only to guests of some nationalities; Fortrip can't book it), offers_unreadable (its offers came back incomplete or inconsistent), not_found (Fortrip has no bookable hotel with this hotelId), supplier_unavailable (offers couldn't be fetched this time; try again), stay_in_past (check-in has passed in the hotel's time zone)."
|
|
1847
|
+
),
|
|
1813
1848
|
omitted: omitted.nullable()
|
|
1814
1849
|
})
|
|
1815
1850
|
)
|
|
@@ -1885,7 +1920,9 @@ var hotelItem = openObject({
|
|
|
1885
1920
|
beds: localizedText.nullable()
|
|
1886
1921
|
}),
|
|
1887
1922
|
meals,
|
|
1888
|
-
cancellation
|
|
1923
|
+
cancellation: cancellation.describe(
|
|
1924
|
+
"The terms the order was made on, read at asOf; cancel says whether it can be cancelled now."
|
|
1925
|
+
),
|
|
1889
1926
|
payAtProperty,
|
|
1890
1927
|
confirmationNumber: z14.string().nullable()
|
|
1891
1928
|
})
|
|
@@ -1893,32 +1930,36 @@ var hotelItem = openObject({
|
|
|
1893
1930
|
var order = openObject({
|
|
1894
1931
|
orderId,
|
|
1895
1932
|
reference: orderReference,
|
|
1896
|
-
status: openEnum(ORDER_STATUSES)
|
|
1933
|
+
status: openEnum(ORDER_STATUSES).describe(
|
|
1934
|
+
"awaiting_payment: unpaid, nothing charged; payable until payment.expiresAt. expired: not paid in time, nothing charged. confirming: paid or held, the booking is with the hotel. confirmed: the hotel confirmed and the payment is charged. failed: no stay was booked; payment.status says what became of the money. cancelling, then cancelled: a cancellation under the terms. needs_attention: a person at Fortrip has to resolve it."
|
|
1935
|
+
),
|
|
1897
1936
|
createdAt: instant,
|
|
1898
1937
|
updatedAt: instant,
|
|
1899
1938
|
items: z14.array(openUnion("type", [hotelItem])).min(1),
|
|
1900
|
-
price: openObject({
|
|
1939
|
+
price: openObject({
|
|
1940
|
+
total: money.describe(
|
|
1941
|
+
"The whole stay for all rooms, in payment.chargeCurrency: what paying charges, or once paid what was charged. Fees payable at the property are not in it."
|
|
1942
|
+
)
|
|
1943
|
+
}),
|
|
1901
1944
|
payment: openObject({
|
|
1902
1945
|
status: openEnum(PAYMENT_STATUSES),
|
|
1903
1946
|
url: z14.string().nullable().describe(
|
|
1904
1947
|
"The payment page, on fortrip.ai. With requiresSignIn false it continues to Stripe Checkout, and anyone holding it can pay; with requiresSignIn true (an order started on the Fortrip website) it continues to the Fortrip booking page, where only the signed-in owner can pay. null when the order isn't awaiting payment, or, while it is, when the link couldn't be read this time: read the order again."
|
|
1905
1948
|
),
|
|
1906
1949
|
requiresSignIn: z14.boolean(),
|
|
1907
|
-
expiresAt: instant.nullable()
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1950
|
+
expiresAt: instant.nullable().describe(
|
|
1951
|
+
"When the time to pay ends: an order unpaid by then expires, with nothing charged. null unless status is awaiting_payment."
|
|
1952
|
+
),
|
|
1953
|
+
chargeCurrency: z14.string().describe(
|
|
1954
|
+
"The currency the order is charged in: USD for an order made through the API; an order made on the Fortrip website may be in another."
|
|
1955
|
+
),
|
|
1956
|
+
localCurrencyAtCheckout: z14.boolean().describe(
|
|
1957
|
+
"Whether paying by url may charge the card in its own currency, converted by Stripe; false once paid by token, Alipay or WeChat Pay."
|
|
1958
|
+
),
|
|
1959
|
+
localCharge: money.nullable().describe("What the card was charged in its own currency, when Stripe converted the total; otherwise null."),
|
|
1914
1960
|
handlers: z14.array(paymentHandler).describe(
|
|
1915
|
-
|
|
1961
|
+
`The ways to pay other than url: a com.stripe.payments handler takes a Stripe shared payment token through pay_order. [] when a token can't pay the order: over $${LIMITS.tokenPaymentMaxUsd}, not charged in USD, an order started on the Fortrip website, a negotiated price, under ${LIMITS.payMinMinutesLeft} minutes left, ${LIMITS.tokensPerOrder} tokens tried, a token payment is under way, an Alipay or WeChat Pay payment is open, or token payment isn't offered for this order.`
|
|
1916
1962
|
),
|
|
1917
|
-
/** What a payment credential for `pay_order` must allow, with
|
|
1918
|
-
* `handlers`: at least `maxAmount`, in minor units (cents) of
|
|
1919
|
-
* `currency`, lowercase as Stripe takes it, and valid until at least
|
|
1920
|
-
* `expiresAt`, past which the order can't be paid. `null` when
|
|
1921
|
-
* `handlers` is empty. */
|
|
1922
1963
|
credentialLimits: openObject({
|
|
1923
1964
|
maxAmount: z14.number().int().describe("Request the token for at least this amount, in cents; a token that allows less can't pay."),
|
|
1924
1965
|
currency: z14.string().describe("The token's currency, lowercase as Stripe takes it: usd."),
|
|
@@ -1928,11 +1969,9 @@ var order = openObject({
|
|
|
1928
1969
|
}).nullable().describe(
|
|
1929
1970
|
"What the shared payment token for pay_order must allow. null exactly when handlers is []."
|
|
1930
1971
|
),
|
|
1931
|
-
/** Paying with Alipay or WeChat Pay through `pay_order`'s `method`.
|
|
1932
|
-
* `null` when it is neither offered for the order nor open on it. */
|
|
1933
1972
|
wallets: openObject({
|
|
1934
|
-
open: z14.boolean().describe("Whether pay_order has opened
|
|
1935
|
-
current: openEnum(["wechat_pay", "alipay"]).nullable().describe("
|
|
1973
|
+
open: z14.boolean().describe("Whether pay_order has opened an Alipay or WeChat Pay payment on this order."),
|
|
1974
|
+
current: openEnum(["wechat_pay", "alipay"]).nullable().describe("Which of the two the payment is on now; null until it is open."),
|
|
1936
1975
|
wechatPay: openObject({
|
|
1937
1976
|
qrData: z14.string().nullable().describe(
|
|
1938
1977
|
"The WeChat Pay code's content, to draw as a QR code; null when there is no live code (open wechatPay.url for one)."
|
|
@@ -1947,9 +1986,6 @@ var order = openObject({
|
|
|
1947
1986
|
"Paying with Alipay or WeChat Pay: pass method alipay_wechat_pay to pay_order to open it. null when the order can't be paid this way and none is open."
|
|
1948
1987
|
)
|
|
1949
1988
|
}),
|
|
1950
|
-
/** Whether the user can cancel the order now and, when they can, its
|
|
1951
|
-
* penalty under the accepted terms (read a minute ahead) and the refund,
|
|
1952
|
-
* what was paid less the penalty, both in the charge currency. */
|
|
1953
1989
|
cancel: openObject({
|
|
1954
1990
|
available: z14.boolean().describe("Whether the user can cancel the order now."),
|
|
1955
1991
|
reason: openEnum(CANCEL_REASONS).describe(
|
|
@@ -2246,7 +2282,7 @@ var READ_OWN = { ...READ, openWorldHint: false };
|
|
|
2246
2282
|
var TOOLS = [
|
|
2247
2283
|
{
|
|
2248
2284
|
name: "get_planning_guide",
|
|
2249
|
-
title: "
|
|
2285
|
+
title: "Planning guide",
|
|
2250
2286
|
description: `Returns Fortrip's planning guide for a request that is more than one hotel for fixed dates (flexible dates, a budget, split stays, several destinations, "find me the best"): what to ask the user, which results count as evidence, how to rank and how to present options.`,
|
|
2251
2287
|
annotations: READ_OWN,
|
|
2252
2288
|
input: null,
|
|
@@ -2262,7 +2298,7 @@ var TOOLS = [
|
|
|
2262
2298
|
},
|
|
2263
2299
|
{
|
|
2264
2300
|
name: "get_hotel",
|
|
2265
|
-
title: "
|
|
2301
|
+
title: "Hotel details",
|
|
2266
2302
|
description: `One hotel's catalogue facts: names, address, location, time zone, check-in and check-out times, the full description, every policy and the amenities, and its rooms with include: "rooms". "Not listed" is not "no". No prices or availability: get_hotel_offers has those.`,
|
|
2267
2303
|
annotations: READ,
|
|
2268
2304
|
input: getHotelInput,
|
|
@@ -2270,7 +2306,7 @@ var TOOLS = [
|
|
|
2270
2306
|
},
|
|
2271
2307
|
{
|
|
2272
2308
|
name: "get_hotel_offers",
|
|
2273
|
-
title: "
|
|
2309
|
+
title: "Live offers",
|
|
2274
2310
|
description: `Live, bookable offers for up to ${LIMITS.offersHotels} hotels and one stay. Every room in stay.rooms must have the same party: for different parties, call once per party. Each offer has the room, the meals included, price.total in USD for the whole stay and every room (what is charged), fees payable at the property, the cancellation terms with times in UTC and the hotel's time zone, the confirmation mode, and an offerId for book_hotel that expires at expiresAt. Hotels with nothing to offer are listed under unavailable with the reason. Up to limitPerHotel offers per hotel, default ${LIMITS.offersPerHotelDefault}, chosen for a spread of choices in this order while room remains: the cheapest offer, the cheapest that can be cancelled free, the cheapest with breakfast, the cheapest of each other room, then the rest by price; listed cheapest first.`,
|
|
2275
2311
|
annotations: READ,
|
|
2276
2312
|
input: hotelOffersInput,
|
|
@@ -2278,7 +2314,7 @@ var TOOLS = [
|
|
|
2278
2314
|
},
|
|
2279
2315
|
{
|
|
2280
2316
|
name: "book_hotel",
|
|
2281
|
-
title: "Create
|
|
2317
|
+
title: "Create order",
|
|
2282
2318
|
description: `Order one offer from get_hotel_offers. The answer is an unpaid order with a payment link: status awaiting_payment, the total, the stay and its terms, and payment.url, a Fortrip page to pay on. Nothing is charged until the order is paid, on that page or with pay_order (or Alipay/WeChat Pay); anyone holding the link can pay. Send the contact and, for each room of the offer, at least one guest. If the price or terms changed since the offer, the answer is offer_changed with every change and a new offer: show the changes and ask the user again before ordering it. Sending the same details again returns the same order. An offer is ordered once: for another order of the stay (another party, or a corrected guest name), get offers again and order the new offer; when it replaces an unpaid order, tell the user to pay only the new link, as the earlier one expires unpaid. To cancel an order, use cancel_order; for changes, or a cancellation cancel_order can't make, the user emails ${SUPPORT_EMAIL} with the order's reference.`,
|
|
2283
2319
|
annotations: {
|
|
2284
2320
|
readOnlyHint: false,
|
|
@@ -2320,7 +2356,7 @@ var TOOLS = [
|
|
|
2320
2356
|
},
|
|
2321
2357
|
{
|
|
2322
2358
|
name: "pay_order",
|
|
2323
|
-
title: "Pay order
|
|
2359
|
+
title: "Pay order",
|
|
2324
2360
|
description: `Pay an order without its link, by shared payment token or Alipay/WeChat Pay (method alipay_wechat_pay). Token: only if payment.handlers isn't empty and you can request one from the user's Link wallet (US and Canadian accounts); never ask the user for one. First show the user the USD total, the stay and every term (meals, cancellation, fees payable at the property), ask them to confirm and wait for a clear yes. Token: request it with config.business_profile and payment.credentialLimits; pass it with price.total. Wallet: pass method, price.total; show payment.wallets (WeChat code as an image if you can, both links); they pay once by either; a code lasts ${LIMITS.wechatCodeMinutes} minutes; then the WeChat link opens a new one, or call again. Pay one way only: payment.url or pay_order. On success payment.url stops working; on failure it stays open. Then poll get_order. payment_total_changed: confirm details.total, retry. payment_credential_invalid: new token. service_unavailable: retry. Else payment.url. A token pays one order only.`,
|
|
2325
2361
|
annotations: {
|
|
2326
2362
|
readOnlyHint: false,
|
|
@@ -2769,7 +2805,7 @@ var CENTER_BASES2 = {
|
|
|
2769
2805
|
seat: "the seat",
|
|
2770
2806
|
capital: "the capital",
|
|
2771
2807
|
busiest_settlement: "the settlement with the most hotels",
|
|
2772
|
-
hub: "the locality
|
|
2808
|
+
hub: "the locality",
|
|
2773
2809
|
point: "its location"
|
|
2774
2810
|
};
|
|
2775
2811
|
function radiusWords(meters, source) {
|
|
@@ -2836,7 +2872,7 @@ function countsLine(r) {
|
|
|
2836
2872
|
if (c.excludedNoFacilityData !== null) {
|
|
2837
2873
|
parts.push(`${num(c.excludedNoFacilityData)} left out for listing no facilities`);
|
|
2838
2874
|
}
|
|
2839
|
-
if (c.withinMaxRadius !== null) parts.push(`${num(c.withinMaxRadius)} within
|
|
2875
|
+
if (c.withinMaxRadius !== null) parts.push(`${num(c.withinMaxRadius)} within ${LIMITS.radiusMetersMax / 1e3} km`);
|
|
2840
2876
|
if (c.textAnywhere !== null) {
|
|
2841
2877
|
parts.push(`${num(c.textAnywhere)} match the text anywhere in ${country}`);
|
|
2842
2878
|
}
|
|
@@ -2990,13 +3026,13 @@ function ambiguous(d, surface) {
|
|
|
2990
3026
|
for (const c of d.candidates) {
|
|
2991
3027
|
const other = [c.names.en, c.names.zh].find((n) => n && n !== c.name);
|
|
2992
3028
|
const where = [c.region && `${c.region.name} ${c.region.placeId}`, c.countryCode].filter(Boolean).join(", ");
|
|
2993
|
-
const
|
|
3029
|
+
const hotels2 = c.hotels.scope === "area" ? `${plural(c.hotels.count, "hotel")} in the area` : c.hotels.radiusMeters === null ? plural(c.hotels.count, "hotel") : `${plural(c.hotels.count, "hotel")} within ${km(c.hotels.radiusMeters)}`;
|
|
2994
3030
|
lines.push(
|
|
2995
3031
|
[
|
|
2996
3032
|
`- ${c.name}${other ? ` (${other})` : ""} ${c.placeId}`,
|
|
2997
3033
|
`${c.kind} in ${where}`,
|
|
2998
3034
|
c.population === null ? "population not recorded" : `population ${num(c.population)}`,
|
|
2999
|
-
|
|
3035
|
+
hotels2
|
|
3000
3036
|
].join(" \xB7 ")
|
|
3001
3037
|
);
|
|
3002
3038
|
}
|
|
@@ -3257,8 +3293,8 @@ var UNKNOWN_IS_NOT_NO_EXEMPTIONS = {
|
|
|
3257
3293
|
hotels: `${RESULT_LIST} (the hotels that have offers).`,
|
|
3258
3294
|
unavailable: `${RESULT_LIST} (the hotels without offers, each with a reason).`,
|
|
3259
3295
|
candidates: `${RESULT_LIST} (the places a name could mean).`,
|
|
3260
|
-
"localities.items": `${RESULT_LIST} (the top
|
|
3261
|
-
"localities.items.includes": `${RESULT_LIST} (other places
|
|
3296
|
+
"localities.items": `${RESULT_LIST} (the top localities of the scope).`,
|
|
3297
|
+
"localities.items.includes": `${RESULT_LIST} (other places a locality includes).`,
|
|
3262
3298
|
filterable: `${RESULT_LIST} (the amenity codes a search can filter by).`,
|
|
3263
3299
|
rooms: `${REQUEST_ECHO} (the rooms of the stay).`,
|
|
3264
3300
|
childrenAges: `${REQUEST_ECHO} (each child's age; empty means no children).`,
|
|
@@ -3294,7 +3330,7 @@ var ME_SCOPES = { email: "email", name: "profile" };
|
|
|
3294
3330
|
// package.json
|
|
3295
3331
|
var package_default = {
|
|
3296
3332
|
name: "@fortrip/agent-contract",
|
|
3297
|
-
version: "4.3.
|
|
3333
|
+
version: "4.3.1",
|
|
3298
3334
|
license: "Apache-2.0",
|
|
3299
3335
|
description: "The contract of Fortrip's agent API (https://api.fortrip.ai/v1) and its MCP server: limits, paths, request and response schemas, error codes and field rules.",
|
|
3300
3336
|
type: "module",
|
|
@@ -3317,7 +3353,10 @@ var package_default = {
|
|
|
3317
3353
|
import: "./dist/regions.js"
|
|
3318
3354
|
}
|
|
3319
3355
|
},
|
|
3320
|
-
files: [
|
|
3356
|
+
files: [
|
|
3357
|
+
"dist",
|
|
3358
|
+
"NOTICE"
|
|
3359
|
+
],
|
|
3321
3360
|
sideEffects: false,
|
|
3322
3361
|
engines: {
|
|
3323
3362
|
node: ">=22"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fortrip/agent-contract",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "The contract of Fortrip's agent API (https://api.fortrip.ai/v1) and its MCP server: limits, paths, request and response schemas, error codes and field rules.",
|
|
6
6
|
"type": "module",
|