@wiro-ai/wiro-agent-connectors 0.2.1 → 0.2.3-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +3 -3
  3. package/dist/vendors/adapty.js +5 -1
  4. package/dist/vendors/adjust.js +5 -1
  5. package/dist/vendors/apollo.js +5 -1
  6. package/dist/vendors/apple-appstore.js +58 -27
  7. package/dist/vendors/beehiiv.js +5 -1
  8. package/dist/vendors/blogger.js +5 -1
  9. package/dist/vendors/bluesky.js +5 -1
  10. package/dist/vendors/brevo.js +5 -1
  11. package/dist/vendors/calendarific.js +5 -1
  12. package/dist/vendors/devto.js +5 -1
  13. package/dist/vendors/facebook-pages.js +5 -1
  14. package/dist/vendors/firebase.js +5 -1
  15. package/dist/vendors/ga4.js +5 -1
  16. package/dist/vendors/gmail.js +5 -1
  17. package/dist/vendors/google-ads.js +5 -1
  18. package/dist/vendors/google-business.js +5 -1
  19. package/dist/vendors/google-calendar.js +5 -1
  20. package/dist/vendors/google-drive.js +5 -1
  21. package/dist/vendors/google-merchant-center.js +5 -1
  22. package/dist/vendors/google-play.js +39 -14
  23. package/dist/vendors/google-search-console.js +5 -1
  24. package/dist/vendors/hashnode.js +5 -1
  25. package/dist/vendors/instagram.js +5 -1
  26. package/dist/vendors/kaggle.js +5 -1
  27. package/dist/vendors/keepa.js +5 -1
  28. package/dist/vendors/linkedin.js +5 -1
  29. package/dist/vendors/mailchimp.js +5 -1
  30. package/dist/vendors/mastodon.js +5 -1
  31. package/dist/vendors/meta-ads.js +5 -1
  32. package/dist/vendors/notion.js +5 -1
  33. package/dist/vendors/pinterest.js +5 -1
  34. package/dist/vendors/qiita.js +5 -1
  35. package/dist/vendors/reddit.js +5 -1
  36. package/dist/vendors/revenuecat.js +5 -1
  37. package/dist/vendors/roasit.js +5 -1
  38. package/dist/vendors/sendgrid.js +5 -1
  39. package/dist/vendors/serper.js +6 -2
  40. package/dist/vendors/shopify.js +5 -1
  41. package/dist/vendors/threads.js +5 -1
  42. package/dist/vendors/tiktok.js +5 -1
  43. package/dist/vendors/tumblr.js +5 -1
  44. package/dist/vendors/twitter.js +5 -1
  45. package/dist/vendors/woocommerce.js +5 -1
  46. package/dist/vendors/wordpress.js +5 -1
  47. package/dist/vendors/youtube.js +5 -1
  48. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.3-rc.1 (2026-11-27)
4
+
5
+ - `serper`: `web_search` has a shorter, clearer description (295 characters, was 397). It says that the answer box, knowledge graph, related questions and related searches come on the first page only, and a host that shows the first 300 characters of a tool description now shows all of it.
6
+
7
+ ## 0.2.2 (2026-11-27)
8
+
9
+ - A JSON:API error reply (App Store Connect's, for one) now gives its `detail`, or else its `title`, as the vendor's words in the error, as a `message` already did: "App Store Connect refused the request (HTTP 403): The API key in use does not allow this request."
10
+ - `apple-appstore`: `get_app_metadata` returns what the key's role can read and leaves out, with a line in `notes`, a part App Store Connect refuses with HTTP 403 (app info, versions, version texts); only the app's own record still fails the call. `list_subscriptions` and `list_in_app_purchases` say on a 403 that reading them needs a key with the Admin or App Manager role, instead of a bare refusal.
11
+ - `google-play`: `list_in_app_products` reads the one-time products by default (`catalog: one_time_products`); the legacy in-app products API stays as `catalog: in_app_products`. Google Play answers that API, and others of the legacy publishing API, with HTTP 403 "Please migrate to the new publishing API." for an app whose catalog has moved: the error now says so and where the products are read, instead of asking to invite the service account. `get_store_listing` answers `available: false` with a note for an app with no public store page in the country (HTTP 404), instead of an error.
12
+
3
13
  ## 0.2.1 (2026-11-25)
4
14
 
5
15
  - The package names its entry in the official MCP Registry, `ai.wiro/agent-connectors`, in `mcpName`, and `server.json` describes it there: the connector is the first argument, with every connector's name as a choice, and `CONNECTOR_ACCOUNTS` is the optional account lock.
package/README.md CHANGED
@@ -274,7 +274,7 @@ Every tool carries honest MCP annotations, derived from what it does: a read too
274
274
  | Tool | Kind | What it does |
275
275
  | --- | --- | --- |
276
276
  | `list_apps` | read | The apps the key can see: Apple ID, name, bundle ID, SKU, primary locale, with `selected: true` on the apps chosen for the connection. Lists the candidates of the `apps` account picker. |
277
- | `get_app_metadata` | read | What an app is: its record, app info for one locale (subtitle, categories, age rating, privacy URL), latest versions, the live version's description, keywords, promotional text and what's new, and the public App Store listing of one country (price, genre, rating, rating count, live description). |
277
+ | `get_app_metadata` | read | What an app is: its record, app info for one locale (subtitle, categories, age rating, privacy URL), latest versions, the live version's description, keywords, promotional text and what's new, and the public App Store listing of one country (price, genre, rating, rating count, live description). A part the key's role cannot read is left out, and `notes` says which. |
278
278
  | `list_subscriptions` | read | Auto-renewable subscriptions, group by group (or one group), with their current price in one territory (default USA), their introductory offers (free trial, pay as you go, pay up front) and whether one on the page has a free trial; pages with a cursor. |
279
279
  | `list_in_app_purchases` | read | Consumable, non-consumable and non-renewing purchases: name, product ID, type, state, and the current price in one territory (manual, or the automatic equalized one); up to 20 a page with prices. |
280
280
  | `list_reviews` | read | Customer reviews with rating, title, text, nickname, territory, date and the developer response; filters for rating, territory and answered or not. |
@@ -600,10 +600,10 @@ Every tool carries honest MCP annotations, derived from what it does: a read too
600
600
  | `list_reviews` | read | Reviews with text from the last week, newest first, with stars, language, app version, device and the developer reply; only unanswered ones on request; translated on request. |
601
601
  | `get_review` | read | One review with its reply. |
602
602
  | `reply_to_review` | update | Posts the reply to a review, or replaces the earlier one: up to 350 characters of plain text. |
603
- | `get_store_listing` | read | The live store listing as people see it, from the app's public store page in one language and country: title, short and full description, category, developer, content rating, star rating, price and icon. It opens no edit and needs no Play Console permission. |
603
+ | `get_store_listing` | read | The live store listing as people see it, from the app's public store page in one language and country: title, short and full description, category, developer, content rating, star rating, price and icon. It opens no edit and needs no Play Console permission. An app with no public store page in that country gives `available: false`. |
604
604
  | `update_store_listing` | update | Changes the listing in one language (title, short or full description, video) in an edit and commits it; Google Play reviews the change before it shows on the store page. |
605
605
  | `list_subscriptions` | read | Subscriptions with listings, base plans (state, billing period, price in one country) and offers with their phases, and whether an active offer starts with a free trial. |
606
- | `list_in_app_products` | read | In-app products (sku, status, name, default and regional price), or the newer one-time products with their purchase options. |
606
+ | `list_in_app_products` | read | One-time products with their purchase options and regional price (the default), or the legacy in-app products (sku, status, name, default and regional price), which Google Play no longer serves for an app whose catalog has moved to one-time products. |
607
607
  | `api_get` | read | Any other GET of the Android Developer API under `/androidpublisher/v3/applications/{packageName}/` for a chosen app, such as tracks in an edit or a purchase. |
608
608
  | `api_request` | write | A POST, PUT, PATCH or DELETE under the same paths, for a chosen app. User and permission management (`/androidpublisher/v3/developers/`) is left out. Sent once, never retried. |
609
609
 
@@ -222,7 +222,11 @@ function vendorMessage(data) {
222
222
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
223
223
  }
224
224
  if (Array.isArray(record["errors"])) {
225
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
225
+ const messages = record["errors"].map((item) => {
226
+ if (typeof item === "string") return item;
227
+ const entry = item;
228
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
229
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
226
230
  if (messages.length) return cleanVendorText(messages.join("; "));
227
231
  }
228
232
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -429,7 +429,11 @@ function vendorMessage(data) {
429
429
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
430
430
  }
431
431
  if (Array.isArray(record["errors"])) {
432
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
432
+ const messages = record["errors"].map((item) => {
433
+ if (typeof item === "string") return item;
434
+ const entry = item;
435
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
436
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
433
437
  if (messages.length) return cleanVendorText(messages.join("; "));
434
438
  }
435
439
  return void 0;
@@ -1219,7 +1223,7 @@ async function applePage(h, api, options) {
1219
1223
  const state = h.cursor(options.cursor);
1220
1224
  const appleCursor = typeof state?.["c"] === "string" ? state["c"] : void 0;
1221
1225
  const skip = typeof state?.["o"] === "number" ? state["o"] : 0;
1222
- const data = await api.get(options.path, { ...options.query, ...appleCursor ? { cursor: appleCursor } : {} });
1226
+ const data = await api.get(options.path, { ...options.query, ...appleCursor ? { cursor: appleCursor } : {} }, options.errors);
1223
1227
  const items = (Array.isArray(data?.data) ? data.data : []).map((item) => options.map(item, data)).slice(skip);
1224
1228
  if (options.enrich) await options.enrich(items);
1225
1229
  const next = nextAppleCursor(data);
@@ -1620,6 +1624,21 @@ async function uploadEventImage(h, api, args) {
1620
1624
 
1621
1625
  // src/vendors/apple-appstore/metadata.ts
1622
1626
  var LIVE_STATES = /* @__PURE__ */ new Set(["READY_FOR_SALE", "READY_FOR_DISTRIBUTION"]);
1627
+ var ROLE_NEEDED = "an App Store Connect key with the Admin or App Manager role";
1628
+ function roleRefusal(what) {
1629
+ return `Reading ${what} needs ${ROLE_NEEDED}, and the connected key's role does not allow it`;
1630
+ }
1631
+ async function optionalPart(notes, what, read) {
1632
+ try {
1633
+ return await read();
1634
+ } catch (error) {
1635
+ if (error instanceof ToolFailure && error.details.status === 403) {
1636
+ notes.push(`${what[0]?.toUpperCase()}${what.slice(1)} left out: reading it needs ${ROLE_NEEDED}, and the connected key's role does not allow it (HTTP 403).`);
1637
+ return void 0;
1638
+ }
1639
+ throw error;
1640
+ }
1641
+ }
1623
1642
  function trimAppInfo(item, localizations, locale) {
1624
1643
  const a = item?.attributes ?? {};
1625
1644
  const refs = Array.isArray(item?.relationships?.appInfoLocalizations?.data) ? item.relationships.appInfoLocalizations.data : [];
@@ -1692,41 +1711,47 @@ async function appMetadata(h, api, args) {
1692
1711
  }, { 404: `App Store Connect has no app ${appId} that this key can see` });
1693
1712
  const a = app?.data?.attributes ?? {};
1694
1713
  const locale = args.locale ?? (typeof a.primaryLocale === "string" ? a.primaryLocale : "en-US");
1695
- const infos = await api.get(`/v1/apps/${appId}/appInfos`, {
1714
+ const notes = [];
1715
+ const infos = await optionalPart(notes, "the app info (subtitle, categories, age rating, privacy policy URL)", () => api.get(`/v1/apps/${appId}/appInfos`, {
1696
1716
  include: "appInfoLocalizations,primaryCategory,secondaryCategory",
1697
1717
  "fields[appInfos]": "appStoreState,state,appStoreAgeRating,appInfoLocalizations,primaryCategory,secondaryCategory",
1698
1718
  "fields[appInfoLocalizations]": "locale,name,subtitle,privacyPolicyUrl",
1699
1719
  "limit[appInfoLocalizations]": 50,
1700
1720
  limit: 5
1701
- });
1721
+ }));
1702
1722
  const infoLocalizations = includedMap(infos, "appInfoLocalizations");
1703
- const appInfos = (Array.isArray(infos?.data) ? infos.data : []).map((item) => trimAppInfo(item, infoLocalizations, locale));
1704
- const versionsReply = await api.get(`/v1/apps/${appId}/appStoreVersions`, {
1723
+ const appInfos = infos === void 0 ? void 0 : (Array.isArray(infos?.data) ? infos.data : []).map((item) => trimAppInfo(item, infoLocalizations, locale));
1724
+ const versionsReply = await optionalPart(notes, "the versions and their texts", () => api.get(`/v1/apps/${appId}/appStoreVersions`, {
1705
1725
  "fields[appStoreVersions]": "platform,versionString,appStoreState,appVersionState,releaseType,createdDate",
1706
1726
  limit: 5
1707
- });
1727
+ }));
1708
1728
  const versionItems = Array.isArray(versionsReply?.data) ? versionsReply.data : [];
1709
- const versions = versionItems.map(trimVersion);
1729
+ const versions = versionsReply === void 0 ? void 0 : versionItems.map(trimVersion);
1710
1730
  const shown = versionItems.find((item) => LIVE_STATES.has(item?.attributes?.appVersionState) || LIVE_STATES.has(item?.attributes?.appStoreState)) ?? versionItems[0];
1711
1731
  let versionLocalization;
1712
1732
  if (shown?.id) {
1713
- const localizations = await api.get(`/v1/appStoreVersions/${encodeURIComponent(shown.id)}/appStoreVersionLocalizations`, {
1714
- "filter[locale]": locale,
1715
- "fields[appStoreVersionLocalizations]": "locale,description,keywords,promotionalText,whatsNew,marketingUrl,supportUrl",
1716
- limit: 1
1717
- });
1733
+ const localizations = await optionalPart(notes, "the version texts (description, keywords, promotional text, what's new)", () => api.get(
1734
+ `/v1/appStoreVersions/${encodeURIComponent(shown.id)}/appStoreVersionLocalizations`,
1735
+ {
1736
+ "filter[locale]": locale,
1737
+ "fields[appStoreVersionLocalizations]": "locale,description,keywords,promotionalText,whatsNew,marketingUrl,supportUrl",
1738
+ limit: 1
1739
+ }
1740
+ ));
1718
1741
  const l = (Array.isArray(localizations?.data) ? localizations.data[0] : void 0)?.attributes;
1719
- versionLocalization = l ? compact({
1720
- versionId: shown.id,
1721
- versionString: shown.attributes?.versionString,
1722
- locale: l.locale,
1723
- description: text(l.description, 4e3),
1724
- keywords: l.keywords,
1725
- promotionalText: l.promotionalText,
1726
- whatsNew: text(l.whatsNew, 4e3),
1727
- marketingUrl: l.marketingUrl,
1728
- supportUrl: l.supportUrl
1729
- }) : { versionId: shown.id, locale, note: `The version has no ${locale} localization.` };
1742
+ if (localizations !== void 0) {
1743
+ versionLocalization = l ? compact({
1744
+ versionId: shown.id,
1745
+ versionString: shown.attributes?.versionString,
1746
+ locale: l.locale,
1747
+ description: text(l.description, 4e3),
1748
+ keywords: l.keywords,
1749
+ promotionalText: l.promotionalText,
1750
+ whatsNew: text(l.whatsNew, 4e3),
1751
+ marketingUrl: l.marketingUrl,
1752
+ supportUrl: l.supportUrl
1753
+ }) : { versionId: shown.id, locale, note: `The version has no ${locale} localization.` };
1754
+ }
1730
1755
  }
1731
1756
  return compact({
1732
1757
  app: compact({
@@ -1741,7 +1766,8 @@ async function appMetadata(h, api, args) {
1741
1766
  appInfos,
1742
1767
  versions,
1743
1768
  versionLocalization,
1744
- storeListing: args.include_store_listing ? await storeListing(h, appId, args.country) : void 0
1769
+ storeListing: args.include_store_listing ? await storeListing(h, appId, args.country) : void 0,
1770
+ notes: notes.length ? notes : void 0
1745
1771
  });
1746
1772
  }
1747
1773
  function summarizeOffers(refs, offers) {
@@ -1836,7 +1862,11 @@ var GROUPS_SHOWN = 50;
1836
1862
  async function subscriptions(h, api, args) {
1837
1863
  const appId = args.app_id;
1838
1864
  const territory = args.include_prices ? args.price_territory : void 0;
1839
- const groupsReply = await api.get(`/v1/apps/${appId}/subscriptionGroups`, { "fields[subscriptionGroups]": "referenceName", limit: 200 });
1865
+ const groupsReply = await api.get(
1866
+ `/v1/apps/${appId}/subscriptionGroups`,
1867
+ { "fields[subscriptionGroups]": "referenceName", limit: 200 },
1868
+ { 403: roleRefusal("the app's subscriptions") }
1869
+ );
1840
1870
  const allGroups = (Array.isArray(groupsReply?.data) ? groupsReply.data : []).filter((group) => typeof group?.id === "string").map((group) => ({ id: group.id, referenceName: group?.attributes?.referenceName }));
1841
1871
  const moreGroups = Boolean(nextAppleCursor(groupsReply));
1842
1872
  const groups = args.group_id ? allGroups.filter((group) => group.id === args.group_id) : allGroups;
@@ -2247,7 +2277,7 @@ var connector = defineConnector({
2247
2277
  name: "get_app_metadata",
2248
2278
  kind: "read",
2249
2279
  title: "Get App Store app details",
2250
- description: "What an app is: its App Store Connect record (name, bundle ID, primary locale), app info (subtitle, categories, age rating, privacy URL) for one locale, its latest versions, the description, keywords, promotional text and what's new of the live version (or the newest), and, from the public App Store listing of one country, its price, genre, rating, rating count and live description. Up to five requests.",
2280
+ description: "What an app is: its App Store Connect record (name, bundle ID, primary locale), app info (subtitle, categories, age rating, privacy URL) for one locale, its latest versions, the description, keywords, promotional text and what's new of the live version (or the newest), and, from the public App Store listing of one country, its price, genre, rating, rating count and live description. Up to five requests. A part the key's role cannot read (App Store Connect answers HTTP 403) is left out, and notes says which and what key reads it.",
2251
2281
  inputSchema: {
2252
2282
  type: "object",
2253
2283
  properties: {
@@ -2311,6 +2341,7 @@ var connector = defineConnector({
2311
2341
  return applePage(h, api, {
2312
2342
  key: "inAppPurchases",
2313
2343
  path: `/v1/apps/${args.app_id}/inAppPurchasesV2`,
2344
+ errors: { 403: roleRefusal("the app's in-app purchases") },
2314
2345
  query: {
2315
2346
  "fields[inAppPurchases]": "name,productId,inAppPurchaseType,state,familySharable",
2316
2347
  "filter[inAppPurchaseType]": args.type,
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -222,7 +222,11 @@ function vendorMessage(data) {
222
222
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
223
223
  }
224
224
  if (Array.isArray(record["errors"])) {
225
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
225
+ const messages = record["errors"].map((item) => {
226
+ if (typeof item === "string") return item;
227
+ const entry = item;
228
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
229
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
226
230
  if (messages.length) return cleanVendorText(messages.join("; "));
227
231
  }
228
232
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -425,7 +425,11 @@ function vendorMessage(data) {
425
425
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
426
426
  }
427
427
  if (Array.isArray(record["errors"])) {
428
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
428
+ const messages = record["errors"].map((item) => {
429
+ if (typeof item === "string") return item;
430
+ const entry = item;
431
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
432
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
429
433
  if (messages.length) return cleanVendorText(messages.join("; "));
430
434
  }
431
435
  return void 0;
@@ -234,7 +234,11 @@ function vendorMessage(data) {
234
234
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
235
235
  }
236
236
  if (Array.isArray(record["errors"])) {
237
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
237
+ const messages = record["errors"].map((item) => {
238
+ if (typeof item === "string") return item;
239
+ const entry = item;
240
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
241
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
238
242
  if (messages.length) return cleanVendorText(messages.join("; "));
239
243
  }
240
244
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -425,7 +425,11 @@ function vendorMessage(data) {
425
425
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
426
426
  }
427
427
  if (Array.isArray(record["errors"])) {
428
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
428
+ const messages = record["errors"].map((item) => {
429
+ if (typeof item === "string") return item;
430
+ const entry = item;
431
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
432
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
429
433
  if (messages.length) return cleanVendorText(messages.join("; "));
430
434
  }
431
435
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -433,7 +433,11 @@ function vendorMessage(data) {
433
433
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
434
434
  }
435
435
  if (Array.isArray(record["errors"])) {
436
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
436
+ const messages = record["errors"].map((item) => {
437
+ if (typeof item === "string") return item;
438
+ const entry = item;
439
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
440
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
437
441
  if (messages.length) return cleanVendorText(messages.join("; "));
438
442
  }
439
443
  return void 0;
@@ -433,7 +433,11 @@ function vendorMessage(data) {
433
433
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
434
434
  }
435
435
  if (Array.isArray(record["errors"])) {
436
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
436
+ const messages = record["errors"].map((item) => {
437
+ if (typeof item === "string") return item;
438
+ const entry = item;
439
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
440
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
437
441
  if (messages.length) return cleanVendorText(messages.join("; "));
438
442
  }
439
443
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -433,7 +433,11 @@ function vendorMessage(data) {
433
433
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
434
434
  }
435
435
  if (Array.isArray(record["errors"])) {
436
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
436
+ const messages = record["errors"].map((item) => {
437
+ if (typeof item === "string") return item;
438
+ const entry = item;
439
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
440
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
437
441
  if (messages.length) return cleanVendorText(messages.join("; "));
438
442
  }
439
443
  return void 0;
@@ -1483,17 +1487,29 @@ var PACKAGE = {
1483
1487
  var REVIEW_ID = { type: "string", pattern: "^(?!\\.{1,2}$)[A-Za-z0-9:_.\\-]{1,512}$", description: "The review id, e.g. gp:AOqpTOE... from list_reviews." };
1484
1488
  var LANGUAGE = { type: "string", pattern: "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$", maxLength: 20, description: "A language code as Play uses it, e.g. en-US, tr-TR or es-419." };
1485
1489
  var REGION = { type: "string", pattern: "^[A-Z]{2}$", default: "US", description: "The country whose prices to show, e.g. US (default) or TR." };
1486
- function play(h, request) {
1490
+ var LEGACY_API_REFUSAL = /migrate to the new publishing API/i;
1491
+ async function play(h, request) {
1487
1492
  const who = serviceAccountWords(h);
1488
- return googleApi(h, SCOPES, {
1489
- ...request,
1490
- errors: {
1491
- 401: `Google Play did not accept ${who}: check that it is invited in Play Console -> Users and permissions`,
1492
- 403: `Google Play refused the request: invite ${who} in Play Console -> Users and permissions with access to this app and the permission the action needs (View app information to read, Reply to reviews to reply, Manage store presence for listings and products), and check that the Google Play Android Developer API is enabled for the key's project`,
1493
- 404: "Google Play found no such app or item: check the package name, and that the app is published on Google Play",
1494
- ...request.errors
1493
+ try {
1494
+ return await googleApi(h, SCOPES, {
1495
+ ...request,
1496
+ errors: {
1497
+ 401: `Google Play did not accept ${who}: check that it is invited in Play Console -> Users and permissions`,
1498
+ 403: `Google Play refused the request: invite ${who} in Play Console -> Users and permissions with access to this app and the permission the action needs (View app information to read, Reply to reviews to reply, Manage store presence for listings and products), and check that the Google Play Android Developer API is enabled for the key's project`,
1499
+ 404: "Google Play found no such app or item: check the package name, and that the app is published on Google Play",
1500
+ ...request.errors
1501
+ }
1502
+ });
1503
+ } catch (error) {
1504
+ if (error instanceof ToolFailure && error.details.status === 403 && LEGACY_API_REFUSAL.test(error.message)) {
1505
+ const products = /\/inappproducts(?:\/|$)/.test(request.path ?? "") ? " The app's one-time products are read with list_in_app_products (catalog one_time_products), which calls .../oneTimeProducts." : "";
1506
+ throw new ToolFailure(
1507
+ `Google Play no longer answers this legacy publishing API call for the app (HTTP 403): it said "Please migrate to the new publishing API."${products}` + (/ Nothing was changed\.$/.test(error.message) ? " Nothing was changed." : ""),
1508
+ error.details
1509
+ );
1495
1510
  }
1496
- });
1511
+ throw error;
1512
+ }
1497
1513
  }
1498
1514
  function packageFor(h, given) {
1499
1515
  if (given !== void 0) {
@@ -1535,7 +1551,10 @@ async function storePage(h, packageName, language, region) {
1535
1551
  html = utf8Decode(bytes);
1536
1552
  } catch (error) {
1537
1553
  if (error instanceof ToolFailure && /HTTP 404/.test(error.message)) {
1538
- throw new ToolFailure(`Google Play has no public store page for ${packageName} (HTTP 404): the app is not published yet, or not in the country ${region}.`);
1554
+ return {
1555
+ available: false,
1556
+ note: `Google Play has no public store page for ${packageName} in the country ${region} (HTTP 404): the app is not published yet, or not offered there.`
1557
+ };
1539
1558
  }
1540
1559
  throw error;
1541
1560
  }
@@ -1690,7 +1709,7 @@ var connector = defineConnector({
1690
1709
  name: "get_store_listing",
1691
1710
  kind: "read",
1692
1711
  title: "Get a Google Play store listing",
1693
- description: "Returns an app's live store listing as Google Play shows it to people, from its public store page: title, short and full description, category, developer, content rating, star rating, price and icon, in one language (an app without that translation shows its default language). A change made with update_store_listing shows here once Google Play's review has passed. An app that is not published has no store page.",
1712
+ description: "Returns an app's live store listing as Google Play shows it to people, from its public store page: title, short and full description, category, developer, content rating, star rating, price and icon, in one language (an app without that translation shows its default language). A change made with update_store_listing shows here once Google Play's review has passed. An app that is not published, or not offered in that country, has no store page: then available is false.",
1694
1713
  inputSchema: {
1695
1714
  type: "object",
1696
1715
  properties: {
@@ -1704,6 +1723,7 @@ var connector = defineConnector({
1704
1723
  const packageName = packageFor(h, args.package_name);
1705
1724
  const language = args.language ?? DEFAULT_LANGUAGE;
1706
1725
  const details = await storePage(h, packageName, language, args.region);
1726
+ if (details["available"] === false) return { packageName, language, region: args.region, ...details };
1707
1727
  return { packageName, language, region: args.region, url: `${STORE_PAGE}?id=${encodeURIComponent(packageName)}`, ...details };
1708
1728
  }
1709
1729
  },
@@ -1803,12 +1823,17 @@ var connector = defineConnector({
1803
1823
  name: "list_in_app_products",
1804
1824
  kind: "read",
1805
1825
  title: "List Google Play in-app products",
1806
- description: "Lists an app's one-time in-app products: sku, status, name and description, default price and the price in one country. catalog one_time_products reads the newer one-time products API instead (purchase options). Pass nextCursor back as cursor for more.",
1826
+ description: "Lists an app's one-time products (in-app products): product id, name and description, and each purchase option with its state and price in one country. catalog in_app_products reads the legacy in-app products API instead (sku, status, default price), which Google Play no longer answers for an app whose catalog has moved to one-time products. Pass nextCursor back as cursor for more.",
1807
1827
  inputSchema: {
1808
1828
  type: "object",
1809
1829
  properties: {
1810
1830
  package_name: PACKAGE,
1811
- catalog: { type: "string", enum: ["in_app_products", "one_time_products"], default: "in_app_products", description: "in_app_products (default) or one_time_products." },
1831
+ catalog: {
1832
+ type: "string",
1833
+ enum: ["one_time_products", "in_app_products"],
1834
+ default: "one_time_products",
1835
+ description: "one_time_products (default) or in_app_products (the legacy API)."
1836
+ },
1812
1837
  region: REGION,
1813
1838
  cursor: { type: "string", description: "nextCursor from the previous result." }
1814
1839
  },
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -222,7 +222,11 @@ function vendorMessage(data) {
222
222
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
223
223
  }
224
224
  if (Array.isArray(record["errors"])) {
225
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
225
+ const messages = record["errors"].map((item) => {
226
+ if (typeof item === "string") return item;
227
+ const entry = item;
228
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
229
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
226
230
  if (messages.length) return cleanVendorText(messages.join("; "));
227
231
  }
228
232
  return void 0;
@@ -425,7 +425,11 @@ function vendorMessage(data) {
425
425
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
426
426
  }
427
427
  if (Array.isArray(record["errors"])) {
428
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
428
+ const messages = record["errors"].map((item) => {
429
+ if (typeof item === "string") return item;
430
+ const entry = item;
431
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
432
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
429
433
  if (messages.length) return cleanVendorText(messages.join("; "));
430
434
  }
431
435
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -425,7 +425,11 @@ function vendorMessage(data) {
425
425
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
426
426
  }
427
427
  if (Array.isArray(record["errors"])) {
428
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
428
+ const messages = record["errors"].map((item) => {
429
+ if (typeof item === "string") return item;
430
+ const entry = item;
431
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
432
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
429
433
  if (messages.length) return cleanVendorText(messages.join("; "));
430
434
  }
431
435
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -425,7 +425,11 @@ function vendorMessage(data) {
425
425
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
426
426
  }
427
427
  if (Array.isArray(record["errors"])) {
428
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
428
+ const messages = record["errors"].map((item) => {
429
+ if (typeof item === "string") return item;
430
+ const entry = item;
431
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
432
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
429
433
  if (messages.length) return cleanVendorText(messages.join("; "));
430
434
  }
431
435
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -222,7 +222,11 @@ function vendorMessage(data) {
222
222
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
223
223
  }
224
224
  if (Array.isArray(record2["errors"])) {
225
- const messages = record2["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
225
+ const messages = record2["errors"].map((item) => {
226
+ if (typeof item === "string") return item;
227
+ const entry = item;
228
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
229
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
226
230
  if (messages.length) return cleanVendorText(messages.join("; "));
227
231
  }
228
232
  return void 0;
@@ -1184,7 +1188,7 @@ var webSearch = {
1184
1188
  name: "web_search",
1185
1189
  kind: "read",
1186
1190
  title: "Search the web (Google results via Serper)",
1187
- description: "Searches Google through Serper and returns the organic results (title, link, snippet, position, date), plus the answer box, knowledge graph, related questions and related searches when Google shows them. Options for country, language, location, freshness and the page. Read the pages themselves with a fetch tool. Each call uses one Serper credit. Pass nextCursor back as cursor for the next page.",
1191
+ description: "Searches Google through Serper: results with title, link, snippet, position and date, and on the first page any answer box, knowledge graph, related questions and related searches. Snippets only: fetch a page to read it. Each call uses one Serper credit. Pass nextCursor back as cursor for more.",
1188
1192
  inputSchema: {
1189
1193
  type: "object",
1190
1194
  properties: {
@@ -226,7 +226,11 @@ function vendorMessage(data) {
226
226
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
227
227
  }
228
228
  if (Array.isArray(record["errors"])) {
229
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
229
+ const messages = record["errors"].map((item) => {
230
+ if (typeof item === "string") return item;
231
+ const entry = item;
232
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
233
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
230
234
  if (messages.length) return cleanVendorText(messages.join("; "));
231
235
  }
232
236
  return void 0;
@@ -425,7 +425,11 @@ function vendorMessage(data) {
425
425
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
426
426
  }
427
427
  if (Array.isArray(record["errors"])) {
428
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
428
+ const messages = record["errors"].map((item) => {
429
+ if (typeof item === "string") return item;
430
+ const entry = item;
431
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
432
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
429
433
  if (messages.length) return cleanVendorText(messages.join("; "));
430
434
  }
431
435
  return void 0;
@@ -425,7 +425,11 @@ function vendorMessage(data) {
425
425
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
426
426
  }
427
427
  if (Array.isArray(record["errors"])) {
428
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
428
+ const messages = record["errors"].map((item) => {
429
+ if (typeof item === "string") return item;
430
+ const entry = item;
431
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
432
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
429
433
  if (messages.length) return cleanVendorText(messages.join("; "));
430
434
  }
431
435
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -421,7 +421,11 @@ function vendorMessage(data) {
421
421
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
422
422
  }
423
423
  if (Array.isArray(record["errors"])) {
424
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
424
+ const messages = record["errors"].map((item) => {
425
+ if (typeof item === "string") return item;
426
+ const entry = item;
427
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
428
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
425
429
  if (messages.length) return cleanVendorText(messages.join("; "));
426
430
  }
427
431
  return void 0;
@@ -425,7 +425,11 @@ function vendorMessage(data) {
425
425
  if (typeof nested === "string" && nested.trim()) return cleanVendorText(nested);
426
426
  }
427
427
  if (Array.isArray(record["errors"])) {
428
- const messages = record["errors"].map((item) => typeof item === "string" ? item : item?.message).filter((item) => typeof item === "string" && item.trim() !== "");
428
+ const messages = record["errors"].map((item) => {
429
+ if (typeof item === "string") return item;
430
+ const entry = item;
431
+ return [entry?.message, entry?.detail, entry?.title].find((value) => typeof value === "string" && value.trim() !== "");
432
+ }).filter((item) => typeof item === "string" && item.trim() !== "");
429
433
  if (messages.length) return cleanVendorText(messages.join("; "));
430
434
  }
431
435
  return void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wiro-ai/wiro-agent-connectors",
3
- "version": "0.2.1",
3
+ "version": "0.2.3-rc.1",
4
4
  "mcpName": "ai.wiro/agent-connectors",
5
5
  "description": "Dependency-free MCP connectors for services without an official MCP server. One small module per service, runnable over stdio with npx or loadable into your own MCP host.",
6
6
  "keywords": [