@chrischall/tripadvisor-mcp 0.5.0 → 0.6.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.
@@ -16,16 +16,29 @@ export function registerLocationTools(server) {
16
16
  const data = await client.get(`/locations${qs({ id: ids, locale })}`, { cache: 'static' });
17
17
  return viewResponse(view, data, 'locationList');
18
18
  });
19
+ // `view` belongs here, and its rung is the SUBTRACTIVE one — not
20
+ // `compactLocation`, even though that projector reads exactly this shape.
21
+ // `compactLocation` answers with the row `ta_search_locations` already
22
+ // returned beside the id you looked up, so running it here would drop the
23
+ // descriptions, phone, opening hours and coordinates that are the entire
24
+ // reason to call the detail endpoint: a "compact" rung that removes the
25
+ // record's whole point is worse than none. What this payload actually
26
+ // carries incidentally is the rating-star `traveler_ratings.overall
27
+ // .icon_url`, which `stripMediaUrls` drops without collapsing anything —
28
+ // the same case as `ta_get_location_reviews` below. (chrischall#77.)
19
29
  server.registerTool('ta_get_location_details', {
20
- description: 'Get full details for a TripAdvisor location: names, descriptions, address, coordinates, traveler ratings, phone, category, and listing URLs.',
30
+ description: 'Get full details for a TripAdvisor location: names, descriptions, address, coordinates, traveler ratings, ' +
31
+ 'phone, category, and listing URLs. Rating-icon and other incidental image URLs are dropped by default; ' +
32
+ 'pass view:"full" for TripAdvisor\'s whole record.',
21
33
  annotations: { readOnlyHint: true, openWorldHint: true },
22
34
  inputSchema: {
23
35
  locationId: LocationId,
24
36
  locale: LocaleList,
37
+ view: viewArg(),
25
38
  },
26
- }, async ({ locationId, locale }) => {
39
+ }, async ({ locationId, locale, view }) => {
27
40
  const data = await client.get(`/locations/${locationId}${qs({ locale })}`, { cache: 'static' });
28
- return minifiedResult(data);
41
+ return viewResponse(view, data);
29
42
  });
30
43
  // NO `view` on this tool, deliberately. Its product IS the image URLs: a
31
44
  // photos item is `{id, location_id, photo: {key, original_size_url, …}, …}`
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Single source of the server version. release-please bumps the literal below. */
2
- export const VERSION = '0.5.0'; // x-release-please-version
2
+ export const VERSION = '0.6.0'; // x-release-please-version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrischall/tripadvisor-mcp",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "mcpName": "io.github.chrischall/tripadvisor-mcp",
5
5
  "description": "TripAdvisor Terra API MCP server for Claude — search locations, details, photos, and reviews. Developed and maintained by AI (Claude Code).",
6
6
  "author": "Claude Code (AI) <https://www.anthropic.com/claude>",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/chrischall/tripadvisor-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.5.0",
9
+ "version": "0.6.0",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@chrischall/tripadvisor-mcp",
14
- "version": "0.5.0",
14
+ "version": "0.6.0",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },
@@ -52,15 +52,55 @@ npm install && npm run build
52
52
 
53
53
  | Tool | Use for |
54
54
  | --- | --- |
55
- | `ta_search_locations` | Find places by name — `query` required; filter with `category` (`RESTAURANT`/`ATTRACTION`/`HOTEL`), `country_code`, `geo_name`, `postal_code`, `locale`; page with `page`/`size` (max 20). `compact:true` → slim summaries. Returns matches with a location `id`. |
56
- | `ta_search_nearby` | Find places near a center — supply **one** of: `lat`+`lon`+`radius`, `location_id`+`radius`, or a `sw_lat`/`sw_lon`/`ne_lat`/`ne_lon` box (`unit` `MI`/`KM`); filter `category`, `min_rating`, `sort` (`distance`/`rating`), `include_photo`. `compact:true` supported. |
55
+ | `ta_search_locations` | Find places by name — `query` required; filter with `category` (`RESTAURANT`/`ATTRACTION`/`HOTEL`), `country_code`, `geo_name`, `postal_code`, `locale`; page with `page`/`size` (max 20). Returns matches with a location `id`. |
56
+ | `ta_search_nearby` | Find places near a center — supply **one** of: `lat`+`lon`+`radius`, `location_id`+`radius`, or a `sw_lat`/`sw_lon`/`ne_lat`/`ne_lon` box (`unit` `MI`/`KM`); filter `category`, `min_rating`, `sort` (`distance`/`rating`), `include_photo`. |
57
57
  | `ta_get_location_details` | Full listing for a location `id`: names, descriptions, address, coordinates, traveler ratings, phone, URLs. Optional `locale`. |
58
- | `ta_get_locations` | Batch details for **multiple** ids (`ids: [..]`, 1–50) in one call — cheaper than repeated details; unknown ids are omitted. `compact:true` supported. |
58
+ | `ta_get_locations` | Batch details for **multiple** ids (`ids: [..]`, 1–50) in one call — cheaper than repeated details; unknown ids are omitted. |
59
59
  | `ta_get_location_photos` | Photos (multi-size URLs, source, dimensions). Page with `page`/`size`. |
60
60
  | `ta_get_location_reviews` | Traveler reviews. Page with `page`/`size`. |
61
61
  | `ta_web_healthcheck` | Diagnose the optional tripadvisor.com browser-bridge connection (fetchproxy Transporter). Reports bridge role/port/timing and an actionable hint if it's not connected. |
62
62
  | `ta_web_get_location` | Get a location's details (rating, review count, address, coordinates, phone, photo, URL) from its public TripAdvisor page via the browser bridge — **works without an API key**. Covers attractions/hotels/restaurants; no individual review text. |
63
63
 
64
+ ## Response shape
65
+
66
+ `ta_search_locations`, `ta_search_nearby`, `ta_get_locations` and
67
+ `ta_get_location_reviews` take `view: "compact" | "full"`, and **`compact` is
68
+ the default** — the slim rung is what you get without asking for it. Pass
69
+ `view: "full"` for TripAdvisor's whole records.
70
+
71
+ The compact rung is not the same operation on all four:
72
+
73
+ - `ta_search_locations`, `ta_search_nearby` and `ta_get_locations` run a real
74
+ field projection over each Terra location, keeping `id`, `name`, `category`
75
+ (derived from the listing URL prefix), `geo`, `city`, `state`, `rating`,
76
+ `review_count` and `url` — plus `distance_miles` / `distance_kilometers` on
77
+ nearby results. `pagination` is preserved. On an unexpected shape the
78
+ projection warns to stderr and returns the raw payload rather than a page of
79
+ empties.
80
+ - `ta_get_location_reviews` has no projection, so its compact rung strips image
81
+ URLs — reviewer avatars and per-review snapshots — and leaves everything else,
82
+ review text included, exactly as TripAdvisor sent it.
83
+
84
+ The other four tools take no `view`, each for its own reason:
85
+
86
+ - `ta_get_location_photos` — its product **is** the image URLs. A photos item
87
+ hangs its whole payload off the `photo` media key, so stripping would not
88
+ shrink the response, it would empty it, leaving ids pointing at nothing.
89
+ - `ta_web_get_location` — the opposite case: it returns no upstream payload at
90
+ all. The page parser already projects down to a dozen named fields, and the
91
+ `image` among them is a deliberate pick from a page offering hundreds.
92
+ - `ta_get_location_details` — its compact rung would be the same location row
93
+ `ta_search_locations` already handed you with the `id`, so it would return
94
+ what you already have, on the one tool you call to get more than that.
95
+ - `ta_web_healthcheck` — it reports a diagnosis it assembles itself, not a
96
+ TripAdvisor record.
97
+
98
+ A rung that cannot change anything is worse than no parameter.
99
+
100
+ (This replaced an opt-in `compact: true` flag. Passing `compact` now does
101
+ nothing — zod drops the unknown key and you get the compact rung regardless,
102
+ which is what the flag used to ask for.)
103
+
64
104
  ## Workflow
65
105
 
66
106
  1. `ta_search_locations` (or `ta_search_nearby`) to get a location `id`.