@scavio/mcp-server 0.30.2 → 0.31.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.
- package/README.md +107 -6
- package/dist/tools/chewy.d.ts +3 -0
- package/dist/tools/chewy.js +36 -0
- package/dist/tools/chewy.js.map +1 -0
- package/dist/tools/harborfreight.d.ts +3 -0
- package/dist/tools/harborfreight.js +93 -0
- package/dist/tools/harborfreight.js.map +1 -0
- package/dist/tools/heb.js +10 -6
- package/dist/tools/heb.js.map +1 -1
- package/dist/tools/iherb.d.ts +3 -0
- package/dist/tools/iherb.js +43 -0
- package/dist/tools/iherb.js.map +1 -0
- package/dist/tools/index.d.ts +4 -4
- package/dist/tools/index.js +20 -4
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/menards.d.ts +3 -0
- package/dist/tools/menards.js +35 -0
- package/dist/tools/menards.js.map +1 -0
- package/dist/tools/petco.d.ts +3 -0
- package/dist/tools/petco.js +60 -0
- package/dist/tools/petco.js.map +1 -0
- package/dist/tools/petsmart.d.ts +3 -0
- package/dist/tools/petsmart.js +77 -0
- package/dist/tools/petsmart.js.map +1 -0
- package/dist/tools/wholefoods.d.ts +3 -0
- package/dist/tools/wholefoods.js +89 -0
- package/dist/tools/wholefoods.js.map +1 -0
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|

|
|
4
4
|

|
|
5
5
|
|
|
6
|
-
[Scavio](https://scavio.dev?utm_source=npm-mcp&utm_medium=package&utm_campaign=readme) is a unified [Web Search API](https://scavio.dev/docs/search-api?utm_source=npm-mcp&utm_medium=package&utm_campaign=readme) and MCP server that gives AI agents web search, page extraction, and structured data from e-commerce, social, travel, jobs, real-estate, app-store, ad-library and company-filing sources.
|
|
6
|
+
[Scavio](https://scavio.dev?utm_source=npm-mcp&utm_medium=package&utm_campaign=readme) is a unified [Web Search API](https://scavio.dev/docs/search-api?utm_source=npm-mcp&utm_medium=package&utm_campaign=readme) and MCP server that gives AI agents web search, page extraction, and structured data from e-commerce, social, travel, jobs, real-estate, app-store, ad-library and company-filing sources. 351 tools across 58 platforms plus Extract, map, crawl and batch, one API key.
|
|
7
7
|
|
|
8
|
-
**The 22 platforms added in 0.13.0 are opt-in.** Registering all
|
|
8
|
+
**The 22 platforms added in 0.13.0 are opt-in.** Registering all 351 tools puts ~355KB of tool definitions — roughly 89k tokens — into every session before you type anything. So the default is the platform set 0.12.x already had, plus Extract: 142 tools, 112KB. Upgrading never removes a tool you were using. Everything else is one env var away: see [Choosing which tools load](#choosing-which-tools-load).
|
|
9
9
|
|
|
10
10
|
## Remote MCP Server
|
|
11
11
|
|
|
@@ -207,8 +207,8 @@ Add to settings (`Cmd+,`):
|
|
|
207
207
|
|
|
208
208
|
## Choosing which tools load
|
|
209
209
|
|
|
210
|
-
Scavio exposes
|
|
211
|
-
roughly
|
|
210
|
+
Scavio exposes 351 tools. Loading all of them costs ~355KB of `tools/list` —
|
|
211
|
+
roughly 89k tokens of context in every session before the user has said anything,
|
|
212
212
|
and more tools than some clients will accept at all. So the server registers a
|
|
213
213
|
curated subset by default and lets you pick the rest. The sizes below are
|
|
214
214
|
measured, not estimated: `npm run toolslist` reproduces them.
|
|
@@ -218,7 +218,7 @@ measured, not estimated: `npm run toolslist` reproduces them.
|
|
|
218
218
|
| Value | Registers |
|
|
219
219
|
|-------|-----------|
|
|
220
220
|
| *(unset)* or `default` | Every platform 0.12.x had, plus `extract` — **142 tools, 112KB** |
|
|
221
|
-
| `all` | every platform — **
|
|
221
|
+
| `all` | every platform — **351 tools, ~355KB** |
|
|
222
222
|
| `extract,sec,g2` | just those platforms — 18 tools, 21KB |
|
|
223
223
|
| `default,zillow,metaads` | the default set plus two more — 148 tools, 120KB |
|
|
224
224
|
| `default,chatgpt,gemini` | the default set plus ChatGPT and Gemini — 144 tools, 115KB |
|
|
@@ -233,7 +233,7 @@ tells you to call to check the server works.
|
|
|
233
233
|
|
|
234
234
|
**Platform keys:** `extract`, `google`, `chatgpt`, `gemini`, `youtube`, `tiktok`, `instagram`,
|
|
235
235
|
`reddit`, `x`, `linkedin`, `threads`, `kuaishou`, `amazon`, `walmart`, `ebay`,
|
|
236
|
-
`target`, `homedepot`, `costco`, `heb`, `kroger`, `decathlon`, `specs`, `lowes`, `samsclub`, `canadiantire`, `dollargeneral`, `sephora`, `ulta`, `aldi`, `microcenter`, `walgreens`, `cvs`, `mercadolibre`, `tiktok-shop`, `booking`, `airbnb`,
|
|
236
|
+
`target`, `homedepot`, `costco`, `heb`, `kroger`, `decathlon`, `specs`, `lowes`, `samsclub`, `canadiantire`, `dollargeneral`, `sephora`, `ulta`, `aldi`, `microcenter`, `walgreens`, `cvs`, `wholefoods`, `harborfreight`, `petsmart`, `petco`, `iherb`, `chewy`, `menards`, `mercadolibre`, `tiktok-shop`, `booking`, `airbnb`,
|
|
237
237
|
`tripadvisor`, `yelp`, `zillow`, `redfin`, `realtor`, `rightmove`, `indeed`, `glassdoor`,
|
|
238
238
|
`appstore`, `googleplay`, `g2`, `capterra`, `trustpilot`, `googleads`, `metaads`, `sec`, `companieshouse`
|
|
239
239
|
|
|
@@ -739,6 +739,12 @@ not something Costco publishes, and only items Costco lists online are covered.
|
|
|
739
739
|
the store used is echoed in `data.store`, and `product_id` alone is enough with a
|
|
740
740
|
`store_id`. US only.
|
|
741
741
|
|
|
742
|
+
HEB Mexico: pass `country: "mx"` to `search_heb` and `get_heb_product` for
|
|
743
|
+
heb.com.mx. Prices are Mexican peso cents (`10000` = MX$100.00) for HEB Mexico's
|
|
744
|
+
default store, and every row adds `stock` (units on hand), `promotions` (price
|
|
745
|
+
cuts, multi-buys, free gifts, with end dates), `is_sponsored` and the EAN barcode
|
|
746
|
+
in `upc`. Search pages are 20 rows with `total_pages`. `get_heb_stores` is US only.
|
|
747
|
+
|
|
742
748
|
### Spec's
|
|
743
749
|
|
|
744
750
|
| Tool | Description |
|
|
@@ -886,6 +892,101 @@ cvs.com store page (e.g. `"7019"`). Search stock defaults to store 7019 (New
|
|
|
886
892
|
York). Prices are the same at every store. `get_cvs_product` can take 10-30+
|
|
887
893
|
seconds.
|
|
888
894
|
|
|
895
|
+
### Whole Foods Market
|
|
896
|
+
|
|
897
|
+
| Tool | Description |
|
|
898
|
+
|------|-------------|
|
|
899
|
+
| `search_whole_foods` | Search at one store: regular, sale and Prime member price, sale dates, on-sale and local flags, category and diet facets |
|
|
900
|
+
| `get_whole_foods_category` | One category at one store, same fields as search, with 6 sorts and on-sale and diet filters |
|
|
901
|
+
| `get_whole_foods_deals` | Every sale item at one store, store-wide or in one category |
|
|
902
|
+
| `get_whole_foods_product` | One product by ASIN, URL or slug: ingredients, nutrition facts, diets, plus that store's in-store and online prices as separate blocks |
|
|
903
|
+
| `get_whole_foods_stores` | Stores near a ZIP: store_id, address, phone, distance, in-store and pickup hours |
|
|
904
|
+
| `get_whole_foods_store` | One store: status, phone, Prime eligibility, opening date, address, sales flyer URL |
|
|
905
|
+
| `get_whole_foods_sales_flyer` | One store's current weekly flyer: each promotion's regular, sale and Prime price as printed, dates, ASINs covered |
|
|
906
|
+
|
|
907
|
+
1 credit per call. Prices are per 5-digit `store_id` (from
|
|
908
|
+
`get_whole_foods_stores`); without one, store `10145` (Austin) is used. Search
|
|
909
|
+
sorts only by relevance, `price_asc` or `price_desc`. No ratings, reviews, UPCs
|
|
910
|
+
or per-store unit stock.
|
|
911
|
+
|
|
912
|
+
### Harbor Freight
|
|
913
|
+
|
|
914
|
+
| Tool | Description |
|
|
915
|
+
|------|-------------|
|
|
916
|
+
| `search_harbor_freight` | Search by keyword and/or category: price, sale price and end date, public coupon price, Inside Track member price, compare-at price, rating, facets |
|
|
917
|
+
| `get_harbor_freight_clearance` | Clearance items, optionally narrowed by keyword, category or brand, same fields as search |
|
|
918
|
+
| `get_harbor_freight_product` | One product by item number, id or URL: every price above, UPC, specs, warranty, manuals, variants |
|
|
919
|
+
| `get_harbor_freight_prices` | Current prices for up to 50 item numbers in one call |
|
|
920
|
+
| `get_harbor_freight_stores` | Stores near a ZIP, "City, ST" or coordinates: store_id, address, phone, hours |
|
|
921
|
+
| `get_harbor_freight_availability` | Up to 20 items at chosen or nearest stores: stock status (in_stock, limited, out_of_stock, not_carried) and aisle |
|
|
922
|
+
| `get_harbor_freight_reviews` | Reviews for one item, newest first, with average rating and total count |
|
|
923
|
+
|
|
924
|
+
1 credit per call. Prices are national. Store stock is a status from a daily
|
|
925
|
+
snapshot (`inventory_updated_at`), not a unit count.
|
|
926
|
+
|
|
927
|
+
### PetSmart
|
|
928
|
+
|
|
929
|
+
| Tool | Description |
|
|
930
|
+
|------|-------------|
|
|
931
|
+
| `search_petsmart` | Search products: price, original and sale price, rating, how many stores stock it, pickup and Autoship eligibility; `store_id` lists only what that store has |
|
|
932
|
+
| `get_petsmart_product` | One product with every size/flavor: price, sale price and end date, Autoship first-order and recurring price, ship and pickup options |
|
|
933
|
+
| `get_petsmart_stores` | The 12 stores nearest a ZIP with hours and services; pass a `sku` for each store's unit count |
|
|
934
|
+
| `get_petsmart_store_stock` | Units at one store for up to 20 SKUs, plus a nearby store that has it |
|
|
935
|
+
| `get_petsmart_availability` | Unit counts for up to 20 store and SKU pairs in one call |
|
|
936
|
+
| `get_petsmart_deals` | The Sale section by pet, sale event or keyword, with the current sale events |
|
|
937
|
+
|
|
938
|
+
1 credit per call. Prices are national. The Sale section also lists points and
|
|
939
|
+
Autoship promotions, so `on_sale` marks the rows whose price is actually
|
|
940
|
+
reduced.
|
|
941
|
+
|
|
942
|
+
### Petco
|
|
943
|
+
|
|
944
|
+
| Tool | Description |
|
|
945
|
+
|------|-------------|
|
|
946
|
+
| `search_petco` | Search products: price, list price, Repeat Delivery (autoship) price, rating, fulfillment flags, every variation |
|
|
947
|
+
| `get_petco_category` | Products in a category path, e.g. `dog/dog-food/dry-dog-food`, same fields as search |
|
|
948
|
+
| `get_petco_product` | One product by part number or URL with every variant: cat_entry_id, UPC, prices, first-autoship price, ingredients, guaranteed analysis |
|
|
949
|
+
| `get_petco_stores` | Up to 10 stores nearest a ZIP: store_id, store number, address, hours |
|
|
950
|
+
| `get_petco_store_inventory` | Units on hand at one store for up to 10 products |
|
|
951
|
+
|
|
952
|
+
1 credit per call. Prices are national. `get_petco_store_inventory` takes
|
|
953
|
+
`cat_entry_id` values (from search or product), not part numbers, and a
|
|
954
|
+
`store_id` from `get_petco_stores` or a ZIP. `get_petco_product` and
|
|
955
|
+
`get_petco_category` can take 10-30 seconds.
|
|
956
|
+
|
|
957
|
+
### iHerb
|
|
958
|
+
|
|
959
|
+
| Tool | Description |
|
|
960
|
+
|------|-------------|
|
|
961
|
+
| `search_iherb` | Search by keyword: price, list price, discount, rating, review count, stock, badges, recent sales; brand filter |
|
|
962
|
+
| `get_iherb_product` | One product: UPC, price per serving, supplement facts, expiration date, best-seller rankings, variants |
|
|
963
|
+
| `get_iherb_prices` | Price, discount, stock, rating and review count for up to 50 products in one call |
|
|
964
|
+
| `get_iherb_reviews` | Rating summary: average, star histogram, counts per language, top positive and top critical review |
|
|
965
|
+
|
|
966
|
+
2 credits per call. US store, USD. iHerb is online only, so there are no store
|
|
967
|
+
tools. `get_iherb_reviews` is a summary, not a full review list.
|
|
968
|
+
|
|
969
|
+
### Chewy
|
|
970
|
+
|
|
971
|
+
| Tool | Description |
|
|
972
|
+
|------|-------------|
|
|
973
|
+
| `search_chewy` | Search or browse a category: one-time, Autoship and first-Autoship price, MAP price, per-unit price, rating, stock |
|
|
974
|
+
| `get_chewy_product` | One product by id or URL: every price above, review count and star distribution, GTIN, ingredients, every variant |
|
|
975
|
+
|
|
976
|
+
10 credits per call. Some broad queries go straight to a category; `redirect`
|
|
977
|
+
then names it. No store data.
|
|
978
|
+
|
|
979
|
+
### Menards
|
|
980
|
+
|
|
981
|
+
| Tool | Description |
|
|
982
|
+
|------|-------------|
|
|
983
|
+
| `get_menards_product` | One product by item id or URL: everyday and sale price, mail-in rebates (e.g. 11%), final price after rebates; `store_id` adds stock quantity and aisle |
|
|
984
|
+
| `get_menards_stores` | Stores near a ZIP or a city and state: store_id, address, distance, services |
|
|
985
|
+
|
|
986
|
+
1 credit per call; `get_menards_product` with `store_id` is 2 credits and can
|
|
987
|
+
take 10-40 seconds. There is no search: pass the item id from a menards.com
|
|
988
|
+
product URL (`p-60893666613.htm`).
|
|
989
|
+
|
|
889
990
|
### Kroger
|
|
890
991
|
|
|
891
992
|
| Tool | Description |
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { handleApiError } from "../lib/tool-error.js";
|
|
3
|
+
import { trimResponse } from "../lib/trim-response.js";
|
|
4
|
+
// Shapes mirror backend/src/routes/chewy.ts. Cross-field rules the backend
|
|
5
|
+
// enforces and zod here does not: search takes query OR category_id; product
|
|
6
|
+
// takes product_id OR url. Chewy has no stores. No zod `.default()`: the MCP
|
|
7
|
+
// SDK would post a defaulted field on every call.
|
|
8
|
+
const SORTS = ["relevance", "bestselling", "newest", "price_low", "price_high", "rating", "most_reviewed"];
|
|
9
|
+
export function registerChewyTools(server, getClient) {
|
|
10
|
+
const post = (path) => async (params) => {
|
|
11
|
+
try {
|
|
12
|
+
const data = await getClient().post(`/api/v1/chewy/${path}`, params);
|
|
13
|
+
return trimResponse(data);
|
|
14
|
+
}
|
|
15
|
+
catch (err) {
|
|
16
|
+
return handleApiError(err);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
server.tool("search_chewy", `Search Chewy products by keyword, or browse a category, 36 per page. Each result has the one-time price, offer and strike-through price, Autoship price and discount, first-Autoship price, discount and savings cap, MAP price and whether it is enforced, per-unit price, rating, rating count, in-stock flag, deal/new/exclusive/prescription flags, brand, image and product URL. Sponsored listings are removed (sponsored_removed counts them). When Chewy sends a query to a category page instead, redirect gives that category's id, name and URL and the results are that category's. sort echoes the order the results are actually in. Prices are in US dollars. Chewy has no store data. Use a result's product_id with get_chewy_product. 10 credits/call.`, {
|
|
20
|
+
query: z.string().min(1).max(200).optional()
|
|
21
|
+
.describe("Search keywords, e.g. 'kong classic dog toy'. Pass this or category_id. Some broad queries (e.g. 'dog food') go straight to a category; redirect then names it."),
|
|
22
|
+
category_id: z.string().min(1).max(200).optional()
|
|
23
|
+
.describe("Category to browse instead of a search: the number at the end of a chewy.com /b/ URL ('332' is Dog Food in /b/food-332), or that URL itself."),
|
|
24
|
+
page: z.number().int().min(1).max(100).optional()
|
|
25
|
+
.describe("Page, 1-based. 36 results per page."),
|
|
26
|
+
sort: z.enum(SORTS).optional()
|
|
27
|
+
.describe("relevance (default), bestselling, newest, price_low, price_high, rating or most_reviewed."),
|
|
28
|
+
}, post("search"));
|
|
29
|
+
server.tool("get_chewy_product", `One Chewy product by id or URL: one-time price, offer price, list and strike-through price with savings, MAP price and whether it is enforced, Autoship price and discount, first-Autoship price, discount and savings cap, per-unit price, in-stock flag, rating, rating count, review count and star distribution, brand, GTIN, description, key benefits, specifications, ingredients and feeding details where Chewy lists them, breadcrumbs, images, promotions, and every variant (size, flavor) with its own id, price, Autoship price and stock. Prices are in US dollars. An unknown product id is a 404. 10 credits.`, {
|
|
30
|
+
product_id: z.string().regex(/^\d{1,12}$/).optional()
|
|
31
|
+
.describe("Chewy product id: the number after /dp/ in the product URL, or a search result's product_id, e.g. '128666'. Pass this or url."),
|
|
32
|
+
url: z.string().url().max(500).optional()
|
|
33
|
+
.describe("A chewy.com product URL. Pass this or product_id."),
|
|
34
|
+
}, post("product"));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=chewy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chewy.js","sourceRoot":"","sources":["../../src/tools/chewy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,2EAA2E;AAC3E,6EAA6E;AAC7E,6EAA6E;AAC7E,kD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AAC,CACf,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,gmBAAgmB,EAChmB;QACE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;aAClD,QAAQ,CAAC,+HAA+H,CAAC;QAC5I,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;aACtC,QAAQ,CAAC,mDAAmD,CAAC;KACjE,EACD,IAAI,CAAC,SAAS,CAAC,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { handleApiError } from "../lib/tool-error.js";
|
|
3
|
+
import { trimResponse } from "../lib/trim-response.js";
|
|
4
|
+
// Shapes mirror backend/src/routes/harborfreight.ts. Cross-field rules the
|
|
5
|
+
// backend enforces and zod here does not: search takes query, category_id, or
|
|
6
|
+
// both; product takes sku, id or url; stores takes query OR latitude+longitude;
|
|
7
|
+
// availability takes store_ids, zip, or latitude+longitude. No zod
|
|
8
|
+
// `.default()`: the MCP SDK would post a defaulted field on every call.
|
|
9
|
+
const SORTS = ["best_match", "price_low", "price_high", "member_price_low", "member_price_high", "top_rated", "newest"];
|
|
10
|
+
const PRICE_FIELDS = "price (what the shelf charges now), regular_price, on_sale and clearance flags, sale (sale price, end date, savings, banner code; CLR is clearance), coupon (public coupon price, code, expiry and per-customer limit), member_deal (Inside Track Club member price) and compare_at (the competitor brand, model and price Harbor Freight quotes). Prices are national and in dollars.";
|
|
11
|
+
const sku = () => z.string().regex(/^\d{3,8}$/);
|
|
12
|
+
const listingFields = () => ({
|
|
13
|
+
category_id: z.string().regex(/^\d{1,7}$/).optional()
|
|
14
|
+
.describe("Harbor Freight category id, e.g. '1827' (Drills, Drivers & Drill Presses). Ids are the value of the category facet in any search answer."),
|
|
15
|
+
page: z.number().int().min(1).max(100).optional()
|
|
16
|
+
.describe("Page, 1-based."),
|
|
17
|
+
page_size: z.number().int().min(1).max(48).optional()
|
|
18
|
+
.describe("Results per page, 1-48. Default 36."),
|
|
19
|
+
sort: z.enum(SORTS).optional()
|
|
20
|
+
.describe("best_match (default), price_low, price_high, member_price_low, member_price_high (Inside Track Club price), top_rated or newest."),
|
|
21
|
+
brand: z.string().min(1).max(60).optional()
|
|
22
|
+
.describe("Only this brand, as listed in the brand facet, e.g. 'BAUER', 'HERCULES', 'PITTSBURGH'. Case-insensitive."),
|
|
23
|
+
});
|
|
24
|
+
export function registerHarborFreightTools(server, getClient) {
|
|
25
|
+
const post = (path) => async (params) => {
|
|
26
|
+
try {
|
|
27
|
+
const data = await getClient().post(`/api/v1/harborfreight/${path}`, params);
|
|
28
|
+
return trimResponse(data);
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
return handleApiError(err);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
server.tool("search_harbor_freight", `Search Harbor Freight by keyword and/or category, with brand and clearance filters and 7 sorts. Each result has item number (sku), id, title, brand, URL, image, ${PRICE_FIELDS} Plus badges, rating and review count, where it sells (in store only, online only) and variant info. Also returns total_results, facets (category ids, brands, ratings, price points, attributes) and, when a keyword maps to a category page (e.g. "wrench"), redirect with that category's results. 1 credit/call.`, {
|
|
35
|
+
query: z.string().min(1).max(200).optional()
|
|
36
|
+
.describe("Search keywords, e.g. 'cordless drill'. Pass this, category_id, or both."),
|
|
37
|
+
...listingFields(),
|
|
38
|
+
clearance: z.boolean().optional()
|
|
39
|
+
.describe("Only clearance items. Default false."),
|
|
40
|
+
}, post("search"));
|
|
41
|
+
server.tool("get_harbor_freight_clearance", `Harbor Freight clearance items, optionally narrowed by keyword, category or brand. Same fields as search_harbor_freight: each item's clearance price and end date are in sale. 1 credit/call.`, {
|
|
42
|
+
query: z.string().min(1).max(200).optional()
|
|
43
|
+
.describe("Optional keywords to narrow the clearance list, e.g. 'drill'."),
|
|
44
|
+
...listingFields(),
|
|
45
|
+
}, post("clearance"));
|
|
46
|
+
server.tool("get_harbor_freight_product", `One Harbor Freight product by item number, id or URL: title, brand, UPC, ${PRICE_FIELDS} Plus rating, review count, badges, description, highlights, the full specification table, warranty, shipping notes, owner's manuals, images and variants. An unknown item is a 404. 1 credit.`, {
|
|
47
|
+
sku: sku().optional()
|
|
48
|
+
.describe("Harbor Freight item number (a search result's sku), e.g. '73216'. Pass sku, id or url."),
|
|
49
|
+
id: z.number().int().min(1).optional()
|
|
50
|
+
.describe("Numeric product id (a search result's id), e.g. 48725."),
|
|
51
|
+
url: z.string().max(500).optional()
|
|
52
|
+
.describe("harborfreight.com product URL."),
|
|
53
|
+
}, post("product"));
|
|
54
|
+
server.tool("get_harbor_freight_prices", `Current national prices for up to 50 Harbor Freight item numbers in one call: ${PRICE_FIELDS} Unknown item numbers are listed in not_found. 1 credit.`, {
|
|
55
|
+
skus: z.array(sku()).min(1).max(50)
|
|
56
|
+
.describe("Up to 50 Harbor Freight item numbers, e.g. ['73216', '59716', '64508']."),
|
|
57
|
+
}, post("prices"));
|
|
58
|
+
server.tool("get_harbor_freight_stores", `Harbor Freight stores near a ZIP code, "City, ST" or coordinates, nearest first: store number (store_id), name, address, phone, coordinates, distance in miles, status, opening date and hours. Use store ids with get_harbor_freight_availability. 1 credit/call.`, {
|
|
59
|
+
query: z.string().min(2).max(64).optional()
|
|
60
|
+
.describe("US ZIP code or 'City, ST', e.g. '60601' or 'Los Angeles, CA'. Pass this, or latitude and longitude."),
|
|
61
|
+
latitude: z.number().min(-90).max(90).optional()
|
|
62
|
+
.describe("Latitude, e.g. 40.7128."),
|
|
63
|
+
longitude: z.number().min(-180).max(180).optional()
|
|
64
|
+
.describe("Longitude, e.g. -74.006."),
|
|
65
|
+
radius: z.number().int().min(1).max(100).optional()
|
|
66
|
+
.describe("Search radius in miles, 1-100. Default 50."),
|
|
67
|
+
limit: z.number().int().min(1).max(50).optional()
|
|
68
|
+
.describe("Most stores to return, 1-50. Default 10."),
|
|
69
|
+
}, post("stores"));
|
|
70
|
+
server.tool("get_harbor_freight_availability", `In-store stock for up to 20 Harbor Freight items at chosen stores, or at the stores nearest a ZIP code or coordinates. Each store lists every item with stock_status (in_stock, limited, out_of_stock or not_carried), the raw stock_code (IS, LS, NS, null), the aisle, and a nearby store that has it. inventory_updated_at is the time of the daily stock snapshot. Stock is a status, not a unit count. 1 credit/call.`, {
|
|
71
|
+
skus: z.array(sku()).min(1).max(20)
|
|
72
|
+
.describe("Up to 20 Harbor Freight item numbers, e.g. ['73216', '58139']."),
|
|
73
|
+
store_ids: z.array(z.string().regex(/^\d{1,5}$/)).min(1).max(20).optional()
|
|
74
|
+
.describe("Up to 20 store numbers from get_harbor_freight_stores, e.g. ['374', '820']. Or pass zip, or latitude and longitude, for the nearest stores."),
|
|
75
|
+
zip: z.string().regex(/^\d{5}(-\d{4})?$/).optional()
|
|
76
|
+
.describe("US ZIP code, e.g. '90012': stock at the stores nearest to it."),
|
|
77
|
+
latitude: z.number().min(-90).max(90).optional()
|
|
78
|
+
.describe("Latitude: stock at the stores nearest to it."),
|
|
79
|
+
longitude: z.number().min(-180).max(180).optional()
|
|
80
|
+
.describe("Longitude: stock at the stores nearest to it."),
|
|
81
|
+
limit: z.number().int().min(1).max(100).optional()
|
|
82
|
+
.describe("Nearest stores to return with zip or coordinates, 1-100. Default 10."),
|
|
83
|
+
}, post("availability"));
|
|
84
|
+
server.tool("get_harbor_freight_reviews", `Customer reviews for one Harbor Freight item, newest first, with limit/offset paging: title, text, star rating, author, review and purchase dates, incentivized flag, helpful votes and the reviewer's answers (would recommend, what they liked). Also the item's average rating and total review count. An unknown item is a 404. 1 credit/call.`, {
|
|
85
|
+
sku: sku()
|
|
86
|
+
.describe("Harbor Freight item number, e.g. '73216'."),
|
|
87
|
+
limit: z.number().int().min(1).max(50).optional()
|
|
88
|
+
.describe("Reviews per call, 1-50. Default 10."),
|
|
89
|
+
offset: z.number().int().min(0).max(100000).optional()
|
|
90
|
+
.describe("Reviews to skip, for paging. Default 0."),
|
|
91
|
+
}, post("reviews"));
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=harborfreight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harborfreight.js","sourceRoot":"","sources":["../../src/tools/harborfreight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,2EAA2E;AAC3E,8EAA8E;AAC9E,gFAAgF;AAChF,mEAAmE;AACnE,wEAAwE;AAExE,MAAM,KAAK,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AAEjI,MAAM,YAAY,GAChB,wXAAwX,CAAC;AAE3X,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAEhD,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;SAClD,QAAQ,CAAC,0IAA0I,CAAC;IACvJ,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;SAC9C,QAAQ,CAAC,gBAAgB,CAAC;IAC7B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;SAClD,QAAQ,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,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;aAC7C,QAAQ,CAAC,8CAA8C,CAAC;QAC3D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;aAChD,QAAQ,CAAC,+CAA+C,CAAC;QAC5D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;aAC/C,QAAQ,CAAC,sEAAsE,CAAC;KACpF,EACD,IAAI,CAAC,cAAc,CAAC,CACrB,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,4BAA4B,EAC5B,oVAAoV,EACpV;QACE,GAAG,EAAE,GAAG,EAAE;aACP,QAAQ,CAAC,2CAA2C,CAAC;QACxD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;aAC9C,QAAQ,CAAC,qCAAqC,CAAC;QAClD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;aACnD,QAAQ,CAAC,yCAAyC,CAAC;KACvD,EACD,IAAI,CAAC,SAAS,CAAC,CAChB,CAAC;AACJ,CAAC"}
|
package/dist/tools/heb.js
CHANGED
|
@@ -11,7 +11,7 @@ export function registerHebTools(server, getClient) {
|
|
|
11
11
|
return handleApiError(err);
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
-
server.tool("search_heb", `Search HEB grocery products by keyword. Returns price (cents), list price, sale status, unit price, size, UPC, stock, EBT/SNAP eligibility, category, aisle location and product URL. Pass store_id (from get_heb_stores) for one store's prices, stock and assortment. 2 credits/call.`, {
|
|
14
|
+
server.tool("search_heb", `Search HEB grocery products by keyword. Returns price (cents), list price, sale status, unit price, size, UPC, stock, EBT/SNAP eligibility, category, aisle location and product URL. Pass store_id (from get_heb_stores) for one store's prices, stock and assortment. Pass country 'mx' for HEB Mexico (heb.com.mx): price in Mexican peso cents, units in stock, EAN barcode and promotions (Rebajado price cut, AhorraMas multi-buy, ComboLoco gift), 20 rows per page with total_pages. 2 credits/call.`, {
|
|
15
15
|
query: z.string().min(1).max(200)
|
|
16
16
|
.describe("Search keywords, e.g. 'organic milk'."),
|
|
17
17
|
page: z.number().int().min(1).max(100).optional()
|
|
@@ -19,19 +19,23 @@ export function registerHebTools(server, getClient) {
|
|
|
19
19
|
page_size: z.number().int().min(1).max(60).optional()
|
|
20
20
|
.describe("Results per page, max 60. Default 60."),
|
|
21
21
|
store_id: z.union([z.string().regex(/^\d{1,5}$/), z.number().int().positive()]).optional()
|
|
22
|
-
.describe("HEB store number from get_heb_stores (field store_number), e.g. '441'. Prices, stock, aisle location and assortment come from that store and the store used is echoed in data.store. Omit for HEB's default store."),
|
|
22
|
+
.describe("HEB store number from get_heb_stores (field store_number), e.g. '441'. Prices, stock, aisle location and assortment come from that store and the store used is echoed in data.store. US only. Omit for HEB's default store."),
|
|
23
|
+
country: z.enum(["us", "mx"]).optional()
|
|
24
|
+
.describe("'us' for heb.com (default), 'mx' for heb.com.mx (Mexico, prices in peso cents, for HEB Mexico's default store). page_size and store_id are US only."),
|
|
23
25
|
}, post("search"));
|
|
24
|
-
server.tool("get_heb_product", `Full HEB product detail: nutrition facts (serving size, calories, nutrients with daily values), ingredients, description, images, similar products, coupons, EBT/SNAP eligibility, breadcrumbs, aisle location. Pass product_url (from search_heb) or slug + product_id; with store_id, product_id alone works and price, stock and aisle come from that store. 2 credits.`, {
|
|
26
|
+
server.tool("get_heb_product", `Full HEB product detail: nutrition facts (serving size, calories, nutrients with daily values), ingredients, description, images, similar products, coupons, EBT/SNAP eligibility, breadcrumbs, aisle location. Pass product_url (from search_heb) or slug + product_id; with store_id, product_id alone works and price, stock and aisle come from that store. For HEB Mexico pass country 'mx' and the url from a Mexico search: peso price, units in stock, barcode, promotions, images, ingredients and nutrition (Spanish nutrient names). 2 credits.`, {
|
|
25
27
|
product_url: z.string().min(1).max(500).optional()
|
|
26
|
-
.describe("Full or relative product URL from heb.com, e.g. '/product-detail/central-market-organics-whole-milk-1-gal/931316'. Preferred."),
|
|
28
|
+
.describe("Full or relative product URL from heb.com or heb.com.mx, e.g. '/product-detail/central-market-organics-whole-milk-1-gal/931316'. Preferred."),
|
|
27
29
|
product_id: z.string().min(1).max(20).optional()
|
|
28
30
|
.describe("HEB product id (numeric id at the end of a product URL). Requires slug, unless store_id is set."),
|
|
29
31
|
slug: z.string().min(1).max(300).optional()
|
|
30
32
|
.describe("Product slug (readable part of the URL). Required with product_id, unless store_id is set."),
|
|
31
33
|
store_id: z.union([z.string().regex(/^\d{1,5}$/), z.number().int().positive()]).optional()
|
|
32
|
-
.describe("HEB store number from get_heb_stores (field store_number), e.g. '441'. Price, stock and aisle location come from that store and the store used is echoed in data.store. Omit for HEB's default store."),
|
|
34
|
+
.describe("HEB store number from get_heb_stores (field store_number), e.g. '441'. Price, stock and aisle location come from that store and the store used is echoed in data.store. US only. Omit for HEB's default store."),
|
|
35
|
+
country: z.enum(["us", "mx"]).optional()
|
|
36
|
+
.describe("'us' for heb.com (default), 'mx' for heb.com.mx (Mexico)."),
|
|
33
37
|
}, post("product"));
|
|
34
|
-
server.tool("get_heb_stores", `Find HEB stores near a US ZIP code or city. Returns store number, address, phone, hours, pharmacy availability, fulfillment channels (curbside, delivery, in-store), distance and store URL. 2 credits.`, {
|
|
38
|
+
server.tool("get_heb_stores", `Find HEB stores near a US ZIP code or city (US only; HEB Mexico stores are not covered). Returns store number, address, phone, hours, pharmacy availability, fulfillment channels (curbside, delivery, in-store), distance and store URL. 2 credits.`, {
|
|
35
39
|
zip: z.string().regex(/^\d{5}$/).optional()
|
|
36
40
|
.describe("5-digit US ZIP code, e.g. '78701'."),
|
|
37
41
|
city: z.string().min(1).max(100).optional()
|
package/dist/tools/heb.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heb.js","sourceRoot":"","sources":["../../src/tools/heb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,SAA6B;IAC/E,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,EAAE,MAA+B,EAAE,EAAE;QACvE,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAC,IAAI,CAAC,eAAe,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;YACnE,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"heb.js","sourceRoot":"","sources":["../../src/tools/heb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,SAA6B;IAC/E,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,EAAE,MAA+B,EAAE,EAAE;QACvE,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QAAQ,EAAE;aACxC,QAAQ,CAAC,6CAA6C,CAAC;KAC3D,EACD,IAAI,CAAC,QAAQ,CAAC,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { handleApiError } from "../lib/tool-error.js";
|
|
3
|
+
import { trimResponse } from "../lib/trim-response.js";
|
|
4
|
+
// Shapes mirror backend/src/routes/iherb.ts. Cross-field rule the backend
|
|
5
|
+
// enforces and zod here does not: product and reviews take product_id OR url.
|
|
6
|
+
// iHerb is online only (no stores) and always the US store in USD. No zod
|
|
7
|
+
// `.default()`: the MCP SDK would post a defaulted field on every call.
|
|
8
|
+
const SORTS = ["relevance", "best_selling", "rating", "price_asc", "price_desc", "newest", "percent_off", "review_count"];
|
|
9
|
+
const productId = () => z.string().regex(/^\d{1,9}$/);
|
|
10
|
+
const productFields = () => ({
|
|
11
|
+
product_id: productId().optional()
|
|
12
|
+
.describe("iHerb product id, the number at the end of an iherb.com/pr/ URL (a search result's product_id), e.g. '62118'. Pass this or url."),
|
|
13
|
+
url: z.string().min(1).max(500).optional()
|
|
14
|
+
.describe("An iherb.com product URL. Data is always the US store's, whatever the URL's country."),
|
|
15
|
+
});
|
|
16
|
+
export function registerIherbTools(server, getClient) {
|
|
17
|
+
const post = (path) => async (params) => {
|
|
18
|
+
try {
|
|
19
|
+
const data = await getClient().post(`/api/v1/iherb/${path}`, params);
|
|
20
|
+
return trimResponse(data);
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
return handleApiError(err);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
server.tool("search_iherb", `Search iHerb (US store, USD) by keyword, 48 products per page. Each result has product_id, part_number, name, brand, brand_code, URL, image, price, list_price, original_price and discount_percent when discounted, rating, review_count, in_stock, badges (e.g. Best seller, iHerb Brands, New), recent_sales (e.g. "30K+ sold in 30 days") and position. Also returns total_results and brand_filters (brand_code, name and match count for the top brands) for narrowing with brand_code. iHerb is online only: no stores. Use a result's product_id with get_iherb_product, get_iherb_prices or get_iherb_reviews. 2 credits/call.`, {
|
|
27
|
+
query: z.string().min(1).max(200)
|
|
28
|
+
.describe("Search keywords, e.g. 'vitamin d'."),
|
|
29
|
+
page: z.number().int().min(1).max(500).optional()
|
|
30
|
+
.describe("Page, 1-based. 48 results per page."),
|
|
31
|
+
sort: z.enum(SORTS).optional()
|
|
32
|
+
.describe("relevance, best_selling, rating, price_asc, price_desc, newest, percent_off (highest discount first) or review_count. Default iHerb's featured order."),
|
|
33
|
+
brand_code: z.string().regex(/^[A-Za-z0-9]{2,10}$/).optional()
|
|
34
|
+
.describe("Only this brand, by iHerb brand code, e.g. 'CGN' (California Gold Nutrition) or 'NOW' (NOW Foods): a result's brand_code or a brand_filters entry."),
|
|
35
|
+
}, post("search"));
|
|
36
|
+
server.tool("get_iherb_product", `One iHerb product by id or URL (US store, USD): name, brand, part number, UPC, price, list price, discount, price per serving or unit, stock status, discontinued and coming-soon flags, quantity limit, expiration date, first-available date, package quantity, weight and dimensions, rating and review count, category breadcrumbs, best-seller rankings by category, badges, variants (size, potency, flavor) with their product ids and prices, supplement facts (serving size, servings per container, nutrients with amount and % daily value), description, suggested use, ingredients, warnings and images. An unknown product id is a 404. 2 credits.`, productFields(), post("product"));
|
|
37
|
+
server.tool("get_iherb_prices", `Current price, list price, discount, in-stock flag, rating and review count for up to 50 iHerb products in one call (US store, USD). One row per requested id, in request order; unknown ids come back with found: false and are listed in not_found. The cheapest way to monitor iHerb prices and stock across many products. 2 credits.`, {
|
|
38
|
+
product_ids: z.array(productId()).min(1).max(50)
|
|
39
|
+
.describe("Up to 50 iHerb product ids, e.g. ['62118', '70316', '77548']. Duplicates are answered once."),
|
|
40
|
+
}, post("prices"));
|
|
41
|
+
server.tool("get_iherb_reviews", `The review summary for one iHerb product: average rating, total review count, star histogram (count and percent per star), review counts per language, and the full text of the top positive and top critical review with rating, title, author, country, date, verified-purchase flag, helpful votes and images. Not a full review list. 2 credits.`, productFields(), post("reviews"));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=iherb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iherb.js","sourceRoot":"","sources":["../../src/tools/iherb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,0EAA0E;AAC1E,8EAA8E;AAC9E,0EAA0E;AAC1E,wEAAwE;AAExE,MAAM,KAAK,GAAG,CAAC,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,CAAU,CAAC;AAEnI,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAEtD,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CAAC;IAC3B,UAAU,EAAE,SAAS,EAAE,CAAC,QAAQ,EAAE;SAC/B,QAAQ,CAAC,iIAAiI,CAAC;IAC9I,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;SACvC,QAAQ,CAAC,sFAAsF,CAAC;CACpG,CAAC,CAAC;AAEH,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,SAA6B;IACjF,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,EAAE,MAA+B,EAAE,EAAE;QACvE,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAC,IAAI,CAAC,iBAAiB,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;YACrE,OAAO,YAAY,CAAC,IAAI,CA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AAC,SAAS,CAAC,CAChB,CAAC;AACJ,CAAC"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ export declare const PLATFORM_KEYS: string[];
|
|
|
4
4
|
/**
|
|
5
5
|
* What registers when SCAVIO_PLATFORMS is unset.
|
|
6
6
|
*
|
|
7
|
-
* Registering everything is not an option any more. The full surface is
|
|
8
|
-
* tools, which serialises to
|
|
9
|
-
* `npm run toolslist`, not estimated) — roughly
|
|
7
|
+
* Registering everything is not an option any more. The full surface is 351
|
|
8
|
+
* tools, which serialises to 355KB of tools/list (measured with
|
|
9
|
+
* `npm run toolslist`, not estimated) — roughly 89k tokens pushed into the
|
|
10
10
|
* context of EVERY session before the user has typed anything, and past the
|
|
11
11
|
* hard tool-count ceiling some clients enforce. The default set below is 142
|
|
12
12
|
* tools, 112KB (0.20.0: TikTok, YouTube, Reddit and X gained 19 tools; 0.21.0:
|
|
@@ -27,7 +27,7 @@ export declare const DEFAULT_PLATFORMS: string[];
|
|
|
27
27
|
* Turn a SCAVIO_PLATFORMS value into the canonical platform keys to register.
|
|
28
28
|
*
|
|
29
29
|
* Accepts a comma-separated list of platform keys, plus three keywords:
|
|
30
|
-
* all — every platform (
|
|
30
|
+
* all — every platform (351 tools)
|
|
31
31
|
* default — expands to DEFAULT_PLATFORMS, so `default,sec,g2` is additive
|
|
32
32
|
* none — no platform tools at all, leaving only get_usage
|
|
33
33
|
*
|
package/dist/tools/index.js
CHANGED
|
@@ -30,6 +30,13 @@ import { registerAldiTools } from "./aldi.js";
|
|
|
30
30
|
import { registerMicroCenterTools } from "./microcenter.js";
|
|
31
31
|
import { registerWalgreensTools } from "./walgreens.js";
|
|
32
32
|
import { registerCvsTools } from "./cvs.js";
|
|
33
|
+
import { registerWholeFoodsTools } from "./wholefoods.js";
|
|
34
|
+
import { registerHarborFreightTools } from "./harborfreight.js";
|
|
35
|
+
import { registerPetsmartTools } from "./petsmart.js";
|
|
36
|
+
import { registerPetcoTools } from "./petco.js";
|
|
37
|
+
import { registerIherbTools } from "./iherb.js";
|
|
38
|
+
import { registerChewyTools } from "./chewy.js";
|
|
39
|
+
import { registerMenardsTools } from "./menards.js";
|
|
33
40
|
import { registerMercadoLibreTools } from "./mercadolibre.js";
|
|
34
41
|
import { registerTiktokShopTools } from "./tiktok-shop.js";
|
|
35
42
|
import { registerBookingTools } from "./booking.js";
|
|
@@ -103,6 +110,13 @@ const PLATFORMS = {
|
|
|
103
110
|
microcenter: registerMicroCenterTools,
|
|
104
111
|
walgreens: registerWalgreensTools,
|
|
105
112
|
cvs: registerCvsTools,
|
|
113
|
+
wholefoods: registerWholeFoodsTools,
|
|
114
|
+
harborfreight: registerHarborFreightTools,
|
|
115
|
+
petsmart: registerPetsmartTools,
|
|
116
|
+
petco: registerPetcoTools,
|
|
117
|
+
iherb: registerIherbTools,
|
|
118
|
+
chewy: registerChewyTools,
|
|
119
|
+
menards: registerMenardsTools,
|
|
106
120
|
mercadolibre: registerMercadoLibreTools,
|
|
107
121
|
"tiktok-shop": registerTiktokShopTools,
|
|
108
122
|
// Travel and local
|
|
@@ -137,9 +151,9 @@ export const PLATFORM_KEYS = Object.keys(PLATFORMS);
|
|
|
137
151
|
/**
|
|
138
152
|
* What registers when SCAVIO_PLATFORMS is unset.
|
|
139
153
|
*
|
|
140
|
-
* Registering everything is not an option any more. The full surface is
|
|
141
|
-
* tools, which serialises to
|
|
142
|
-
* `npm run toolslist`, not estimated) — roughly
|
|
154
|
+
* Registering everything is not an option any more. The full surface is 351
|
|
155
|
+
* tools, which serialises to 355KB of tools/list (measured with
|
|
156
|
+
* `npm run toolslist`, not estimated) — roughly 89k tokens pushed into the
|
|
143
157
|
* context of EVERY session before the user has typed anything, and past the
|
|
144
158
|
* hard tool-count ceiling some clients enforce. The default set below is 142
|
|
145
159
|
* tools, 112KB (0.20.0: TikTok, YouTube, Reddit and X gained 19 tools; 0.21.0:
|
|
@@ -195,7 +209,7 @@ function warnOnce(message) {
|
|
|
195
209
|
* Turn a SCAVIO_PLATFORMS value into the canonical platform keys to register.
|
|
196
210
|
*
|
|
197
211
|
* Accepts a comma-separated list of platform keys, plus three keywords:
|
|
198
|
-
* all — every platform (
|
|
212
|
+
* all — every platform (351 tools)
|
|
199
213
|
* default — expands to DEFAULT_PLATFORMS, so `default,sec,g2` is additive
|
|
200
214
|
* none — no platform tools at all, leaving only get_usage
|
|
201
215
|
*
|
|
@@ -254,6 +268,8 @@ const TITLE_WORDS = {
|
|
|
254
268
|
sams: "Sam's",
|
|
255
269
|
aldi: "ALDI",
|
|
256
270
|
cvs: "CVS",
|
|
271
|
+
petsmart: "PetSmart",
|
|
272
|
+
iherb: "iHerb",
|
|
257
273
|
sec: "SEC",
|
|
258
274
|
g2: "G2",
|
|
259
275
|
ai: "AI",
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EA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
|
+
import { trimResponse } from "../lib/trim-response.js";
|
|
4
|
+
// Shapes mirror backend/src/routes/menards.ts. Cross-field rules the backend
|
|
5
|
+
// enforces and zod here does not: product takes item_id OR url; stores takes
|
|
6
|
+
// zip OR city+state. Menards has no search endpoint. No zod `.default()`: the
|
|
7
|
+
// MCP SDK would post a defaulted field on every call.
|
|
8
|
+
export function registerMenardsTools(server, getClient) {
|
|
9
|
+
const post = (path) => async (params) => {
|
|
10
|
+
try {
|
|
11
|
+
const data = await getClient().post(`/api/v1/menards/${path}`, params);
|
|
12
|
+
return trimResponse(data);
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
return handleApiError(err);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
server.tool("get_menards_product", `One Menards product by item id or URL (there is no search): name, brand, model number, SKU, description, bullets, specifications, images, videos and documents, with the full price ladder: everyday price, sale price and its end date, mail-in rebates (text such as "11% REBATE*", amount, dates), final_price after rebates and the you-save amount. Also pickup, delivery and ship-to-store flags. Pass store_id for that store's stock quantity, stock message, aisle location and not_available_at_store; without it prices are the default store's (3598) and stock fields are null. Prices are in dollars. With store_id it can take 10-40 seconds. An unknown item id or store number is a 404. 1 credit; 2 credits with store_id.`, {
|
|
19
|
+
item_id: z.string().regex(/^\d{8,16}$/).optional()
|
|
20
|
+
.describe("Menards item id: the number after p- in a menards.com product URL, e.g. '60893666613'. Not the SKU or model number. Pass this or url."),
|
|
21
|
+
url: z.string().max(2000).optional()
|
|
22
|
+
.describe("A menards.com product URL, e.g. 'https://www.menards.com/main/p-60893666613.htm'. Pass this or item_id."),
|
|
23
|
+
store_id: z.string().regex(/^\d{1,5}$/).optional()
|
|
24
|
+
.describe("Menards store number from get_menards_stores, e.g. '3181'. Adds that store's stock quantity, stock message and aisle, priced for that store. Costs 2 credits instead of 1 and typically takes 10-40 seconds."),
|
|
25
|
+
}, post("product"));
|
|
26
|
+
server.tool("get_menards_stores", `Menards stores near a US ZIP code or a city and state, nearest first: store number (store_id), name, address, coordinates, distance in miles and services (garden center, grocery, rental center, propane and more). Use a store_id with get_menards_product for that store's stock and aisle. 1 credit.`, {
|
|
27
|
+
zip: z.string().regex(/^\d{5}(-\d{4})?$/).optional()
|
|
28
|
+
.describe("US ZIP code, e.g. '55401'. Pass this, or city and state."),
|
|
29
|
+
city: z.string().min(1).max(80).optional()
|
|
30
|
+
.describe("City to search around, with state, e.g. 'Madison'."),
|
|
31
|
+
state: z.string().regex(/^[A-Za-z]{2}$/).optional()
|
|
32
|
+
.describe("2-letter US state code, with city, e.g. 'WI'."),
|
|
33
|
+
}, post("stores"));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=menards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menards.js","sourceRoot":"","sources":["../../src/tools/menards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,6EAA6E;AAC7E,6EAA6E;AAC7E,8EAA8E;AAC9E,sDAAsD;AAEtD,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,SAA6B;IACnF,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,EAAE,MAA+B,EAAE,EAAE;QACvE,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAC,IAAI,CAAC,mBAAmB,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;YACvE,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,8sBAA8sB,EAC9sB;QACE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;aAC/C,QAAQ,CAAC,uIAAuI,CAAC;QACpJ,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;aACjC,QAAQ,CAAC,yGAAyG,CAAC;QACtH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;aAC/C,QAAQ,CAAC,8MAA8M,CAAC;KAC5N,EACD,IAAI,CAAC,SAAS,CAAC,CAChB,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,oBAAoB,EACpB,0SAA0S,EAC1S;QACE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE;aACjD,QAAQ,CAAC,0DAA0D,CAAC;QACvE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;aACvC,QAAQ,CAAC,oDAAoD,CAAC;QACjE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;aAChD,QAAQ,CAAC,+CAA+C,CAAC;KAC7D,EACD,IAAI,CAAC,QAAQ,CAAC,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { handleApiError } from "../lib/tool-error.js";
|
|
3
|
+
import { trimResponse } from "../lib/trim-response.js";
|
|
4
|
+
// Shapes mirror backend/src/routes/petco.ts. Cross-field rules the backend
|
|
5
|
+
// enforces and zod here does not: product takes part_number OR url;
|
|
6
|
+
// store-inventory takes store_id OR zip. No zod `.default()`: the MCP SDK would
|
|
7
|
+
// post a defaulted field on every call.
|
|
8
|
+
const SORTS = ["relevance", "price", "rating", "top_sold", "newest", "name"];
|
|
9
|
+
const LISTING_FIELDS = "Each product has price, list price and autoship (Repeat Delivery) price in dollars, rating, review count, brand, part_number, cat_entry_id (for get_petco_store_inventory), fulfillment flags (pickup in store, same-day delivery, autoship, in-store only), deal_group_ids, and every size/flavor variation with its own prices. Also returned: total_results, facets with counts and the categories the matches fall into. 48 per page. Prices are national.";
|
|
10
|
+
const zip = () => z.string().regex(/^\d{5}(-\d{4})?$/);
|
|
11
|
+
const listingFields = () => ({
|
|
12
|
+
page: z.number().int().min(1).max(100).optional()
|
|
13
|
+
.describe("Page, 1-based. 48 products per page."),
|
|
14
|
+
sort: z.enum(SORTS).optional()
|
|
15
|
+
.describe("relevance (default), price, rating, top_sold, newest or name."),
|
|
16
|
+
sort_order: z.enum(["asc", "desc"]).optional()
|
|
17
|
+
.describe("asc or desc. Default asc for price and name, desc for everything else."),
|
|
18
|
+
});
|
|
19
|
+
export function registerPetcoTools(server, getClient) {
|
|
20
|
+
const post = (path) => async (params) => {
|
|
21
|
+
try {
|
|
22
|
+
const data = await getClient().post(`/api/v1/petco/${path}`, params);
|
|
23
|
+
return trimResponse(data);
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
return handleApiError(err);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
server.tool("search_petco", `Search Petco products. ${LISTING_FIELDS} 1 credit/call.`, {
|
|
30
|
+
query: z.string().min(1).max(200)
|
|
31
|
+
.describe("Search keywords, e.g. 'dog food'."),
|
|
32
|
+
...listingFields(),
|
|
33
|
+
}, post("search"));
|
|
34
|
+
server.tool("get_petco_category", `Products in a Petco category, e.g. dog/dog-food/dry-dog-food. ${LISTING_FIELDS} Can take 10-30 seconds. An unknown category is a 404. 1 credit/call.`, {
|
|
35
|
+
path: z.string().min(1).max(300)
|
|
36
|
+
.describe("A petco.com category: its path ('dog/dog-food/dry-dog-food'), /category/<path>, or the full URL. A search result's categories[].url works too."),
|
|
37
|
+
...listingFields(),
|
|
38
|
+
}, post("category"));
|
|
39
|
+
server.tool("get_petco_product", `One Petco product by part number or URL, with every variant (size, flavor): cat_entry_id, part number, SKU, UPC, price, list price, autoship (Repeat Delivery) price, first-autoship promo price, online quantity and status, fulfillment flags, ingredients, guaranteed analysis, directions, specifications, dimensions and images. Plus brand, rating, review count and breadcrumbs. Prices are national; for per-store stock pass a variant's cat_entry_id to get_petco_store_inventory. Can take 10-30 seconds. An unknown product is a 404. 1 credit.`, {
|
|
40
|
+
part_number: z.string().regex(/^\d{4,10}$/).optional()
|
|
41
|
+
.describe("Petco part number (a search result's part_number), e.g. '3748364'. Pass this or url."),
|
|
42
|
+
url: z.string().min(1).max(500).optional()
|
|
43
|
+
.describe("Petco product page URL, /product/<name>-<part number> (a search result's url). Answers faster than part_number."),
|
|
44
|
+
}, post("product"));
|
|
45
|
+
server.tool("get_petco_stores", `Petco stores nearest a US ZIP code (up to 10): store_id (what get_petco_store_inventory takes), store number, name, address, phone, coordinates, distance in miles, in-store pickup and opening hours per weekday. 1 credit.`, {
|
|
46
|
+
zip: zip()
|
|
47
|
+
.describe("US ZIP code, e.g. '10001'."),
|
|
48
|
+
limit: z.number().int().min(1).max(10).optional()
|
|
49
|
+
.describe("Number of stores, nearest first, 1-10. Default 5."),
|
|
50
|
+
}, post("stores"));
|
|
51
|
+
server.tool("get_petco_store_inventory", `Units on hand at one Petco store for up to 10 products: qty_available, alert_level (GREEN, YELLOW, RED) and in_stock per cat_entry_id. Pass a store_id, or a zip to use the nearest store (returned as store). Takes catalog entry ids (cat_entry_id from search_petco or get_petco_product), not part numbers; one unknown id makes the whole answer a 404. 1 credit.`, {
|
|
52
|
+
cat_entry_ids: z.array(z.string().regex(/^\d{1,12}$/)).min(1).max(10)
|
|
53
|
+
.describe("Up to 10 catalog entry ids: the cat_entry_id of a search result, variation or product variant, e.g. ['6131012', '531503']. NOT the part number."),
|
|
54
|
+
store_id: z.string().regex(/^\d{1,12}$/).optional()
|
|
55
|
+
.describe("Petco store id: the store_id of get_petco_stores (not the store number), e.g. '13275'. Pass this or zip."),
|
|
56
|
+
zip: zip().optional()
|
|
57
|
+
.describe("US ZIP code, e.g. '10001': stock is read at the nearest store to it."),
|
|
58
|
+
}, post("store-inventory"));
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=petco.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"petco.js","sourceRoot":"","sources":["../../src/tools/petco.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,2EAA2E;AAC3E,oEAAoE;AACpE,gFAAgF;AAChF,wCAAwC;AAExC,MAAM,KAAK,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AAEtF,MAAM,cAAc,GAClB,gcAAgc,CAAC;AAEnc,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AAEvD,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;SAC9C,QAAQ,CAAC,sCAAsC,CAAC;IACnD,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;SAC3B,QAAQ,CAAC,+DAA+D,CAAC;IAC5E,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAA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E,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;aACvC,QAAQ,CAAC,iHAAiH,CAAC;KAC/H,EACD,IAAI,CAAC,SAAS,CAAC,CAChB,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,kBAAkB,EAClB,8NAA8N,EAC9N;QACE,GAAG,EAAE,GAAG,EAAE;aACP,QAAQ,CAAC,4BAA4B,CAAC;QACzC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;aAC9C,QAAQ,CAAC,mDAAmD,CAAC;KACjE,EACD,IAAI,CAAC,QAAQ,CAAC,CACf,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,2BAA2B,EAC3B,wWAAwW,EACxW;QACE,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;aAClE,QAAQ,CAAC,iJAAiJ,CAAC;QAC9J,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;aAChD,QAAQ,CAAC,0GAA0G,CAAC;QACvH,GAAG,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE;aAClB,QAAQ,CAAC,sEAAsE,CAAC;KACpF,EACD,IAAI,CAAC,iBAAiB,CAAC,CACxB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { handleApiError } from "../lib/tool-error.js";
|
|
3
|
+
import { trimResponse } from "../lib/trim-response.js";
|
|
4
|
+
// Shapes mirror backend/src/routes/petsmart.ts. Cross-field rule the backend
|
|
5
|
+
// enforces and zod here does not: product takes exactly one of web_style_id,
|
|
6
|
+
// sku or url. No zod `.default()`: the MCP SDK would post a defaulted field on
|
|
7
|
+
// every call.
|
|
8
|
+
const SORTS = ["relevance", "best_sellers", "price_low", "price_high", "top_rated", "new_arrivals"];
|
|
9
|
+
const PETS = ["dog", "cat", "fish", "small_pet", "reptile", "bird"];
|
|
10
|
+
const STORE_HELP = "Find store numbers with get_petsmart_stores.";
|
|
11
|
+
const storeId = () => z.string().regex(/^\d{1,5}$/);
|
|
12
|
+
const sku = () => z.string().regex(/^\d{4,9}$/);
|
|
13
|
+
const listingFields = () => ({
|
|
14
|
+
page: z.number().int().min(1).max(100).optional()
|
|
15
|
+
.describe("Page, 1-based."),
|
|
16
|
+
limit: z.number().int().min(1).max(40).optional()
|
|
17
|
+
.describe("Results per page, 1-40. Default 40."),
|
|
18
|
+
store_id: storeId().optional()
|
|
19
|
+
.describe(`PetSmart store number, e.g. '1658'. Lists only products in stock at that store, each with in_stock_at_store. ${STORE_HELP}`),
|
|
20
|
+
sort: z.enum(SORTS).optional()
|
|
21
|
+
.describe("relevance (default), best_sellers, price_low, price_high, top_rated or new_arrivals."),
|
|
22
|
+
});
|
|
23
|
+
export function registerPetsmartTools(server, getClient) {
|
|
24
|
+
const post = (path) => async (params) => {
|
|
25
|
+
try {
|
|
26
|
+
const data = await getClient().post(`/api/v1/petsmart/${path}`, params);
|
|
27
|
+
return trimResponse(data);
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
return handleApiError(err);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
server.tool("search_petsmart", `Search PetSmart products, up to 40 per page. Each result has SKU, web_style_id, name, brand, UPC, price, original price, sale price, price range across sizes, rating, review count, image, size, variation summary, category, pets, promotions, stores_in_stock (how many stores stock it), pickup and Autoship eligibility, and product URL. Prices are national, in dollars. Pass store_id to list only products in stock at that store. Use web_style_id or sku with get_petsmart_product. 1 credit/call.`, {
|
|
34
|
+
query: z.string().min(1).max(200)
|
|
35
|
+
.describe("Search keywords, e.g. 'dog food'."),
|
|
36
|
+
...listingFields(),
|
|
37
|
+
}, post("search"));
|
|
38
|
+
server.tool("get_petsmart_product", `One PetSmart product by web_style_id, SKU or URL, with every variant (size/flavor): SKU, UPC, price, original price, sale price and end date, Autoship discount with first-order and recurring price, ship-to-home stock, pickup and same-day purchase options, images and promotions. Also brand, rating, review count, categories, description and option lists. Prices are national, in dollars. For store stock use get_petsmart_store_stock. An unknown id is a 404. 1 credit.`, {
|
|
39
|
+
web_style_id: z.string().regex(/^\d{1,8}$/).optional()
|
|
40
|
+
.describe("Product id: the number at the end of a product URL (...-570.html), a search result's web_style_id, e.g. '570'. One id covers every size and flavor. Pass exactly one of web_style_id, sku or url."),
|
|
41
|
+
sku: sku().optional()
|
|
42
|
+
.describe("A SKU (one size/flavor), a search result's sku, e.g. '5154856'. Returns the whole product it belongs to."),
|
|
43
|
+
url: z.string().max(500).optional()
|
|
44
|
+
.describe("A petsmart.com product page URL."),
|
|
45
|
+
}, post("product"));
|
|
46
|
+
server.tool("get_petsmart_stores", `The 12 PetSmart stores nearest a US ZIP code: store number (store_id), name, address, phone, coordinates, distance in miles, time zone, the next 7 days of opening hours and services (grooming, PetsHotel, veterinary, adoptions...). Pass a sku and each store also carries quantity and in_stock for that SKU. An unknown ZIP returns no stores. 1 credit.`, {
|
|
47
|
+
zip: z.string().regex(/^\d{5}(-\d{4})?$/)
|
|
48
|
+
.describe("US ZIP code, e.g. '60601'."),
|
|
49
|
+
radius: z.number().int().min(1).max(100).optional()
|
|
50
|
+
.describe("Search radius in miles. Default 30."),
|
|
51
|
+
sku: sku().optional()
|
|
52
|
+
.describe("A SKU, e.g. '5154856'. Every store then also carries its unit count of that SKU."),
|
|
53
|
+
}, post("stores"));
|
|
54
|
+
server.tool("get_petsmart_store_stock", `Stock of up to 20 SKUs at one PetSmart store in one call: units available for in-store pickup at that store, units available to ship to home, and an alternate nearby store with its count when the store has none. Includes the store's name, address, phone, page URL and pickup options. An unknown store number is a 404; an unknown SKU reads 0. 1 credit.`, {
|
|
55
|
+
store_id: storeId()
|
|
56
|
+
.describe(`PetSmart store number, e.g. '1658'. ${STORE_HELP}`),
|
|
57
|
+
skus: z.array(sku()).min(1).max(20)
|
|
58
|
+
.describe("Up to 20 SKUs, e.g. every variant of a product: ['5154856', '5154855']."),
|
|
59
|
+
}, post("store-stock"));
|
|
60
|
+
server.tool("get_petsmart_availability", `Unit counts for up to 20 PetSmart store and SKU pairs in one call, mixing stores and SKUs freely. Each result has quantity and in_stock. Unknown stores or SKUs read 0. 1 credit.`, {
|
|
61
|
+
pairs: z.array(z.object({
|
|
62
|
+
store_id: storeId().describe("PetSmart store number, e.g. '1658'."),
|
|
63
|
+
sku: sku().describe("SKU, e.g. '5252900'."),
|
|
64
|
+
})).min(1).max(20)
|
|
65
|
+
.describe("Up to 20 store and SKU pairs, e.g. [{store_id: '1658', sku: '5252900'}, {store_id: '2528', sku: '5252900'}]."),
|
|
66
|
+
}, post("availability"));
|
|
67
|
+
server.tool("get_petsmart_deals", `Products in PetSmart's Sale section, up to 40 per page, in the same shape as search_petsmart, plus the current sale events with approximate product counts. Filter by pet, by one sale event, by keywords, or to products in stock at a store. The Sale section also lists points and Autoship promotions, so on_sale marks the rows whose price is actually reduced. 1 credit/call.`, {
|
|
68
|
+
pet: z.enum(PETS).optional()
|
|
69
|
+
.describe("Only deals for this pet: dog, cat, fish, small_pet, reptile or bird."),
|
|
70
|
+
event: z.string().max(200).optional()
|
|
71
|
+
.describe("Only one sale event, by its exact name from the events list of a previous deals answer, e.g. 'Sale > November > Dog Sale'. Events change with the season."),
|
|
72
|
+
query: z.string().max(200).optional()
|
|
73
|
+
.describe("Keywords to search within the sale."),
|
|
74
|
+
...listingFields(),
|
|
75
|
+
}, post("deals"));
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=petsmart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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AEF,MAAM,CAAC,IAAI,CACT,oBAAoB,EACpB,sXAAsX,EACtX;QACE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;aACzB,QAAQ,CAAC,sEAAsE,CAAC;QACnF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;aAClC,QAAQ,CAAC,2JAA2J,CAAC;QACxK,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;aAClC,QAAQ,CAAC,qCAAqC,CAAC;QAClD,GAAG,aAAa,EAAE;KACnB,EACD,IAAI,CAAC,OAAO,CAAC,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { handleApiError } from "../lib/tool-error.js";
|
|
3
|
+
import { trimResponse } from "../lib/trim-response.js";
|
|
4
|
+
// Shapes mirror backend/src/routes/wholefoods.ts. Cross-field rule the backend
|
|
5
|
+
// enforces and zod here does not: product takes asin, url or slug (at least
|
|
6
|
+
// one). No zod `.default()`: the MCP SDK would post a defaulted field on every
|
|
7
|
+
// call.
|
|
8
|
+
const BROWSE_SORTS = ["featured", "popular", "price_asc", "price_desc", "brand_az", "brand_za"];
|
|
9
|
+
const DIETS = ["vegan", "gluten-free", "organic", "dairy-free", "vegetarian"];
|
|
10
|
+
const PRICE_NOTE = "Prices are that store's in-store (shelf) prices in dollars: regular_price, sale_price and prime_price (the Prime member price), with sale start and end dates. A multi-buy is a total: sale_price 10 with sale_quantity 2 means 2 for $10; price_unit lb means per pound.";
|
|
11
|
+
const storeId = () => z.string().regex(/^\d{5}$/).optional()
|
|
12
|
+
.describe("5-digit Whole Foods store id from get_whole_foods_stores, e.g. '10160'. Prices are that store's. Default 10145 (Lamar, Austin TX).");
|
|
13
|
+
const requiredStoreId = () => z.string().regex(/^\d{5}$/)
|
|
14
|
+
.describe("5-digit Whole Foods store id from get_whole_foods_stores, e.g. '10145'.");
|
|
15
|
+
const diet = () => z.enum(DIETS).optional()
|
|
16
|
+
.describe("Only products with this dietary attribute: vegan, gluten-free, organic, dairy-free or vegetarian.");
|
|
17
|
+
const limit = () => z.number().int().min(1).max(60).optional()
|
|
18
|
+
.describe("Products per page, 1-60. Default 60.");
|
|
19
|
+
const offset = () => z.number().int().min(0).max(10000).optional()
|
|
20
|
+
.describe("Products to skip, for paging (60 = page 2 at the default limit). Default 0.");
|
|
21
|
+
const browseSort = () => z.enum(BROWSE_SORTS).optional()
|
|
22
|
+
.describe("featured (default), popular, price_asc, price_desc, brand_az or brand_za.");
|
|
23
|
+
const CATEGORY_HELP = "Category slug, e.g. 'dairy-eggs', 'cheese', 'produce'. Slugs are in the category facet of any search.";
|
|
24
|
+
export function registerWholeFoodsTools(server, getClient) {
|
|
25
|
+
const post = (path) => async (params) => {
|
|
26
|
+
try {
|
|
27
|
+
const data = await getClient().post(`/api/v1/wholefoods/${path}`, params);
|
|
28
|
+
return trimResponse(data);
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
return handleApiError(err);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
server.tool("search_whole_foods", `Search Whole Foods Market products at one store, up to 60 per page. ${PRICE_NOTE} Each result has asin, slug, name, brand, image, URL, on_sale and is_local flags; the response has total_results and facets (category tree, featured and diet filters, with counts). Sorts are relevance, price_asc and price_desc only. No ratings, reviews, UPCs or per-store unit stock. Use a result's asin with get_whole_foods_product. 1 credit/call.`, {
|
|
35
|
+
query: z.string().min(1).max(200)
|
|
36
|
+
.describe("Search keywords, e.g. 'milk'."),
|
|
37
|
+
store_id: storeId(),
|
|
38
|
+
sort: z.enum(["relevance", "price_asc", "price_desc"]).optional()
|
|
39
|
+
.describe("relevance (default), price_asc or price_desc."),
|
|
40
|
+
on_sale: z.boolean().optional()
|
|
41
|
+
.describe("Only products on sale at the store. Default false."),
|
|
42
|
+
diet: diet(),
|
|
43
|
+
category: z.string().min(1).max(100).optional()
|
|
44
|
+
.describe(`Restrict to one category. ${CATEGORY_HELP}`),
|
|
45
|
+
limit: limit(),
|
|
46
|
+
offset: offset(),
|
|
47
|
+
}, post("search"));
|
|
48
|
+
server.tool("get_whole_foods_category", `Browse one Whole Foods Market category at one store, with sort and filters, up to 60 per page. ${PRICE_NOTE} The response has the category breadcrumb, total_results and facets. An unknown category slug is a 404. 1 credit/call.`, {
|
|
49
|
+
category: z.string().min(1).max(100)
|
|
50
|
+
.describe(`${CATEGORY_HELP} 'all-products' lists the whole store.`),
|
|
51
|
+
store_id: storeId(),
|
|
52
|
+
sort: browseSort(),
|
|
53
|
+
on_sale: z.boolean().optional()
|
|
54
|
+
.describe("Only products on sale at the store. Default false."),
|
|
55
|
+
diet: diet(),
|
|
56
|
+
limit: limit(),
|
|
57
|
+
offset: offset(),
|
|
58
|
+
}, post("category"));
|
|
59
|
+
server.tool("get_whole_foods_deals", `Every product on sale at one Whole Foods Market store, store-wide or in one category, up to 60 per page. ${PRICE_NOTE} 1 credit/call.`, {
|
|
60
|
+
category: z.string().min(1).max(100).optional()
|
|
61
|
+
.describe(`${CATEGORY_HELP} Default 'all-products' (every sale item at the store).`),
|
|
62
|
+
store_id: storeId(),
|
|
63
|
+
sort: browseSort(),
|
|
64
|
+
diet: diet(),
|
|
65
|
+
limit: limit(),
|
|
66
|
+
offset: offset(),
|
|
67
|
+
}, post("deals"));
|
|
68
|
+
server.tool("get_whole_foods_product", `One Whole Foods Market product by ASIN, URL or slug: name, brand, description, highlights, ingredients, nutrition facts, diets, SNAP EBT eligibility and images. With store_id, two separately labelled price blocks: in_store (the store's shelf regular, sale and Prime price; null when that store does not list the item) and online (that store's delivery/pickup price, list price, savings, Prime price, unit price and availability; null when it has no online offer). Online and in-store prices often differ. An unknown ASIN is a 404. 1 credit.`, {
|
|
69
|
+
asin: z.string().regex(/^[A-Za-z0-9]{10}$/).optional()
|
|
70
|
+
.describe("Product ASIN (a search result's asin), e.g. 'B0BCBNG8LS'. Pass this, url or slug."),
|
|
71
|
+
url: z.string().url().max(500).optional()
|
|
72
|
+
.describe("A wholefoodsmarket.com product URL."),
|
|
73
|
+
slug: z.string().min(1).max(200).optional()
|
|
74
|
+
.describe("A product slug (a search result's slug), e.g. 'a2-milk-grassfed-whole-milk-59-fz-b0bcbng8ls'."),
|
|
75
|
+
store_id: z.string().regex(/^\d{5}$/).optional()
|
|
76
|
+
.describe("5-digit Whole Foods store id, e.g. '10145'. Adds that store's in-store (shelf) prices and its online (delivery/pickup) price."),
|
|
77
|
+
}, post("product"));
|
|
78
|
+
server.tool("get_whole_foods_stores", `Whole Foods Market stores near a US ZIP code, nearest first, within 15 miles widening to 50: store_id, name, address, phone, coordinates, distance in miles, time zone, and seven days of in-store and pickup hours (UTC times). No store in range is an empty list, not an error. 1 credit.`, {
|
|
79
|
+
zip: z.string().regex(/^\d{5}(-\d{4})?$/)
|
|
80
|
+
.describe("US ZIP code, e.g. '78703'."),
|
|
81
|
+
}, post("stores"));
|
|
82
|
+
server.tool("get_whole_foods_store", `One Whole Foods Market store by id: name, status, phone, Prime eligibility, opening date, address, coordinates, time zone and its store page and sales flyer URLs. An unknown store id is a 404. 1 credit.`, {
|
|
83
|
+
store_id: requiredStoreId(),
|
|
84
|
+
}, post("store"));
|
|
85
|
+
server.tool("get_whole_foods_sales_flyer", `The current weekly sales flyer of one Whole Foods Market store: each promotion's product name, brand, headline, description, terms, regular, sale and Prime price as printed in the flyer (text such as "$3.99/lb" or "44% off"), start and end dates, image, rank and the ASINs it covers. An unknown store id is a 404. 1 credit.`, {
|
|
86
|
+
store_id: requiredStoreId(),
|
|
87
|
+
}, post("sales-flyer"));
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=wholefoods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wholefoods.js","sourceRoot":"","sources":["../../src/tools/wholefoods.ts"],"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
3
|
+
"version": "0.31.1",
|
|
4
4
|
"mcpName": "io.github.scavio-ai/scavio-mcp",
|
|
5
|
-
"description": "MCP server connecting AI agents to Scavio: web search, page extraction, and structured e-commerce, social, travel, jobs, real-estate, app-store, ad-library and company-filing data.
|
|
5
|
+
"description": "MCP server connecting AI agents to Scavio: web search, page extraction, and structured e-commerce, social, travel, jobs, real-estate, app-store, ad-library and company-filing data. 351 tools across 58 platforms plus Extract, site map, crawl and batch extraction, one API key.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "Scavio",
|
|
@@ -33,6 +33,13 @@
|
|
|
33
33
|
"micro-center",
|
|
34
34
|
"walgreens",
|
|
35
35
|
"cvs",
|
|
36
|
+
"whole-foods",
|
|
37
|
+
"harbor-freight",
|
|
38
|
+
"petsmart",
|
|
39
|
+
"petco",
|
|
40
|
+
"iherb",
|
|
41
|
+
"chewy",
|
|
42
|
+
"menards",
|
|
36
43
|
"mercadolibre",
|
|
37
44
|
"mercado-libre",
|
|
38
45
|
"tiktok",
|