Skip to content

Adapter: BigCommerce product pages #5

Description

@New1Direction

What

Add a bigcommerce.js adapter that turns BigCommerce storefront product pages into agent-callable WebMCP tools (get_product, get_price, check_stock, list_variants, add_to_cart).

Why it's valuable

BigCommerce powers several hundred thousand stores. Per ADAPTERS_WANTED.md (Easy column) it exposes a public /products/<slug>.js endpoint that behaves very much like Shopify's /products/<handle>.json. That makes it the lowest-risk way to add a second large e-commerce platform after Shopify, and it's an almost mechanical mirror of an adapter we already ship.

Where to start

  1. Copy the template: cp -r adapters/_template adapters/bigcommerce then rename to adapters/bigcommerce.js and set ID = "bigcommerce" (see adapters/_template/adapter.js + adapters/CONTRACT.md).
  2. Use adapters/shopify.js as the working reference — the structure (URL-regex detect(), JSON probe in extract(), buildTools(), live actions for price/stock/cart) maps almost 1:1. Keep the CHROME_UA header and credentials: "omit" from the contract's fetch-etiquette section.
  3. detect() must be synchronous and side-effect-free (no fetch) per CONTRACT.md — match the BigCommerce product-URL shape and return { adapter: ID, ... }. Note BigCommerce stores often serve from custom domains, so disambiguate via URL pattern + let the .js fetch confirm (same approach as Shopify).
  4. Capture a fixture into adapters/_fixtures/ per adapters/_fixtures/README.md (keep it under ~200KB, add the <!-- source: ... captured: ... --> comment) and add a detect() test (plus an extract() test mocking globalThis.fetch) to adapters/_test/run.mjs. Run node adapters/_test/run.mjs.
  5. Wire the import into the ADAPTERS list in worker/src/index.ts (most-specific first), as CONTRIBUTING.md step 7 describes.

Acceptance criteria

  • detect() returns a context for BigCommerce product URLs and null for unrelated URLs (no false positives — see CONTRACT.md "Detects sharply").
  • extract() returns { product, variants, tools } with at least get_price plus one actionable tool (add_to_cart).
  • At least one fixture in _fixtures/ and at least one test in _test/run.mjs that passes offline.
  • No npm deps, ES-module only, runs unmodified in Worker + extension (CONTRACT.md constraints).
  • Imported and registered in worker/src/index.ts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions