@buygolinks/mcp 0.8.0 → 0.9.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/README.md CHANGED
@@ -77,7 +77,7 @@ Most MCP clients use the same shape. Point them at the `npx -y @buygolinks/mcp`
77
77
  | `list_campaigns` / `create_campaign` / `get_campaign` / `update_campaign` / `delete_campaign` | Manage campaigns. One campaign = one tracked short link + N offers (weighted) + N optional landers + a per-campaign postback URL + a pixel snippet. |
78
78
  | `set_campaign_offers` / `set_campaign_landers` | Replace the campaign's offer/lander split. Items are `{ offer_id, weight }` / `{ lander_id, weight }`. |
79
79
  | `get_campaign_stats` | Full campaign report: visits, lander views, offer clicks, conversions, revenue, cost, profit, CTR/CR/EPC/ROI, breakdowns, recent events. |
80
- | `list_properties` / `create_property` / `get_property` / `update_property` / `delete_property` | Manage **properties** — GTM/GA-style site containers. One property = one universal tag (`/t.js?p={key}`) the user installs on every page of their site. Every page auto-reports pageviews, time-on-page, scroll, outbound clicks, and conversions; campaign traffic auto-attributes by click. `create_property` returns the install `snippet`. |
80
+ | `list_properties` / `create_property` / `get_property` / `update_property` / `delete_property` | Manage **properties** — GTM/GA-style site containers. One property = one universal tag (`/t.js?p={key}`) the user installs on every page of their site. Every page auto-reports pageviews, time-on-page, scroll, outbound clicks, and conversions; campaign traffic auto-attributes by click. `create_property` requires an active custom domain (the tag is served first-party from the user's own domain so it tracks on iOS/Safari) and returns the bound `tracking_domain` + install `snippet`. |
81
81
  | `set_property_campaigns` | Link/unlink campaigns to a property (many-to-many, for the source split in reports). Items are `{ campaign_id }`. |
82
82
  | `get_property_stats` | Full property report: page views, unique visitors, outbound, conversions, revenue, avg time/scroll, top pages, source split (organic vs campaign), country/device/browser/referrer breakdowns, recent events. |
83
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buygolinks/mcp",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "MCP server for buygolinks.com — create and manage branded short links with Amazon affiliate geo-routing from any MCP-compatible AI agent (Claude Desktop, Cursor, Cline, Continue, Hermes).",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -439,12 +439,13 @@ const TOOLS = [
439
439
  {
440
440
  name: 'create_property',
441
441
  description:
442
- 'Create a property (a GTM/GA-style site container). Returns the property with its public property_key and an install `snippet` — a single <script> tag the user pastes into the <head> of every page of their site. To record conversions, the site sets window.bglConversion = true (optionally window.bglRevenue) on a thank-you page, or calls window.bglFireConversion(revenue).',
442
+ 'Create a property (a GTM/GA-style site container). Returns the property with its public property_key, the `tracking_domain` it\'s bound to, and an install `snippet` — a single <script> tag the user pastes into the <head> of every page of their site. REQUIRES an active custom domain: the tag is served from the user\'s own domain so it stays first-party to their site, which is required for tracking to work on iOS/Safari (a tag loaded cross-site from buygolinks.com gets its visitor cookie partitioned/blocked). Defaults to the user\'s first active custom domain; pass `domain_id` (from list_domains) to pin a specific one. If the user has no active custom domain, returns error `domain_required` — have them add one via create_domain first. To record conversions, the site sets window.bglConversion = true (optionally window.bglRevenue) on a thank-you page, or calls window.bglFireConversion(revenue).',
443
443
  inputSchema: {
444
444
  type: 'object',
445
445
  properties: {
446
446
  name: { type: 'string' },
447
447
  site_url: { type: 'string', description: 'Optional primary site URL, informational.' },
448
+ domain_id: { type: 'number', description: 'Optional id of one of the user\'s active custom domains (from list_domains) to serve the tag from. Defaults to the first active custom domain.' },
448
449
  },
449
450
  required: ['name'],
450
451
  },
@@ -456,13 +457,14 @@ const TOOLS = [
456
457
  },
457
458
  {
458
459
  name: 'update_property',
459
- description: 'Update a property\'s name, site_url, or archive state.',
460
+ description: 'Update a property\'s name, site_url, tracking domain (domain_id), or archive state. Pass `domain_id` to re-bind the install snippet to a different active custom domain — it must be one of the user\'s active custom domains (a property can never fall back to buygolinks.com, since that breaks iOS tracking). Returns the updated property with its `tracking_domain` and regenerated `snippet`.',
460
461
  inputSchema: {
461
462
  type: 'object',
462
463
  properties: {
463
464
  property_id: { type: 'number' },
464
465
  name: { type: 'string' },
465
466
  site_url: { type: ['string', 'null'] },
467
+ domain_id: { type: 'number', description: 'Id of one of the user\'s active custom domains (from list_domains) to serve the tag from.' },
466
468
  archived: { type: 'boolean' },
467
469
  },
468
470
  required: ['property_id'],
@@ -732,6 +734,7 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
732
734
  case 'create_property': {
733
735
  const body = { name: args.name };
734
736
  if (typeof args.site_url === 'string') body.site_url = args.site_url;
737
+ if (typeof args.domain_id === 'number') body.domain_id = args.domain_id;
735
738
  result = await api('/api/properties', { method: 'POST', body: JSON.stringify(body) });
736
739
  break;
737
740
  }
@@ -743,6 +746,7 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
743
746
  const body = {};
744
747
  if (typeof args.name === 'string') body.name = args.name;
745
748
  if ('site_url' in args) body.site_url = args.site_url;
749
+ if (typeof args.domain_id === 'number') body.domain_id = args.domain_id;
746
750
  if (typeof args.archived === 'boolean') body.archived = args.archived;
747
751
  result = await api(`/api/properties/${Number(args.property_id)}`, { method: 'PATCH', body: JSON.stringify(body) });
748
752
  break;