@fortrip/agent-contract 5.1.0 → 5.3.0-rc.0

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 CHANGED
@@ -77,10 +77,13 @@ interface ToolSpec {
77
77
  }
78
78
  /**
79
79
  * The consent rule (spec §6). It rides on every MCP result that holds a
80
- * non-null `payment.url`, as `nextStep` and as the last paragraph of the
81
- * text: some clients never show the model the server instructions.
80
+ * non-null `payment.url`, as `nextStep` and as the first next-step paragraph
81
+ * of the text: some clients never show the model the server instructions.
82
+ * The pay and wallet paragraphs after it repeat the rule on purpose: as the
83
+ * result's last paragraph it keeps the model from giving the link before a
84
+ * yes (paired eval, S6).
82
85
  */
83
- declare const ORDER_NEXT_STEP = "Before you give the user an order's payment.url, show them its total and currency, the stay (hotel, room, dates, rooms and guests per room) and every term (meals, cancellation, fees payable at the property), then end your reply by asking them to confirm, and wait for a clear yes. Only after they say yes, give them payment.url exactly as returned.";
86
+ declare const ORDER_NEXT_STEP = "Before you give the user an order's payment.url, show them its total and currency, the stay (hotel, room, dates, and each room's party and guest names), the contact (name, email, phone), any special requests and every term (meals, cancellation, fees payable at the property), then end your reply by asking them to confirm, and wait for a clear yes. Only after they say yes, give them payment.url exactly as returned.";
84
87
  /** Where a rendered result is read: an MCP client, which calls tools with
85
88
  * JSON arguments, or the CLI, which runs commands with flags. */
86
89
  type RenderSurface = "mcp" | "cli";
@@ -93,7 +96,7 @@ type RenderSurface = "mcp" | "cli";
93
96
  * keeps its payment-only meaning.
94
97
  */
95
98
  declare function cancelNextStep(surface: RenderSurface): string;
96
- /** `cancelNextStep` over MCP, also in the `cancel_order` description. */
99
+ /** `cancelNextStep` over MCP. */
97
100
  declare const CANCEL_NEXT_STEP: string;
98
101
  /**
99
102
  * How to pay without the link, as `surface` names the call. It rides as the
@@ -133,6 +136,11 @@ declare const MCP_OUTPUT: {
133
136
  status: z.ZodType<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown, z.core.$ZodTypeInternals<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown>>;
134
137
  createdAt: z.ZodString;
135
138
  updatedAt: z.ZodString;
139
+ contact: z.ZodNullable<z.ZodObject<{
140
+ name: z.ZodString;
141
+ email: z.ZodNullable<z.ZodString>;
142
+ phone: z.ZodNullable<z.ZodString>;
143
+ }, z.core.$strip>>;
136
144
  items: z.ZodArray<z.ZodType<OpenUnionOutput<"type", readonly [z.ZodObject<{
137
145
  type: z.ZodLiteral<"hotel">;
138
146
  hotel: z.ZodObject<{
@@ -148,7 +156,12 @@ declare const MCP_OUTPUT: {
148
156
  rooms: z.ZodArray<z.ZodObject<{
149
157
  adults: z.ZodNumber;
150
158
  childrenAges: z.ZodArray<z.ZodNumber>;
159
+ guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
160
+ firstName: z.ZodString;
161
+ lastName: z.ZodString;
162
+ }, z.core.$strip>>>;
151
163
  }, z.core.$strip>>;
164
+ specialRequests: z.ZodNullable<z.ZodString>;
152
165
  room: z.ZodObject<{
153
166
  name: z.ZodNullable<z.ZodObject<{
154
167
  text: z.ZodString;
@@ -210,7 +223,12 @@ declare const MCP_OUTPUT: {
210
223
  rooms: z.ZodArray<z.ZodObject<{
211
224
  adults: z.ZodNumber;
212
225
  childrenAges: z.ZodArray<z.ZodNumber>;
226
+ guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
227
+ firstName: z.ZodString;
228
+ lastName: z.ZodString;
229
+ }, z.core.$strip>>>;
213
230
  }, z.core.$strip>>;
231
+ specialRequests: z.ZodNullable<z.ZodString>;
214
232
  room: z.ZodObject<{
215
233
  name: z.ZodNullable<z.ZodObject<{
216
234
  text: z.ZodString;
@@ -354,6 +372,11 @@ declare const MCP_OUTPUT: {
354
372
  status: z.ZodType<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown, z.core.$ZodTypeInternals<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown>>;
355
373
  createdAt: z.ZodString;
356
374
  updatedAt: z.ZodString;
375
+ contact: z.ZodNullable<z.ZodObject<{
376
+ name: z.ZodString;
377
+ email: z.ZodNullable<z.ZodString>;
378
+ phone: z.ZodNullable<z.ZodString>;
379
+ }, z.core.$strip>>;
357
380
  items: z.ZodArray<z.ZodType<OpenUnionOutput<"type", readonly [z.ZodObject<{
358
381
  type: z.ZodLiteral<"hotel">;
359
382
  hotel: z.ZodObject<{
@@ -369,7 +392,12 @@ declare const MCP_OUTPUT: {
369
392
  rooms: z.ZodArray<z.ZodObject<{
370
393
  adults: z.ZodNumber;
371
394
  childrenAges: z.ZodArray<z.ZodNumber>;
395
+ guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
396
+ firstName: z.ZodString;
397
+ lastName: z.ZodString;
398
+ }, z.core.$strip>>>;
372
399
  }, z.core.$strip>>;
400
+ specialRequests: z.ZodNullable<z.ZodString>;
373
401
  room: z.ZodObject<{
374
402
  name: z.ZodNullable<z.ZodObject<{
375
403
  text: z.ZodString;
@@ -431,7 +459,12 @@ declare const MCP_OUTPUT: {
431
459
  rooms: z.ZodArray<z.ZodObject<{
432
460
  adults: z.ZodNumber;
433
461
  childrenAges: z.ZodArray<z.ZodNumber>;
462
+ guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
463
+ firstName: z.ZodString;
464
+ lastName: z.ZodString;
465
+ }, z.core.$strip>>>;
434
466
  }, z.core.$strip>>;
467
+ specialRequests: z.ZodNullable<z.ZodString>;
435
468
  room: z.ZodObject<{
436
469
  name: z.ZodNullable<z.ZodObject<{
437
470
  text: z.ZodString;
@@ -576,6 +609,11 @@ declare const MCP_OUTPUT: {
576
609
  status: z.ZodType<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown, z.core.$ZodTypeInternals<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown>>;
577
610
  createdAt: z.ZodString;
578
611
  updatedAt: z.ZodString;
612
+ contact: z.ZodNullable<z.ZodObject<{
613
+ name: z.ZodString;
614
+ email: z.ZodNullable<z.ZodString>;
615
+ phone: z.ZodNullable<z.ZodString>;
616
+ }, z.core.$strip>>;
579
617
  items: z.ZodArray<z.ZodType<OpenUnionOutput<"type", readonly [z.ZodObject<{
580
618
  type: z.ZodLiteral<"hotel">;
581
619
  hotel: z.ZodObject<{
@@ -591,7 +629,12 @@ declare const MCP_OUTPUT: {
591
629
  rooms: z.ZodArray<z.ZodObject<{
592
630
  adults: z.ZodNumber;
593
631
  childrenAges: z.ZodArray<z.ZodNumber>;
632
+ guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
633
+ firstName: z.ZodString;
634
+ lastName: z.ZodString;
635
+ }, z.core.$strip>>>;
594
636
  }, z.core.$strip>>;
637
+ specialRequests: z.ZodNullable<z.ZodString>;
595
638
  room: z.ZodObject<{
596
639
  name: z.ZodNullable<z.ZodObject<{
597
640
  text: z.ZodString;
@@ -653,7 +696,12 @@ declare const MCP_OUTPUT: {
653
696
  rooms: z.ZodArray<z.ZodObject<{
654
697
  adults: z.ZodNumber;
655
698
  childrenAges: z.ZodArray<z.ZodNumber>;
699
+ guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
700
+ firstName: z.ZodString;
701
+ lastName: z.ZodString;
702
+ }, z.core.$strip>>>;
656
703
  }, z.core.$strip>>;
704
+ specialRequests: z.ZodNullable<z.ZodString>;
657
705
  room: z.ZodObject<{
658
706
  name: z.ZodNullable<z.ZodObject<{
659
707
  text: z.ZodString;
@@ -799,6 +847,11 @@ declare const MCP_OUTPUT: {
799
847
  status: z.ZodType<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown, z.core.$ZodTypeInternals<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown>>;
800
848
  createdAt: z.ZodString;
801
849
  updatedAt: z.ZodString;
850
+ contact: z.ZodNullable<z.ZodObject<{
851
+ name: z.ZodString;
852
+ email: z.ZodNullable<z.ZodString>;
853
+ phone: z.ZodNullable<z.ZodString>;
854
+ }, z.core.$strip>>;
802
855
  items: z.ZodArray<z.ZodType<OpenUnionOutput<"type", readonly [z.ZodObject<{
803
856
  type: z.ZodLiteral<"hotel">;
804
857
  hotel: z.ZodObject<{
@@ -814,7 +867,12 @@ declare const MCP_OUTPUT: {
814
867
  rooms: z.ZodArray<z.ZodObject<{
815
868
  adults: z.ZodNumber;
816
869
  childrenAges: z.ZodArray<z.ZodNumber>;
870
+ guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
871
+ firstName: z.ZodString;
872
+ lastName: z.ZodString;
873
+ }, z.core.$strip>>>;
817
874
  }, z.core.$strip>>;
875
+ specialRequests: z.ZodNullable<z.ZodString>;
818
876
  room: z.ZodObject<{
819
877
  name: z.ZodNullable<z.ZodObject<{
820
878
  text: z.ZodString;
@@ -876,7 +934,12 @@ declare const MCP_OUTPUT: {
876
934
  rooms: z.ZodArray<z.ZodObject<{
877
935
  adults: z.ZodNumber;
878
936
  childrenAges: z.ZodArray<z.ZodNumber>;
937
+ guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
938
+ firstName: z.ZodString;
939
+ lastName: z.ZodString;
940
+ }, z.core.$strip>>>;
879
941
  }, z.core.$strip>>;
942
+ specialRequests: z.ZodNullable<z.ZodString>;
880
943
  room: z.ZodObject<{
881
944
  name: z.ZodNullable<z.ZodObject<{
882
945
  text: z.ZodString;
@@ -1019,6 +1082,11 @@ declare const MCP_OUTPUT: {
1019
1082
  status: z.ZodType<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown, z.core.$ZodTypeInternals<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown>>;
1020
1083
  createdAt: z.ZodString;
1021
1084
  updatedAt: z.ZodString;
1085
+ contact: z.ZodNullable<z.ZodObject<{
1086
+ name: z.ZodString;
1087
+ email: z.ZodNullable<z.ZodString>;
1088
+ phone: z.ZodNullable<z.ZodString>;
1089
+ }, z.core.$strip>>;
1022
1090
  items: z.ZodArray<z.ZodType<OpenUnionOutput<"type", readonly [z.ZodObject<{
1023
1091
  type: z.ZodLiteral<"hotel">;
1024
1092
  hotel: z.ZodObject<{
@@ -1034,7 +1102,12 @@ declare const MCP_OUTPUT: {
1034
1102
  rooms: z.ZodArray<z.ZodObject<{
1035
1103
  adults: z.ZodNumber;
1036
1104
  childrenAges: z.ZodArray<z.ZodNumber>;
1105
+ guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
1106
+ firstName: z.ZodString;
1107
+ lastName: z.ZodString;
1108
+ }, z.core.$strip>>>;
1037
1109
  }, z.core.$strip>>;
1110
+ specialRequests: z.ZodNullable<z.ZodString>;
1038
1111
  room: z.ZodObject<{
1039
1112
  name: z.ZodNullable<z.ZodObject<{
1040
1113
  text: z.ZodString;
@@ -1096,7 +1169,12 @@ declare const MCP_OUTPUT: {
1096
1169
  rooms: z.ZodArray<z.ZodObject<{
1097
1170
  adults: z.ZodNumber;
1098
1171
  childrenAges: z.ZodArray<z.ZodNumber>;
1172
+ guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
1173
+ firstName: z.ZodString;
1174
+ lastName: z.ZodString;
1175
+ }, z.core.$strip>>>;
1099
1176
  }, z.core.$strip>>;
1177
+ specialRequests: z.ZodNullable<z.ZodString>;
1100
1178
  room: z.ZodObject<{
1101
1179
  name: z.ZodNullable<z.ZodObject<{
1102
1180
  text: z.ZodString;
@@ -2779,6 +2857,11 @@ declare const order: z.ZodObject<{
2779
2857
  status: z.ZodType<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown, z.core.$ZodTypeInternals<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown>>;
2780
2858
  createdAt: z.ZodString;
2781
2859
  updatedAt: z.ZodString;
2860
+ contact: z.ZodNullable<z.ZodObject<{
2861
+ name: z.ZodString;
2862
+ email: z.ZodNullable<z.ZodString>;
2863
+ phone: z.ZodNullable<z.ZodString>;
2864
+ }, z.core.$strip>>;
2782
2865
  items: z.ZodArray<z.ZodType<OpenUnionOutput<"type", readonly [z.ZodObject<{
2783
2866
  type: z.ZodLiteral<"hotel">;
2784
2867
  hotel: z.ZodObject<{
@@ -2794,7 +2877,12 @@ declare const order: z.ZodObject<{
2794
2877
  rooms: z.ZodArray<z.ZodObject<{
2795
2878
  adults: z.ZodNumber;
2796
2879
  childrenAges: z.ZodArray<z.ZodNumber>;
2880
+ guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
2881
+ firstName: z.ZodString;
2882
+ lastName: z.ZodString;
2883
+ }, z.core.$strip>>>;
2797
2884
  }, z.core.$strip>>;
2885
+ specialRequests: z.ZodNullable<z.ZodString>;
2798
2886
  room: z.ZodObject<{
2799
2887
  name: z.ZodNullable<z.ZodObject<{
2800
2888
  text: z.ZodString;
@@ -2856,7 +2944,12 @@ declare const order: z.ZodObject<{
2856
2944
  rooms: z.ZodArray<z.ZodObject<{
2857
2945
  adults: z.ZodNumber;
2858
2946
  childrenAges: z.ZodArray<z.ZodNumber>;
2947
+ guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
2948
+ firstName: z.ZodString;
2949
+ lastName: z.ZodString;
2950
+ }, z.core.$strip>>>;
2859
2951
  }, z.core.$strip>>;
2952
+ specialRequests: z.ZodNullable<z.ZodString>;
2860
2953
  room: z.ZodObject<{
2861
2954
  name: z.ZodNullable<z.ZodObject<{
2862
2955
  text: z.ZodString;
@@ -3002,6 +3095,11 @@ declare const orderList: z.ZodObject<{
3002
3095
  status: z.ZodType<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown, z.core.$ZodTypeInternals<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown>>;
3003
3096
  createdAt: z.ZodString;
3004
3097
  updatedAt: z.ZodString;
3098
+ contact: z.ZodNullable<z.ZodObject<{
3099
+ name: z.ZodString;
3100
+ email: z.ZodNullable<z.ZodString>;
3101
+ phone: z.ZodNullable<z.ZodString>;
3102
+ }, z.core.$strip>>;
3005
3103
  items: z.ZodArray<z.ZodType<OpenUnionOutput<"type", readonly [z.ZodObject<{
3006
3104
  type: z.ZodLiteral<"hotel">;
3007
3105
  hotel: z.ZodObject<{
@@ -3017,7 +3115,12 @@ declare const orderList: z.ZodObject<{
3017
3115
  rooms: z.ZodArray<z.ZodObject<{
3018
3116
  adults: z.ZodNumber;
3019
3117
  childrenAges: z.ZodArray<z.ZodNumber>;
3118
+ guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
3119
+ firstName: z.ZodString;
3120
+ lastName: z.ZodString;
3121
+ }, z.core.$strip>>>;
3020
3122
  }, z.core.$strip>>;
3123
+ specialRequests: z.ZodNullable<z.ZodString>;
3021
3124
  room: z.ZodObject<{
3022
3125
  name: z.ZodNullable<z.ZodObject<{
3023
3126
  text: z.ZodString;
@@ -3079,7 +3182,12 @@ declare const orderList: z.ZodObject<{
3079
3182
  rooms: z.ZodArray<z.ZodObject<{
3080
3183
  adults: z.ZodNumber;
3081
3184
  childrenAges: z.ZodArray<z.ZodNumber>;
3185
+ guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
3186
+ firstName: z.ZodString;
3187
+ lastName: z.ZodString;
3188
+ }, z.core.$strip>>>;
3082
3189
  }, z.core.$strip>>;
3190
+ specialRequests: z.ZodNullable<z.ZodString>;
3083
3191
  room: z.ZodObject<{
3084
3192
  name: z.ZodNullable<z.ZodObject<{
3085
3193
  text: z.ZodString;
@@ -3740,6 +3848,10 @@ declare const searchResult: z.ZodObject<{
3740
3848
  }, z.core.$strip>>;
3741
3849
  nameAsText: z.ZodNullable<z.ZodNumber>;
3742
3850
  }, z.core.$strip>;
3851
+ currencyHint: z.ZodOptional<z.ZodObject<{
3852
+ currency: z.ZodType<"CNY" | (string & {}), unknown, z.core.$ZodTypeInternals<"CNY" | (string & {}), unknown>>;
3853
+ reason: z.ZodType<(string & {}) | "request_location" | "sign_in_location", unknown, z.core.$ZodTypeInternals<(string & {}) | "request_location" | "sign_in_location", unknown>>;
3854
+ }, z.core.$strip>>;
3743
3855
  data: z.ZodArray<z.ZodObject<{
3744
3856
  hotelId: z.ZodString;
3745
3857
  name: z.ZodString;
package/dist/index.js CHANGED
@@ -256,7 +256,7 @@ var SEARCH_SORTS = [
256
256
  var locale = oneOf("locale", ["en", "zh"]).describe(
257
257
  "Language for names and text in the response: en or zh."
258
258
  );
259
- var currencyDescription = "The currency to price and charge in: USD (default) or CNY, where available (otherwise the answer is currency_unavailable). Use CNY only for a user who pays with Alipay, WeChat Pay or a bank card from mainland China, the only ways a CNY order can be paid: when they ask for CNY or say they pay that way. Ask only when the conversation suggests it; otherwise keep USD.";
259
+ var currencyDescription = "The currency of every price: USD (default) or CNY. Each currency is paid through its own channel, with its own payment methods; the order's payment page shows them. CNY is paid through payment channels in mainland China and suits a user who pays that way.";
260
260
  var cursor = nonEmpty("cursor");
261
261
  var nightsError = (name) => `${name} must be after the check-in date and at most ${LIMITS.nightsFortrip} nights later`;
262
262
  var stay = strictInput({
@@ -396,7 +396,7 @@ function createSearchHotelsInput(now = Date.now) {
396
396
  "Dates and party. Needed for indicative prices. Search uses only the dates when the rooms differ."
397
397
  ),
398
398
  pricing: oneOf("pricing", ["indicative", "none"]).optional().describe(
399
- "`indicative` adds an approximate price per hotel and needs a stay; `none` skips prices. Default: indicative with a stay, otherwise none."
399
+ "`indicative` adds an indicative price per hotel and needs a stay; `none` skips prices. Default: indicative with a stay, otherwise none."
400
400
  ),
401
401
  filters: searchFilters,
402
402
  sort: oneOf("sort", SEARCH_SORTS).optional().describe(
@@ -1063,7 +1063,7 @@ var COMMANDS = [
1063
1063
  {
1064
1064
  group: "orders",
1065
1065
  name: "cancel",
1066
- summary: "With the penalty the user agreed to (--max-penalty) it cancels a paid order under its terms, and --close closes an unpaid one; with neither it changes nothing and shows what the order allows",
1066
+ summary: "Cancel a paid order under its terms (--max-penalty), or close an unpaid one (--close)",
1067
1067
  tool: "cancel_order",
1068
1068
  flags: cancelFlags,
1069
1069
  positionals: [positional(cancelOrderInput, "orderId")],
@@ -1262,17 +1262,17 @@ function strictify(schema) {
1262
1262
 
1263
1263
  // src/guide-data.generated.ts
1264
1264
  var FRAGMENTS = {
1265
- "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",
1266
- "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, even when its order failed or expired: to order with other details, get offers again |\n| `stay_unsupported` (422) | `mixed_occupancy`: order once per party; `max_nights`: at most `max` nights per order |\n| `currency_unavailable` (422) | Prices in `details.currency` aren't available yet: tell the user, and ask whether to see USD prices |\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",
1265
+ "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{{#if claude-skill cli}}\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- 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 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",
1266
+ "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 |\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 order is still being created, or still being confirmed when cancelling it: 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, even when its order failed or expired: to order with other details, get offers again |\n| `stay_unsupported` (422) | `mixed_occupancy`: order once per party; `max_nights`: at most `max` nights per order |\n| `currency_unavailable` (422) | Prices in `details.currency` aren't available yet: tell the user, and ask whether to see USD prices |\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",
1267
1267
  "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',
1268
- "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",
1269
- "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 the search\'s currency; 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',
1270
- "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 the payment provider. 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, or can be closed now with `{{tool:orders cancel}}`{{#if cli}} and `--close`{{/if}} once the user says they no longer want it.\n- An order `awaiting_payment` with `payment.status` `unpaid` 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 on `payment.url` or by a way in the order's `payment.methods`.{{#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.methods` has the `stripe_shared_payment_token` entry (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 only a USD order up to that has such an entry. 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 that entry's `handler.config.business_profile` and its `limits`: `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 that entry's `limits`. `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` `stripe_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 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. Pay one way only: `payment.url` or this.\n2. Then show the `stripe_alipay_wechat_pay` entry of `payment.methods`: 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 the order's currency, 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 that entry's `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",
1271
- "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 cli}}SKILL.md{{/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, 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 the offer's currency.\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
+ "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- Offers and orders take one party per call, every room the same: for different parties, order once per party. `{{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`.\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",
1269
+ "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 (a typo such as "Shangahi" finds nothing): 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- 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 the search\'s currency; 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',
1270
+ "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 the payment provider. Nothing is charged until the user pays.\n\n1. Show the order's total and currency, the stay (hotel, room, dates, and each room's party and guest names), the contact (name, email, phone), any special requests and every term: meals, cancellation (status, deadline, penalties) and fees payable at the property, unknowns included. Show the names and contact as the order holds them, so the user can catch a wrong one before paying; to correct one, order a new offer (see below).\n2. End that reply by asking the user to confirm, and wait for a clear yes. Urgency is not consent.\n3. Then pay one way only: give `payment.url` exactly as returned (don't shorten, rebuild or re-encode it), or use one of the ways below.\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 with each room's guests, the contact, any special requests 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 or contact) 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, or can be closed now with `{{tool:orders cancel}}`{{#if cli}} and `--close`{{/if}} once the user says they no longer want it.\n- An order `awaiting_payment` with `payment.status` `unpaid` whose `payment.url` is null has a payment being processed: read it again shortly with `{{tool:orders get}}`, and don't give an earlier link.\n{{/if}}\n- Never ask for, accept or pass on payment card details; payment happens only on `payment.url` or by a way in the order's `payment.methods`.{{#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.methods` has the `stripe_shared_payment_token` entry (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 only a USD order up to that has such an entry. Otherwise give `payment.url`, and never ask the user to create, type or paste a token.\n\n1. Confirm the order with the user as before giving the payment link: its total and currency, the stay with each room's guests, the contact, any special requests and every term, and 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 that entry's `handler.config.business_profile` and its `limits`: `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. 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 that entry's `limits`. `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. {{#if claude-skill}}Call{{/if}}{{#if cli}}Run{{/if}} `{{tool:orders pay}}` {{#if claude-skill}}with `method` `stripe_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. Confirm the order with the user as before giving the payment link: its total and currency, the stay with each room's guests, the contact, any special requests and every term, and a clear yes.\n2. Then show the `stripe_alipay_wechat_pay` entry of `payment.methods`: 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 the order's currency, 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 that entry's `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",
1271
+ "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 cli}}SKILL.md{{/if}} still apply{{#if mcp}} (call order, destinations, confirming the order `{{tool:hotels book}}` returns before giving the payment link){{/if}}; 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\n{{#if mcp}}\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\n{{/if}}\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 mcp}} If children come along, ask each child's age; `{{tool:hotels offers}}` needs it. When a place name is ambiguous, ask which place the user means.{{/if}} Don't ask for trip type or style: infer it from the conversation or leave it general.\n\n## Evidence\n\n- {{#if mcp}}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{{/if}}{{#if claude-skill cli}}Once{{/if}} 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{{#if mcp}}\n- A hotel is available only once `{{tool:hotels offers}}` returned an offer for it.\n{{/if}}\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, 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 the offer's currency.\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. Two or three plans usually suffice, 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",
1272
1272
  "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 its currency, 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",
1273
- "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 the request's `{{arg:currency}}` (`USD` by default); an order is in the currency of the offer it was made from.{{#if claude-skill cli}} `perNightAllRooms` is the total per night; to compare with a per-room budget, also divide by the rooms.{{/if}} On a USD order, 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 total in that currency is the price{{/if}}.\n{{#if claude-skill cli}}\n- Every price of a response is in that one currency; don't convert it. `{{arg:currency}}`{{#if cli}} (or `FORTRIP_CURRENCY`){{/if}} is `USD` (the default) or `CNY`, where available; otherwise the answer is `currency_unavailable`.\n- CNY is for a user who pays with Alipay, WeChat Pay or a bank card from mainland China: a CNY order can be paid only those ways, through its `payment.url`. Use `{{arg:currency}}` `CNY` when the user asks for CNY prices or says they pay that way, ask when the conversation suggests it, and otherwise keep `USD`.\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",
1273
+ "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 claude-skill cli}}In an offer or order, `price.total` is the whole stay for all rooms and is what is charged, in the request's `{{arg:currency}}` (`USD` by default); an{{/if}}{{#if mcp}}An{{/if}} order is in the currency of the offer it was made from.{{#if claude-skill cli}} `perNightAllRooms` is the total per night; to compare with a per-room budget, also divide by the rooms.{{/if}} On a USD order, 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 total in that currency is the price{{/if}}.\n{{#if claude-skill cli}}\n- Every price of a response is in that one currency; don't convert it. `{{arg:currency}}`{{#if cli}} (or `FORTRIP_CURRENCY`){{/if}} is `USD` (the default) or `CNY`.\n- Each currency is paid through its own channel, with its own payment methods; the order's payment page shows them. CNY is paid through payment channels in mainland China and suits a user who pays that way.\n- A search not in CNY may carry `currencyHint` (CNY) when the request or the user's latest sign-in comes from mainland China: offer CNY prices if the user may pay that way, and then use CNY for both the search and the offers.\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",
1274
1274
  "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 or closes an unpaid one, `{{tool:orders pay}}` pays by token or Alipay/WeChat Pay.\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 and currency, 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; closes an unpaid one |\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\", read [references/planning.md](references/planning.md) before searching.\n{{/if}}\n",
1275
- "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",
1275
+ "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\nRunning `{{tool:whoami}}` when the user first asks about hotels lets the sign-in happen while they answer your follow-up questions.\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",
1276
1276
  "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`). A paid order (`cancel.reason` `cancellable`) then has the penalty under its terms (`cancel.penalty`) and the refund, what was paid less the penalty (`cancel.refund`), both in the charge currency; an unpaid one (`unpaid`) can be closed instead. 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` as shown{{#if cli}}, its amount: the CLI takes the currency from the order{{/if}}. 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`.\n\nClose an unpaid order only once the user says they no longer want it: {{#if claude-skill}}call{{/if}}{{#if cli}}run{{/if}} `{{tool:orders cancel}}` {{#if claude-skill}}without `maximumPenalty`{{/if}}{{#if cli}}with `--close`{{/if}}. It becomes `expired`, and nothing is charged. `payment_in_progress` (409) means a payment of it is under way: read it again shortly.{{#if cli}} Without `--max-penalty` or `--close`, `{{tool:orders cancel}}` changes nothing: it prints the penalty and the refund, or that the order can be closed, 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"
1277
1277
  };
1278
1278
 
@@ -1649,6 +1649,12 @@ var searchResult = openObject({
1649
1649
  "When a place_name search matched few hotels: how many in its country match the name as text; otherwise null."
1650
1650
  )
1651
1651
  }).describe("What the search covered: counts of hotels, each null when it doesn't apply."),
1652
+ currencyHint: openObject({
1653
+ currency: openEnum(["CNY"]),
1654
+ reason: openEnum(["request_location", "sign_in_location"])
1655
+ }).optional().describe(
1656
+ "Present only when the search is not in that currency and the user may pay through its channel: this request comes from mainland China (request_location), or the user's latest sign-in to Fortrip was there (sign_in_location). Prices are also available in that currency; a suggestion, not a requirement."
1657
+ ),
1652
1658
  data: z11.array(hotelSummary),
1653
1659
  nextCursor: z11.string().nullable().describe("Pass it back as cursor for the next page; null on the last page."),
1654
1660
  notes: z11.array(
@@ -1909,7 +1915,7 @@ var paymentMethod = openUnion("id", [
1909
1915
  )
1910
1916
  }).describe("What the shared payment token for pay_order must allow.")
1911
1917
  }).describe(
1912
- `A Stripe shared payment token, through pay_order's sharedPaymentToken or payment. The entry is absent 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.`
1918
+ `A Stripe shared payment token, through pay_order's sharedPaymentToken or payment. The entry is absent when a token can't pay this order (for example over $${LIMITS.tokenPaymentMaxUsd}, not charged in USD, or started on the Fortrip website); then give payment.url or use another entry.`
1913
1919
  ),
1914
1920
  openObject({
1915
1921
  id: z14.literal("stripe_alipay_wechat_pay"),
@@ -1930,6 +1936,11 @@ var paymentMethod = openUnion("id", [
1930
1936
  )
1931
1937
  ]);
1932
1938
  var orderReference = z14.string().regex(/^FT-[2-9A-HJ-NP-Z]{6}$/);
1939
+ var orderRoom = stayEcho.shape.rooms.element.extend({
1940
+ guests: z14.array(openObject({ firstName: z14.string(), lastName: z14.string() })).nullable().describe(
1941
+ "The guests the order names for this room, as given when ordering. null when none are on record yet: an order started on the Fortrip website names them at checkout."
1942
+ )
1943
+ });
1933
1944
  var hotelItem = openObject({
1934
1945
  type: z14.literal("hotel"),
1935
1946
  hotel: openObject({
@@ -1939,7 +1950,8 @@ var hotelItem = openObject({
1939
1950
  checkIn: localDate,
1940
1951
  checkOut: localDate,
1941
1952
  timeZone: z14.string().nullable(),
1942
- rooms: stayEcho.shape.rooms,
1953
+ rooms: z14.array(orderRoom).min(1),
1954
+ specialRequests: z14.string().nullable().describe("The requests for the hotel, as given when ordering; null when none were given. Not guaranteed."),
1943
1955
  room: openObject({
1944
1956
  name: localizedText.nullable(),
1945
1957
  beds: localizedText.nullable()
@@ -1956,10 +1968,17 @@ var order = openObject({
1956
1968
  orderId,
1957
1969
  reference: orderReference,
1958
1970
  status: openEnum(ORDER_STATUSES).describe(
1959
- "awaiting_payment: unpaid, nothing charged; payable until payment.expiresAt. expired: not paid; the time ran out or the order was closed. 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."
1971
+ "awaiting_payment: not paid yet (a payment just made may still be settling); payable until payment.expiresAt. expired: not paid; the time ran out or the order was closed. 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."
1960
1972
  ),
1961
1973
  createdAt: instant,
1962
1974
  updatedAt: instant,
1975
+ contact: openObject({
1976
+ name: z14.string().describe("The contact's full name, as given when ordering."),
1977
+ email: z14.string().nullable().describe("Where the confirmation is sent; null when none is on record."),
1978
+ phone: z14.string().nullable().describe("The contact's phone number; null when none is on record.")
1979
+ }).nullable().describe(
1980
+ "Who the hotel and the confirmation reach, as given when ordering. null when none is on record yet: an order started on the Fortrip website gives it at checkout."
1981
+ ),
1963
1982
  items: z14.array(openUnion("type", [hotelItem])).min(1),
1964
1983
  price: openObject({
1965
1984
  total: money.describe(
@@ -1969,7 +1988,7 @@ var order = openObject({
1969
1988
  payment: openObject({
1970
1989
  status: openEnum(PAYMENT_STATUSES),
1971
1990
  url: z14.string().nullable().describe(
1972
- "The payment page, on fortrip.ai; it continues to the payment provider. With requiresSignIn false 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 while a payment is held (authorized) or when the order isn't awaiting payment, or, while it is and its payment is unpaid, when the link couldn't be read this time: read the order again."
1991
+ "The payment page, on fortrip.ai; it continues to the payment provider. With requiresSignIn false 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 while a payment is held (authorized) or when the order isn't awaiting payment, or, while it is and its payment is unpaid, while a payment is being processed: read the order again shortly, and don't give an earlier link."
1973
1992
  ),
1974
1993
  requiresSignIn: z14.boolean(),
1975
1994
  expiresAt: instant.nullable().describe(
@@ -1979,7 +1998,7 @@ var order = openObject({
1979
1998
  "USD or CNY: the currency of the offer the order was made from. An order made on the Fortrip website may be in another currency."
1980
1999
  ),
1981
2000
  localCurrencyAtCheckout: z14.boolean().describe(
1982
- "Whether paying by url may charge the card in its own currency, converted by Stripe; false once paid by token, Alipay or WeChat Pay; always false on a CNY order."
2001
+ "Whether paying by url may charge the card in its own currency, converted by Stripe; false once paid by token, or by Alipay or WeChat Pay through pay_order or the Fortrip page; always false on a CNY order."
1983
2002
  ),
1984
2003
  localCharge: money.nullable().describe(
1985
2004
  "What the card was charged in its own currency, when Stripe converted the total; otherwise null. Always null on a CNY order."
@@ -2223,14 +2242,14 @@ var RATE_LIMITS = {
2223
2242
 
2224
2243
  // src/tools.ts
2225
2244
  import { z as z16 } from "zod";
2226
- var ORDER_NEXT_STEP = "Before you give the user an order's payment.url, show them its total and currency, the stay (hotel, room, dates, rooms and guests per room) and every term (meals, cancellation, fees payable at the property), then end your reply by asking them to confirm, and wait for a clear yes. Only after they say yes, give them payment.url exactly as returned.";
2245
+ var ORDER_NEXT_STEP = "Before you give the user an order's payment.url, show them its total and currency, the stay (hotel, room, dates, and each room's party and guest names), the contact (name, email, phone), any special requests and every term (meals, cancellation, fees payable at the property), then end your reply by asking them to confirm, and wait for a clear yes. Only after they say yes, give them payment.url exactly as returned.";
2227
2246
  var CALLS = {
2228
2247
  mcp: {
2229
2248
  cancel: "call cancel_order",
2230
2249
  penalty: "Pass maximumPenalty as cancel.penalty, exactly as returned.",
2231
2250
  close: "call cancel_order",
2232
2251
  pay: "call pay_order",
2233
- payWallet: " with method stripe_alipay_wechat_pay",
2252
+ payWallet: " with method stripe_alipay_wechat_pay and the order's price.total",
2234
2253
  get: "call get_order",
2235
2254
  poll: "poll get_order",
2236
2255
  payWith: "call pay_order with it and the order's price.total",
@@ -2241,7 +2260,7 @@ var CALLS = {
2241
2260
  close: "run `fortrip orders cancel <orderId> --close`",
2242
2261
  penalty: "Pass the penalty's amount as --max-penalty (120.00 for a penalty of USD 120.00).",
2243
2262
  pay: "run `fortrip orders pay`",
2244
- payWallet: " with --method stripe_alipay_wechat_pay",
2263
+ payWallet: " with --method stripe_alipay_wechat_pay --total <total>",
2245
2264
  get: "run `fortrip orders get <orderId>`",
2246
2265
  poll: "poll it with `fortrip orders get <orderId>`",
2247
2266
  payWith: "run `fortrip orders pay <orderId> --token <spt_\u2026> --total <total>` with the token and the order's total",
@@ -2255,12 +2274,12 @@ function cancelNextStep(surface) {
2255
2274
  var CANCEL_NEXT_STEP = cancelNextStep("mcp");
2256
2275
  function payNextStep(surface) {
2257
2276
  const c = CALLS[surface];
2258
- return `To pay without the link: only if you have a tool that can request a Stripe shared payment token from the user's Link wallet (US and Canadian Link accounts), and the order's payment.methods has the stripe_shared_payment_token entry. Otherwise give payment.url, and never ask the user to create, type or paste a token. Before you ${c.pay}, show the user the order's total and currency, the stay (hotel, room, dates, rooms and guests per room) and every term (meals, cancellation, fees payable at the property), then end your reply by asking them to confirm, and wait for a clear yes. Then request the token for this order from the user's Link wallet with that entry's handler config.business_profile and its limits (maxAmount in cents, currency, expiresAt), and ${c.payWith}. The charge is in USD: a card in another currency may add a foreign transaction fee. Pay one way only: either give payment.url or ${c.pay}. Once ${c.paid} succeeds, payment.url stops working; a failed payment leaves it open.`;
2277
+ return `To pay without the link: only if you have a tool that can request a Stripe shared payment token from the user's Link wallet (US and Canadian Link accounts), and the order's payment.methods has the stripe_shared_payment_token entry. Otherwise give payment.url, and never ask the user to create, type or paste a token. Before you ${c.pay}, show the user the order's total and currency, the stay (hotel, room, dates, and each room's party and guest names), the contact (name, email, phone), any special requests and every term (meals, cancellation, fees payable at the property), then end your reply by asking them to confirm, and wait for a clear yes. Then request the token for this order from the user's Link wallet with that entry's handler config.business_profile and its limits (maxAmount in cents, currency, expiresAt), and ${c.payWith}. The charge is in USD: a card in another currency may add a foreign transaction fee. Pay one way only: either give payment.url or ${c.pay}. Once ${c.paid} succeeds, payment.url stops working; a failed payment leaves it open.`;
2259
2278
  }
2260
2279
  var PAY_NEXT_STEP = payNextStep("mcp");
2261
2280
  function walletNextStep(surface) {
2262
2281
  const c = CALLS[surface];
2263
- return `Before you ${c.pay}${c.payWallet}, show the user the order's total and currency, the stay (hotel, room, dates, rooms and guests per room) and every term (meals, cancellation, fees payable at the property), then ask them to confirm, and wait for a clear yes. Then show the stripe_alipay_wechat_pay entry of payment.methods: the WeChat code as an image if you can, and both links. The user pays once, by one of them. Alipay and WeChat Pay charge at once; if the hotel can't confirm, the payment is refunded in full. Then ${c.poll}.`;
2282
+ return `Before you ${c.pay}${c.payWallet}, show the user the order's total and currency, the stay (hotel, room, dates, and each room's party and guest names), the contact (name, email, phone), any special requests and every term (meals, cancellation, fees payable at the property), then ask them to confirm, and wait for a clear yes. Then show the stripe_alipay_wechat_pay entry of payment.methods: the WeChat code as an image if you can, and both links. The user pays once, by one of them. Alipay and WeChat Pay charge at once; if the hotel can't confirm, the payment is refunded in full. Then ${c.poll}.`;
2264
2283
  }
2265
2284
  var WALLET_NEXT_STEP = walletNextStep("mcp");
2266
2285
  var PRESENTATION_HINT = "Presentation: If 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 its currency, 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.";
@@ -2285,7 +2304,7 @@ var TOOLS = [
2285
2304
  {
2286
2305
  name: "search_hotels",
2287
2306
  title: "Search hotels",
2288
- description: 'Find hotels by destination and/or text, with an indicative per-room-night price when a stay is given. destination is a place_name with its countryCode, a place or locality by placeId from an earlier answer, a point, or a country. A name several places bear answers destination_ambiguous with candidates: ask the user, then search the chosen placeId. text matches hotel names, brands and areas word for word. Indicative prices are estimates and not bookable: get_hotel_offers returns what the user pays. A search too broad to answer is refused with search_too_broad and its localities: pass one back as { kind: "locality", placeId }, never by name. The answer states the scope, the counts and notes; a next page is the cursor and, optionally, limit.',
2307
+ description: "Find hotels by destination and/or text, with an indicative per-room-night price when a stay is given. destination is a place_name with its countryCode, a place or locality by placeId from an earlier answer, a point, or a country. text matches hotel names, brands and areas word for word. Indicative prices are estimates and not bookable: get_hotel_offers returns what the user pays. A name several places bear answers destination_ambiguous, and a search too broad to answer search_too_broad with its localities; each error says what to do next. The answer states the scope, the counts and notes; a next page is the cursor and, optionally, limit.",
2289
2308
  annotations: READ,
2290
2309
  input: searchHotelsInput,
2291
2310
  output: searchResult
@@ -2301,7 +2320,7 @@ var TOOLS = [
2301
2320
  {
2302
2321
  name: "get_hotel_offers",
2303
2322
  title: "Live offers",
2304
- 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 the request's currency, 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.`,
2323
+ 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 the request's currency, 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}), picked to span price, free cancellation, breakfast and rooms, listed cheapest first; the answer counts those not shown.`,
2305
2324
  annotations: READ,
2306
2325
  input: hotelOffersInput,
2307
2326
  output: hotelOffersResult
@@ -2309,7 +2328,7 @@ var TOOLS = [
2309
2328
  {
2310
2329
  name: "book_hotel",
2311
2330
  title: "Create order",
2312
- 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.`,
2331
+ 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; 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 or contact), 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.`,
2313
2332
  annotations: {
2314
2333
  readOnlyHint: false,
2315
2334
  idempotentHint: false,
@@ -2322,7 +2341,7 @@ var TOOLS = [
2322
2341
  {
2323
2342
  name: "get_order",
2324
2343
  title: "Get order",
2325
- description: "One of the user's orders by orderId: its status, the payment status and, while it awaits payment, payment.url; the stay and its terms; and the hotel's confirmation number once there is one. Check it after the user pays. An order awaiting payment whose payment.url is null had its link unreadable this time: read it again.",
2344
+ description: "One of the user's orders by orderId: its status, the payment status and, while it awaits payment, payment.url; the stay and its terms; and the hotel's confirmation number once there is one. Check it after the user pays.",
2326
2345
  annotations: READ_OWN,
2327
2346
  input: getOrderInput,
2328
2347
  output: MCP_OUTPUT.get_order
@@ -2338,7 +2357,7 @@ var TOOLS = [
2338
2357
  {
2339
2358
  name: "cancel_order",
2340
2359
  title: "Cancel order",
2341
- description: `Cancel a paid order under its terms, or close an unpaid one. Paid (cancel.reason cancellable): the hotel booking is cancelled and cancel.refund is refunded. ${CANCEL_NEXT_STEP} Penalty now above maximumPenalty: cancellation_changed, nothing changed; ask again. Then poll get_order: cancelling, then cancelled. Hotel refused: confirmed, reason refused. Unpaid (cancel.reason unpaid): close it only once the user says they no longer want it, without maximumPenalty; nothing is charged; it becomes expired. Paid meanwhile: the answer is the paid order or invalid_request; then cancel only under cancel.penalty, with the user's yes. payment_in_progress: read it again shortly. Repeat calls answer the order as it is.`,
2360
+ description: `Cancel a paid order under its terms, or close an unpaid one. Paid (cancel.reason cancellable): only after the user confirmed the order's cancel.penalty and cancel.refund with a clear yes, pass maximumPenalty, that cancel.penalty exactly as returned. The order becomes cancelling, then cancelled with cancel.refund refunded, or confirmed with reason refused if the hotel refuses: poll get_order. cancellation_changed: the penalty rose above maximumPenalty and nothing changed; ask the user again. Never state a refund the order did not return. Unpaid (cancel.reason unpaid): close it, without maximumPenalty, only once the user says they no longer want it; nothing is charged and it becomes expired. If it was paid meanwhile, the answer is the paid order, invalid_request, order_not_cancellable or order_in_progress: cancel it only under its cancel.penalty, with the user's yes. payment_in_progress: read it again shortly. Repeat calls answer the order as it is.`,
2342
2361
  annotations: {
2343
2362
  readOnlyHint: false,
2344
2363
  idempotentHint: true,
@@ -2351,7 +2370,7 @@ var TOOLS = [
2351
2370
  {
2352
2371
  name: "pay_order",
2353
2372
  title: "Pay order",
2354
- description: `Pay an order without its link, by one of its payment.methods: a shared payment token, or Alipay/WeChat Pay (method stripe_alipay_wechat_pay). Token: only if 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 total and currency, 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 the entry's handler config.business_profile and limits; pass it with price.total. Wallet: pass method, price.total; show the wallet entry (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. Success closes payment.url; failure leaves it 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.`,
2373
+ description: `Pay a USD order without its link, by one of its payment.methods: a Stripe shared payment token, only if you can request one from the user's Link wallet (US and Canadian accounts; never ask the user for one), or Alipay/WeChat Pay (method stripe_alipay_wechat_pay). Call it only after the user confirmed the order's total and currency, the stay with each room's guests, the contact, any special requests and every term with a clear yes. Token: request it with the entry's handler config.business_profile and limits, and pass it with price.total; a token pays one order. Wallet: pass method and price.total, then show the entry it returns: the WeChat code as an image if you can, and both links; the user pays once, by either. A code lasts ${LIMITS.wechatCodeMinutes} minutes; then the WeChat link opens a new one, or call again. Pay one way only: success closes payment.url, a failure leaves it open, and each error says how to recover. Then poll get_order.`,
2355
2374
  annotations: {
2356
2375
  readOnlyHint: false,
2357
2376
  idempotentHint: true,
@@ -2670,7 +2689,7 @@ var CANCEL_REASON_WORDS = {
2670
2689
  cancellable: "it can be cancelled",
2671
2690
  unpaid: "it isn't paid: it can be closed if the user no longer wants it",
2672
2691
  already_cancelled: "it is already cancelled",
2673
- in_progress: "a cancellation is in progress",
2692
+ in_progress: "the booking is still being confirmed, or a cancellation is under way; read the order again later",
2674
2693
  not_confirmed: "only a confirmed order that is paid can be cancelled",
2675
2694
  stay_started: `the stay has started; ${SUPPORT}`,
2676
2695
  non_refundable: "this rate can't be cancelled",
@@ -2692,10 +2711,22 @@ function itemLines(item) {
2692
2711
  `time zone ${h.timeZone ?? "not listed"}`
2693
2712
  ].join(" \xB7 "),
2694
2713
  `Room: ${h.room.name ? h.room.name.text : "room name not listed"} \xB7 ${h.room.beds ? `beds: ${h.room.beds.text}` : "beds not listed"}`,
2714
+ guestsLine(h.rooms),
2715
+ `Special requests: ${h.specialRequests === null ? "none" : h.specialRequests.replace(/\s+/g, " ").trim()}`,
2695
2716
  `Terms: ${mealsWithLabel(h.meals)} \xB7 ${cancellationText(h.cancellation)} \xB7 ${feesText(h.payAtProperty)}`,
2696
2717
  `Hotel confirmation number: ${h.confirmationNumber ?? "none yet"}`
2697
2718
  ];
2698
2719
  }
2720
+ function guestsLine(rooms) {
2721
+ const names2 = rooms.map((r) => (r.guests ?? []).map((g) => `${g.firstName} ${g.lastName}`).join(", "));
2722
+ if (names2.every((n) => n === "")) return "Guests: none named yet";
2723
+ if (names2.length === 1) return `Guests: ${names2[0]}`;
2724
+ return `Guests: ${names2.map((n, i) => `room ${i + 1} ${n || "none named yet"}`).join("; ")}`;
2725
+ }
2726
+ function contactLine(c) {
2727
+ if (c === null) return "Contact: none on record yet";
2728
+ return `Contact: ${c.name} \xB7 ${c.email ?? "no email on record"} \xB7 ${c.phone ?? "no phone on record"}`;
2729
+ }
2699
2730
  function paymentLines(o, surface) {
2700
2731
  const p = o.payment;
2701
2732
  const lines = [
@@ -2713,7 +2744,7 @@ function paymentLines(o, surface) {
2713
2744
  ].filter(Boolean);
2714
2745
  lines.push(`Payment link (${about.join("; ")}): ${p.url}`);
2715
2746
  } else if (o.status === "awaiting_payment" && p.status === "unpaid") {
2716
- lines.push("Payment link: could not be read this time; read this order again for it.");
2747
+ lines.push("Payment link: none while a payment is being processed; read this order again shortly.");
2717
2748
  }
2718
2749
  const token = methodOf(o, "stripe_shared_payment_token");
2719
2750
  if (token) lines.push(tokenLine(o, token, surface));
@@ -2726,11 +2757,7 @@ function paymentLines(o, surface) {
2726
2757
  function tokenLine(o, token, surface) {
2727
2758
  const { handler: h, limits } = token;
2728
2759
  const pay = surface === "cli" ? `\`fortrip orders pay ${o.orderId} --token <spt_\u2026> --total ${o.price.total.amount}\`` : "pay_order";
2729
- return [
2730
- `Pay without the link: ${pay} with a shared payment token via ${h.type} (handler ${h.id}, business_profile ${h.config.business_profile}); token limits: maxAmount ${limits.maxAmount} (cents), currency ${limits.currency}, expiresAt ${limits.expiresAt}.`,
2731
- "Only if you have a tool that can request the token from the user's Link wallet (US and Canadian Link accounts); otherwise give the payment link, and never ask the user to create, type or paste a token.",
2732
- `First show the user the total and currency, the stay and every term, and wait for a clear yes. Pay one way only: the link or ${surface === "cli" ? "`fortrip orders pay`" : "pay_order"}.`
2733
- ].join(" ");
2760
+ return `Pay without the link: ${pay} with a shared payment token via ${h.type} (handler ${h.id}, business_profile ${h.config.business_profile}); token limits: maxAmount ${limits.maxAmount} (cents), currency ${limits.currency}, expiresAt ${limits.expiresAt}.`;
2734
2761
  }
2735
2762
  function walletLines(w, surface) {
2736
2763
  const c = CALLS[surface];
@@ -2772,6 +2799,7 @@ function orderLines(o, surface = "mcp") {
2772
2799
  return [
2773
2800
  `Order ${o.orderId} \xB7 reference ${o.reference} \xB7 ${label(ORDER_STATUS_WORDS, o.status)} \xB7 created ${when(o.createdAt, null)} \xB7 updated ${when(o.updatedAt, null)}`,
2774
2801
  ...o.items.flatMap(itemLines),
2802
+ contactLine(o.contact),
2775
2803
  ...paymentLines(o, surface)
2776
2804
  ];
2777
2805
  }
@@ -2930,6 +2958,15 @@ function hotelLine(h, i, r) {
2930
2958
  h.hotelId
2931
2959
  ].filter(Boolean).join(" \xB7 ");
2932
2960
  }
2961
+ var HINT_REASONS = {
2962
+ request_location: "this request comes from mainland China",
2963
+ sign_in_location: "the user's latest sign-in to Fortrip was from mainland China"
2964
+ };
2965
+ function currencyHintLine(hint, surface) {
2966
+ const reason = HINT_REASONS[hint.reason];
2967
+ const again = surface === "cli" ? "search and get offers with --currency CNY" : "search and get offers with currency CNY";
2968
+ return `Currency: ${reason ? `${reason}. ` : ""}Prices are also available in CNY, paid through payment channels in mainland China; if the user may pay that way, offer them CNY prices: ${again}.`;
2969
+ }
2933
2970
  function renderSearch(r, surface = "mcp") {
2934
2971
  const lines = [header(r)];
2935
2972
  lines.push(
@@ -2966,6 +3003,7 @@ function renderSearch(r, surface = "mcp") {
2966
3003
  "",
2967
3004
  r.nextCursor === null ? "Last page." : surface === "cli" ? `Next page: run again with only --cursor ${r.nextCursor} and, optionally, --limit.` : `Next page: call again with only the cursor and, optionally, limit: { cursor: "${r.nextCursor}" }.`
2968
3005
  );
3006
+ if (r.currencyHint?.currency === "CNY") lines.push("", currencyHintLine(r.currencyHint, surface));
2969
3007
  return lines.join("\n");
2970
3008
  }
2971
3009
 
@@ -3100,7 +3138,7 @@ function detailLines(e, surface) {
3100
3138
  return [`Order ${e.details.orderId}: read it with ${getOrder(e.details.orderId)} in a few seconds.`];
3101
3139
  case "payment_total_changed":
3102
3140
  return [
3103
- `Order ${e.details.orderId} totals ${money2(e.details.total)}, not the total sent: confirm this total with the user, then ${surface === "cli" ? `run \`fortrip orders pay ${e.details.orderId} --token <spt_\u2026> --total ${e.details.total.amount}\` again with the same token` : "call pay_order again with it and the same token"}. Nothing was charged.`
3141
+ `Order ${e.details.orderId} totals ${money2(e.details.total)}, not the total sent: confirm this total with the user, then ${surface === "cli" ? `run the same \`fortrip orders pay ${e.details.orderId}\` command again with \`--total ${e.details.total.amount}\`` : "call pay_order again with it, the same way (the same token, or method stripe_alipay_wechat_pay)"}. Nothing was charged.`
3104
3142
  ];
3105
3143
  case "payment_credential_invalid":
3106
3144
  return [
@@ -3312,7 +3350,7 @@ var ME_SCOPES = { email: "email", name: "profile" };
3312
3350
  // package.json
3313
3351
  var package_default = {
3314
3352
  name: "@fortrip/agent-contract",
3315
- version: "5.1.0",
3353
+ version: "5.3.0-rc.0",
3316
3354
  license: "Apache-2.0",
3317
3355
  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.",
3318
3356
  type: "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fortrip/agent-contract",
3
- "version": "5.1.0",
3
+ "version": "5.3.0-rc.0",
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",