@scavio/mcp-server 0.13.0 → 0.14.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 +1 -1
- package/dist/lib/trim-response.d.ts +6 -0
- package/dist/lib/trim-response.js +26 -0
- package/dist/lib/trim-response.js.map +1 -0
- package/dist/tools/airbnb.js +30 -49
- package/dist/tools/airbnb.js.map +1 -1
- package/dist/tools/amazon.js +11 -18
- package/dist/tools/amazon.js.map +1 -1
- package/dist/tools/appstore.js +16 -15
- package/dist/tools/appstore.js.map +1 -1
- package/dist/tools/booking.js +28 -45
- package/dist/tools/booking.js.map +1 -1
- package/dist/tools/capterra.js +16 -15
- package/dist/tools/capterra.js.map +1 -1
- package/dist/tools/companieshouse.js +11 -10
- package/dist/tools/companieshouse.js.map +1 -1
- package/dist/tools/ebay.js +21 -30
- package/dist/tools/ebay.js.map +1 -1
- package/dist/tools/extract.js +6 -5
- package/dist/tools/extract.js.map +1 -1
- package/dist/tools/g2.js +23 -22
- package/dist/tools/g2.js.map +1 -1
- package/dist/tools/glassdoor.js +18 -17
- package/dist/tools/glassdoor.js.map +1 -1
- package/dist/tools/google.js +154 -153
- package/dist/tools/google.js.map +1 -1
- package/dist/tools/googleads.js +20 -19
- package/dist/tools/googleads.js.map +1 -1
- package/dist/tools/googleplay.js +14 -13
- package/dist/tools/googleplay.js.map +1 -1
- package/dist/tools/homedepot.js +15 -28
- package/dist/tools/homedepot.js.map +1 -1
- package/dist/tools/indeed.js +20 -39
- package/dist/tools/indeed.js.map +1 -1
- package/dist/tools/instagram.js +59 -58
- package/dist/tools/instagram.js.map +1 -1
- package/dist/tools/kuaishou.js +49 -48
- package/dist/tools/kuaishou.js.map +1 -1
- package/dist/tools/linkedin.js +26 -25
- package/dist/tools/linkedin.js.map +1 -1
- package/dist/tools/metaads.js +21 -20
- package/dist/tools/metaads.js.map +1 -1
- package/dist/tools/reddit.js +48 -47
- package/dist/tools/reddit.js.map +1 -1
- package/dist/tools/redfin.js +29 -28
- package/dist/tools/redfin.js.map +1 -1
- package/dist/tools/sec.js +36 -35
- package/dist/tools/sec.js.map +1 -1
- package/dist/tools/target.js +19 -40
- package/dist/tools/target.js.map +1 -1
- package/dist/tools/threads.js +20 -19
- package/dist/tools/threads.js.map +1 -1
- package/dist/tools/tiktok-shop.js +38 -37
- package/dist/tools/tiktok-shop.js.map +1 -1
- package/dist/tools/tiktok.js +54 -53
- package/dist/tools/tiktok.js.map +1 -1
- package/dist/tools/tripadvisor.js +20 -43
- package/dist/tools/tripadvisor.js.map +1 -1
- package/dist/tools/usage.js +3 -2
- package/dist/tools/usage.js.map +1 -1
- package/dist/tools/walmart.js +35 -34
- package/dist/tools/walmart.js.map +1 -1
- package/dist/tools/x.js +44 -43
- package/dist/tools/x.js.map +1 -1
- package/dist/tools/yelp.js +21 -20
- package/dist/tools/yelp.js.map +1 -1
- package/dist/tools/youtube.js +77 -76
- package/dist/tools/youtube.js.map +1 -1
- package/dist/tools/zillow.js +38 -53
- package/dist/tools/zillow.js.map +1 -1
- package/package.json +2 -2
package/dist/tools/capterra.js
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { handleApiError } from "../lib/tool-error.js";
|
|
3
|
+
import { trimResponse } from "../lib/trim-response.js";
|
|
3
4
|
export function registerCapterraTools(server, getClient) {
|
|
4
|
-
server.tool("search_capterra_software", `
|
|
5
|
+
server.tool("search_capterra_software", `Search Capterra for B2B software. Max 20 results, no pagination. query or url required. 2 credits.`, {
|
|
5
6
|
query: z.string().min(1).max(200).optional()
|
|
6
|
-
.describe("Software search term
|
|
7
|
+
.describe("Software search term. Either this or url required."),
|
|
7
8
|
url: z.string().min(1).max(1000).optional()
|
|
8
|
-
.describe("
|
|
9
|
+
.describe("Capterra search URL. Either this or query required."),
|
|
9
10
|
}, async (params) => {
|
|
10
11
|
try {
|
|
11
12
|
const data = await getClient().post("/api/v1/capterra/search", params);
|
|
12
|
-
return
|
|
13
|
+
return trimResponse(data);
|
|
13
14
|
}
|
|
14
15
|
catch (err) {
|
|
15
16
|
return handleApiError(err);
|
|
16
17
|
}
|
|
17
18
|
});
|
|
18
|
-
server.tool("get_capterra_product", `
|
|
19
|
+
server.tool("get_capterra_product", `Get full Capterra product profile with 25 most recent reviews included. Use get_capterra_reviews only to page past them. product_id (string, not number) or url required. 2 credits.`, {
|
|
19
20
|
product_id: z.string().min(1).max(50).optional()
|
|
20
|
-
.describe("
|
|
21
|
+
.describe("Product id as string, e.g. '186596'. Either this or url required."),
|
|
21
22
|
slug: z.string().min(1).max(200).optional()
|
|
22
|
-
.describe("Product slug.
|
|
23
|
+
.describe("Product slug. Cosmetic here, load-bearing on get_capterra_reviews."),
|
|
23
24
|
url: z.string().min(1).max(1000).optional()
|
|
24
|
-
.describe("
|
|
25
|
+
.describe("Capterra product URL. Either this or product_id required."),
|
|
25
26
|
}, async (params) => {
|
|
26
27
|
try {
|
|
27
28
|
const data = await getClient().post("/api/v1/capterra/product", params);
|
|
28
|
-
return
|
|
29
|
+
return trimResponse(data);
|
|
29
30
|
}
|
|
30
31
|
catch (err) {
|
|
31
32
|
return handleApiError(err);
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
|
-
server.tool("get_capterra_reviews", `
|
|
35
|
+
server.tool("get_capterra_reviews", `Page past the 25 reviews in get_capterra_product. 25/page, max page 100. slug is LOAD-BEARING here (case-sensitive; wrong slug silently returns page 1). product_id or url required. 2 credits/page.`, {
|
|
35
36
|
product_id: z.string().min(1).max(50).optional()
|
|
36
|
-
.describe("
|
|
37
|
+
.describe("Product id as string. Either this or url required."),
|
|
37
38
|
slug: z.string().min(1).max(200).optional()
|
|
38
|
-
.describe("Product slug. LOAD-BEARING
|
|
39
|
+
.describe("Product slug. LOAD-BEARING, case-sensitive. Use slug from search/product."),
|
|
39
40
|
url: z.string().min(1).max(1000).optional()
|
|
40
|
-
.describe("
|
|
41
|
+
.describe("Capterra reviews URL. Prefer reviews_url from get_capterra_product."),
|
|
41
42
|
page: z.number().int().min(1).max(100).optional()
|
|
42
|
-
.describe("Page
|
|
43
|
+
.describe("Page 1-100. 25/page. Past 100 returns page 1."),
|
|
43
44
|
}, async (params) => {
|
|
44
45
|
try {
|
|
45
46
|
const data = await getClient().post("/api/v1/capterra/reviews", params);
|
|
46
|
-
return
|
|
47
|
+
return trimResponse(data);
|
|
47
48
|
}
|
|
48
49
|
catch (err) {
|
|
49
50
|
return handleApiError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capterra.js","sourceRoot":"","sources":["../../src/tools/capterra.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"capterra.js","sourceRoot":"","sources":["../../src/tools/capterra.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,qBAAqB,CAAC,MAAiB,EAAE,SAA6B;IACpF,MAAM,CAAC,IAAI,CACT,0BAA0B,EAC1B,oGAAoG,EACpG;QACE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;aACzC,QAAQ,CAAC,oDAAoD,CAAC;QACjE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;aACxC,QAAQ,CAAC,qDAAqD,CAAC;KACnE,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,IAAI,CAAC;YACH,MAAM,IAAI,GAAG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AQ,EAAE;aAC7C,QAAQ,CAAC,oDAAoD,CAAC;QACjE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;aACxC,QAAQ,CAAC,2EAA2E,CAAC;QACxF,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;aACxC,QAAQ,CAAC,qEAAqE,CAAC;QAClF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;aAC9C,QAAQ,CAAC,+CAA+C,CAAC;KAC7D,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAC,IAAI,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC;YACxE,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { handleApiError } from "../lib/tool-error.js";
|
|
3
|
+
import { trimResponse } from "../lib/trim-response.js";
|
|
3
4
|
// Companies House - the official UK company register. Four tools, 1 credit
|
|
4
5
|
// each, flat.
|
|
5
6
|
//
|
|
@@ -21,36 +22,36 @@ import { handleApiError } from "../lib/tool-error.js";
|
|
|
21
22
|
// every call. The backend applies its own defaults when a field is absent;
|
|
22
23
|
// they are documented in the .describe() text instead.
|
|
23
24
|
const companyNumber = z.string().min(1).max(20)
|
|
24
|
-
.describe("UK company number,
|
|
25
|
+
.describe("UK company number, e.g. '00445790'. Auto zero-padded/upper-cased.");
|
|
25
26
|
export function registerCompaniesHouseTools(server, getClient) {
|
|
26
27
|
const call = (path) => async (params) => {
|
|
27
28
|
try {
|
|
28
29
|
const data = await getClient().post(path, params);
|
|
29
|
-
return
|
|
30
|
+
return trimResponse(data);
|
|
30
31
|
}
|
|
31
32
|
catch (err) {
|
|
32
33
|
return handleApiError(err);
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
|
-
server.tool("search_companies_house", `
|
|
36
|
+
server.tool("search_companies_house", `Search UK Companies House by name or number. Returns company_number needed by other Companies House tools. UK only, max page 50. 1 credit.`, {
|
|
36
37
|
query: z.string().min(1).max(200)
|
|
37
|
-
.describe("Company name or number
|
|
38
|
+
.describe("Company name or number, e.g. 'tesco'."),
|
|
38
39
|
page: z.number().int().min(1).max(50)
|
|
39
40
|
.optional()
|
|
40
|
-
.describe("
|
|
41
|
+
.describe("Page, 1-based, 20/page. Max 50."),
|
|
41
42
|
}, call("/api/v1/companieshouse/search"));
|
|
42
|
-
server.tool("get_companies_house_company", `Get a UK company's full
|
|
43
|
+
server.tool("get_companies_house_company", `Get a UK company's full Companies House record: status, type, dates, address, SIC codes, previous names, accounts. 1 credit.`, {
|
|
43
44
|
company_number: companyNumber,
|
|
44
45
|
}, call("/api/v1/companieshouse/company"));
|
|
45
|
-
server.tool("get_companies_house_officers", `List a UK company's officers
|
|
46
|
+
server.tool("get_companies_house_officers", `List a UK company's officers (current and resigned). No server-side active filter; check status in response. 35/page, stop on empty page. 1 credit.`, {
|
|
46
47
|
company_number: companyNumber,
|
|
47
48
|
page: z.number().int().min(1).optional()
|
|
48
|
-
.describe("
|
|
49
|
+
.describe("Page, 1-based, 35/page. Empty page = no more."),
|
|
49
50
|
}, call("/api/v1/companieshouse/officers"));
|
|
50
|
-
server.tool("get_companies_house_filing_history", `List a UK company's
|
|
51
|
+
server.tool("get_companies_house_filing_history", `List a UK company's filing history (most recent first) with PDF links. Stop on empty page. 1 credit.`, {
|
|
51
52
|
company_number: companyNumber,
|
|
52
53
|
page: z.number().int().min(1).optional()
|
|
53
|
-
.describe("
|
|
54
|
+
.describe("Page, 1-based. Empty page = no more."),
|
|
54
55
|
}, call("/api/v1/companieshouse/filing-history"));
|
|
55
56
|
}
|
|
56
57
|
//# sourceMappingURL=companieshouse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companieshouse.js","sourceRoot":"","sources":["../../src/tools/companieshouse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"companieshouse.js","sourceRoot":"","sources":["../../src/tools/companieshouse.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,cAAc;AACd,EAAE;AACF,4EAA4E;AAC5E,sEAAsE;AACtE,4EAA4E;AAC5E,4EAA4E;AAC5E,iBAAiB;AACjB,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,yEAAyE;AACzE,0EAA0E;AAC1E,6EAA6E;AAC7E,+EAA+E;AAC/E,EAAE;AACF,+EAA+E;AAC/E,4EAA4E;AAC5E,2EAA2E;AAC3E,uDAAuD;AAEvD,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;KAC5C,QAAQ,CAAC,mEAAmE,CAAC,CAAC;AAEjF,MAAM,UAAU,2BAA2B,CAAC,MAAiB,EAAE,SAA6B;IAC1F,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,EA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M,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;aACrC,QAAQ,CAAC,sCAAsC,CAAC;KACpD,EACD,IAAI,CAAC,uCAAuC,CAAC,CAC9C,CAAC;AACJ,CAAC"}
|
package/dist/tools/ebay.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { handleApiError } from "../lib/tool-error.js";
|
|
3
|
+
import { trimResponse } from "../lib/trim-response.js";
|
|
3
4
|
// No zod `.default()` anywhere in this file, on purpose. The MCP SDK applies a
|
|
4
5
|
// zod default BEFORE the handler runs, so a defaulted field is posted on every
|
|
5
6
|
// single call whether the model set it or not — which is exactly how the
|
|
@@ -7,69 +8,59 @@ import { handleApiError } from "../lib/tool-error.js";
|
|
|
7
8
|
// Upstream defaults are documented in the .describe() text instead and left for
|
|
8
9
|
// the backend to apply.
|
|
9
10
|
export function registerEbayTools(server, getClient) {
|
|
10
|
-
server.tool("search_ebay", `Search live or
|
|
11
|
-
|
|
12
|
-
Set sold=true to search COMPLETED listings that actually sold. That is the price-research view and the reason to reach for eBay rather than a retail catalogue: it shows what buyers really paid, not what sellers are asking. On the sold view eBay publishes no headline count, so total_results is NULL — count still tells you how many rows came back.
|
|
13
|
-
|
|
14
|
-
Either query or seller is required. Passing seller ALONE with no keyword pages that seller's entire catalogue, and this is the only way to enumerate a seller's inventory — get_ebay_seller is a profile card and cannot list items.
|
|
15
|
-
|
|
16
|
-
Paginate with page. per_page accepts ONLY 60, 120 or 240; eBay silently falls back to 60 for any other value rather than erroring. category_id must be numeric — an unrecognised id returns the UNFILTERED result set under a 200, so verify the filter took effect. condition 'refurbished' is eBay's parent condition, not one of its three graded tiers. Costs 1 credit per page.`, {
|
|
11
|
+
server.tool("search_ebay", `Search eBay live or sold listings. sold=true for completed-sale price research. Either query or seller required; seller alone pages their catalogue. per_page only 60/120/240. 1 credit/page.`, {
|
|
17
12
|
query: z.string().min(1).max(500).optional()
|
|
18
|
-
.describe("
|
|
13
|
+
.describe("Search keywords. Either this or seller required."),
|
|
19
14
|
seller: z.string().min(1).max(64).optional()
|
|
20
|
-
.describe("
|
|
15
|
+
.describe("Seller username. Alone (no query) pages their catalogue."),
|
|
21
16
|
page: z.number().int().min(1).optional()
|
|
22
|
-
.describe("
|
|
17
|
+
.describe("Page, 1-based."),
|
|
23
18
|
sort_by: z.enum(["best_match", "ending_soonest", "newly_listed", "price_low", "price_high"]).optional()
|
|
24
|
-
.describe("Sort order.
|
|
19
|
+
.describe("Sort order."),
|
|
25
20
|
min_price: z.number().min(0).optional()
|
|
26
|
-
.describe("
|
|
21
|
+
.describe("Min price."),
|
|
27
22
|
max_price: z.number().min(0).optional()
|
|
28
|
-
.describe("
|
|
23
|
+
.describe("Max price."),
|
|
29
24
|
condition: z.enum(["new", "open_box", "refurbished", "used", "for_parts"]).optional()
|
|
30
|
-
.describe("
|
|
25
|
+
.describe("Condition filter."),
|
|
31
26
|
buying_format: z.enum(["auction", "buy_it_now", "best_offer"]).optional()
|
|
32
|
-
.describe("Listing format
|
|
27
|
+
.describe("Listing format."),
|
|
33
28
|
free_shipping: z.boolean().optional()
|
|
34
|
-
.describe("
|
|
29
|
+
.describe("Free shipping only."),
|
|
35
30
|
sold: z.boolean().optional()
|
|
36
|
-
.describe("
|
|
31
|
+
.describe("Completed sold listings for price research."),
|
|
37
32
|
category_id: z.string().optional()
|
|
38
|
-
.describe("eBay
|
|
33
|
+
.describe("Numeric eBay category id."),
|
|
39
34
|
per_page: z.union([z.literal(60), z.literal(120), z.literal(240)]).optional()
|
|
40
|
-
.describe("Results per page.
|
|
35
|
+
.describe("Results per page. Only 60, 120, 240."),
|
|
41
36
|
}, async (params) => {
|
|
42
37
|
try {
|
|
43
38
|
const data = await getClient().post("/api/v1/ebay/search", params);
|
|
44
|
-
return
|
|
39
|
+
return trimResponse(data);
|
|
45
40
|
}
|
|
46
41
|
catch (err) {
|
|
47
42
|
return handleApiError(err);
|
|
48
43
|
}
|
|
49
44
|
});
|
|
50
|
-
server.tool("get_ebay_product", `Get
|
|
51
|
-
|
|
52
|
-
Accepts an eBay item number or a full ebay.com/itm/... URL — tracking query params are discarded for you. This is a single-listing lookup with no pagination. Costs 1 credit.`, {
|
|
45
|
+
server.tool("get_ebay_product", `Get full eBay listing details: specs, images, shipping, auction state, seller info. 1 credit.`, {
|
|
53
46
|
item_id: z.string().min(1)
|
|
54
|
-
.describe("
|
|
47
|
+
.describe("Item number or ebay.com/itm/ URL."),
|
|
55
48
|
}, async (params) => {
|
|
56
49
|
try {
|
|
57
50
|
const data = await getClient().post("/api/v1/ebay/product", params);
|
|
58
|
-
return
|
|
51
|
+
return trimResponse(data);
|
|
59
52
|
}
|
|
60
53
|
catch (err) {
|
|
61
54
|
return handleApiError(err);
|
|
62
55
|
}
|
|
63
56
|
});
|
|
64
|
-
server.tool("get_ebay_seller", `Get
|
|
65
|
-
|
|
66
|
-
PROFILE ONLY — this endpoint CANNOT enumerate a catalogue and returns no listings. To read what a seller currently has for sale, call search_ebay with seller set and no query; that path is paginated. Accepts the username exactly as it appears in ebay.com/usr/<name>. No pagination. Costs 1 credit.`, {
|
|
57
|
+
server.tool("get_ebay_seller", `Get eBay seller profile. No listings; use search_ebay with seller param for inventory. 1 credit.`, {
|
|
67
58
|
seller: z.string().min(1).max(64)
|
|
68
|
-
.describe("
|
|
59
|
+
.describe("Seller username."),
|
|
69
60
|
}, async (params) => {
|
|
70
61
|
try {
|
|
71
62
|
const data = await getClient().post("/api/v1/ebay/seller", params);
|
|
72
|
-
return
|
|
63
|
+
return trimResponse(data);
|
|
73
64
|
}
|
|
74
65
|
catch (err) {
|
|
75
66
|
return handleApiError(err);
|
package/dist/tools/ebay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ebay.js","sourceRoot":"","sources":["../../src/tools/ebay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,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C;QAC7B,CAAC;IACH,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,kBAAkB,EAClB,+FAA+F,EAC/F;QACE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;aACvB,QAAQ,CAAC,mCAAmC,CAAC;KACjD,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;YACpE,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,iBAAiB,EACjB,kGAAkG,EAClG;QACE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;aAC9B,QAAQ,CAAC,kBAAkB,CAAC;KAChC,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAC,IAAI,CAAC,qBAAqB,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,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/extract.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { handleApiError } from "../lib/tool-error.js";
|
|
3
|
+
import { trimResponse } from "../lib/trim-response.js";
|
|
3
4
|
export function registerExtractTool(server, getClient) {
|
|
4
|
-
server.tool("extract_url", `Read any web page
|
|
5
|
+
server.tool("extract_url", `Read any web page as Markdown, text, or HTML. Tier-priced: normal=1cr, advanced(JS render)=1cr, ultra(residential proxy)=2cr. Start normal, escalate on empty/blocked. Only billed on success.`, {
|
|
5
6
|
url: z.string().min(1).max(2048)
|
|
6
|
-
.describe("
|
|
7
|
+
.describe("http(s) URL. Bare hosts upgraded to https. Private/loopback rejected."),
|
|
7
8
|
format: z.enum(["html", "markdown", "text"]).optional()
|
|
8
|
-
.describe("
|
|
9
|
+
.describe("'markdown' (default), 'text', or 'html'."),
|
|
9
10
|
mode: z.enum(["normal", "advanced", "ultra"]).optional()
|
|
10
|
-
.describe("
|
|
11
|
+
.describe("PRICE-BEARING. 'normal'=1cr (default), 'advanced'=JS render 1cr, 'ultra'=residential 2cr."),
|
|
11
12
|
}, async (params) => {
|
|
12
13
|
try {
|
|
13
14
|
const data = await getClient().post("/api/v1/extract", params);
|
|
14
|
-
return
|
|
15
|
+
return trimResponse(data);
|
|
15
16
|
}
|
|
16
17
|
catch (err) {
|
|
17
18
|
return handleApiError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/tools/extract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/tools/extract.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,mBAAmB,CAAC,MAAiB,EAAE,SAA6B;IAClF,MAAM,CAAC,IAAI,CACT,aAAa,EACb,gMAAgM,EAChM;QACE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;aAC7B,QAAQ,CAAC,uEAAuE,CAAC;QACpF,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;aACpD,QAAQ,CAAC,0CAA0C,CAAC;QACvD,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;aACrD,QAAQ,CAAC,2FAA2F,CAAC;KACzG,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;YAC/D,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/g2.js
CHANGED
|
@@ -1,65 +1,66 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { handleApiError } from "../lib/tool-error.js";
|
|
3
|
+
import { trimResponse } from "../lib/trim-response.js";
|
|
3
4
|
export function registerG2Tools(server, getClient) {
|
|
4
|
-
server.tool("search_g2_software", `G2
|
|
5
|
+
server.tool("search_g2_software", `Search G2 B2B software products. 5 credits/call (most expensive platform). Query or url required.`, {
|
|
5
6
|
query: z.string().min(1).max(200).optional()
|
|
6
|
-
.describe("
|
|
7
|
+
.describe("Search term, e.g. 'project management'."),
|
|
7
8
|
url: z.string().min(1).max(1000).optional()
|
|
8
|
-
.describe("
|
|
9
|
+
.describe("g2.com search URL instead of query."),
|
|
9
10
|
page: z.number().int().min(1).optional()
|
|
10
|
-
.describe("Page
|
|
11
|
+
.describe("Page, 1-based."),
|
|
11
12
|
limit: z.number().int().min(1).max(100).optional()
|
|
12
|
-
.describe("
|
|
13
|
+
.describe("Per page, 1-100. Default 20."),
|
|
13
14
|
sort: z.enum(["relevance", "popular", "alphabetical", "rating"]).optional()
|
|
14
|
-
.describe("Sort order
|
|
15
|
+
.describe("Sort order."),
|
|
15
16
|
rating: z.number().int().min(1).max(5).optional()
|
|
16
|
-
.describe("
|
|
17
|
+
.describe("Min star rating."),
|
|
17
18
|
}, async (params) => {
|
|
18
19
|
try {
|
|
19
20
|
const data = await getClient().post("/api/v1/g2/search", params);
|
|
20
|
-
return
|
|
21
|
+
return trimResponse(data);
|
|
21
22
|
}
|
|
22
23
|
catch (err) {
|
|
23
24
|
return handleApiError(err);
|
|
24
25
|
}
|
|
25
26
|
});
|
|
26
|
-
server.tool("get_g2_product", `
|
|
27
|
+
server.tool("get_g2_product", `Get G2 product profile: ratings, pricing, features, alternatives. No review text; use get_g2_reviews. 5 credits.`, {
|
|
27
28
|
product_id: z.string().min(1).max(200).optional()
|
|
28
|
-
.describe("
|
|
29
|
+
.describe("Product slug ('notion') or numeric id ('82623')."),
|
|
29
30
|
url: z.string().min(1).max(1000).optional()
|
|
30
|
-
.describe("
|
|
31
|
+
.describe("g2.com product URL instead of product_id."),
|
|
31
32
|
}, async (params) => {
|
|
32
33
|
try {
|
|
33
34
|
const data = await getClient().post("/api/v1/g2/product", params);
|
|
34
|
-
return
|
|
35
|
+
return trimResponse(data);
|
|
35
36
|
}
|
|
36
37
|
catch (err) {
|
|
37
38
|
return handleApiError(err);
|
|
38
39
|
}
|
|
39
40
|
});
|
|
40
|
-
server.tool("get_g2_reviews", `G2
|
|
41
|
+
server.tool("get_g2_reviews", `Get G2 review text for a product. 10 per page. rating filter is half-star-inclusive. 5 credits/page.`, {
|
|
41
42
|
product_id: z.string().min(1).max(200).optional()
|
|
42
|
-
.describe("
|
|
43
|
+
.describe("Product slug or numeric id."),
|
|
43
44
|
url: z.string().min(1).max(1000).optional()
|
|
44
|
-
.describe("
|
|
45
|
+
.describe("g2.com reviews URL instead of product_id."),
|
|
45
46
|
page: z.number().int().min(1).optional()
|
|
46
|
-
.describe("Page
|
|
47
|
+
.describe("Page, 1-based. 10 per page."),
|
|
47
48
|
sort: z.enum(["relevance", "newest", "most_helpful", "rating_high", "rating_low"]).optional()
|
|
48
|
-
.describe("
|
|
49
|
+
.describe("Sort order."),
|
|
49
50
|
rating: z.number().int().min(1).max(5).optional()
|
|
50
|
-
.describe("Star bucket
|
|
51
|
+
.describe("Star bucket. Half-star-inclusive: 1 includes 0-1 stars."),
|
|
51
52
|
company_size: z.enum(["small_business", "mid_market", "enterprise"]).optional()
|
|
52
|
-
.describe("
|
|
53
|
+
.describe("small_business <=50, mid_market 51-1000, enterprise >1000."),
|
|
53
54
|
role: z.enum(["user", "administrator", "executive_sponsor", "internal_consultant", "consultant", "agency", "industry_analyst"]).optional()
|
|
54
|
-
.describe("Reviewer
|
|
55
|
+
.describe("Reviewer role."),
|
|
55
56
|
region: z.enum(["north_america", "europe", "asia", "latin_america", "anz", "middle_east", "africa"]).optional()
|
|
56
57
|
.describe("Reviewer region."),
|
|
57
58
|
query: z.string().min(1).max(200).optional()
|
|
58
|
-
.describe("
|
|
59
|
+
.describe("Text search within reviews."),
|
|
59
60
|
}, async (params) => {
|
|
60
61
|
try {
|
|
61
62
|
const data = await getClient().post("/api/v1/g2/reviews", params);
|
|
62
|
-
return
|
|
63
|
+
return trimResponse(data);
|
|
63
64
|
}
|
|
64
65
|
catch (err) {
|
|
65
66
|
return handleApiError(err);
|
package/dist/tools/g2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"g2.js","sourceRoot":"","sources":["../../src/tools/g2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file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AAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;aACzC,QAAQ,CAAC,6BAA6B,CAAC;KAC3C,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;YAClE,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/glassdoor.js
CHANGED
|
@@ -1,68 +1,69 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { handleApiError } from "../lib/tool-error.js";
|
|
3
|
+
import { trimResponse } from "../lib/trim-response.js";
|
|
3
4
|
// employer_id / company / url repeat on three of the four endpoints. `company`
|
|
4
5
|
// is cosmetic on all of them and does NOT satisfy the identifier requirement —
|
|
5
6
|
// the backend refine takes employer_id or url only.
|
|
6
7
|
const employerIdField = z.string().min(1).max(50).optional()
|
|
7
|
-
.describe("
|
|
8
|
+
.describe("Employer id as string, e.g. '1699' or 'E1699'. Not a number. Either this or url required.");
|
|
8
9
|
const companyField = z.string().min(1).max(200).optional()
|
|
9
|
-
.describe("Employer name
|
|
10
|
+
.describe("Employer slug name, e.g. 'NIKE'. Cosmetic only.");
|
|
10
11
|
export function registerGlassdoorTools(server, getClient) {
|
|
11
|
-
server.tool("resolve_glassdoor_company", `
|
|
12
|
+
server.tool("resolve_glassdoor_company", `Resolve a company name to a Glassdoor employer_id. Start here. Slow (seconds-minutes), retry on 502. 1 credit.`, {
|
|
12
13
|
query: z.string().min(1).max(120)
|
|
13
|
-
.describe("Company name
|
|
14
|
+
.describe("Company name, e.g. 'Nike'."),
|
|
14
15
|
}, async (params) => {
|
|
15
16
|
try {
|
|
16
17
|
const data = await getClient().post("/api/v1/glassdoor/companies", params);
|
|
17
|
-
return
|
|
18
|
+
return trimResponse(data);
|
|
18
19
|
}
|
|
19
20
|
catch (err) {
|
|
20
21
|
return handleApiError(err);
|
|
21
22
|
}
|
|
22
23
|
});
|
|
23
|
-
server.tool("get_glassdoor_company", `Get
|
|
24
|
+
server.tool("get_glassdoor_company", `Get Glassdoor employer profile with ratings, reviews, and reviews_url/salaries_url for chaining. employer_id or url required. Slow; retry on 502. 1 credit.`, {
|
|
24
25
|
employer_id: employerIdField,
|
|
25
26
|
company: companyField,
|
|
26
27
|
url: z.string().min(1).max(500).optional()
|
|
27
|
-
.describe("
|
|
28
|
+
.describe("Glassdoor employer URL. Either this or employer_id required."),
|
|
28
29
|
}, async (params) => {
|
|
29
30
|
try {
|
|
30
31
|
const data = await getClient().post("/api/v1/glassdoor/company", params);
|
|
31
|
-
return
|
|
32
|
+
return trimResponse(data);
|
|
32
33
|
}
|
|
33
34
|
catch (err) {
|
|
34
35
|
return handleApiError(err);
|
|
35
36
|
}
|
|
36
37
|
});
|
|
37
|
-
server.tool("get_glassdoor_reviews", `Get Glassdoor
|
|
38
|
+
server.tool("get_glassdoor_reviews", `Get Glassdoor reviews (max 3 per call, login wall). No pagination. Use category/employment_status to shift window. Pass reviews_url from get_glassdoor_company as url to skip a fetch. Slow (~75s). 1 credit.`, {
|
|
38
39
|
employer_id: employerIdField,
|
|
39
40
|
company: companyField,
|
|
40
41
|
url: z.string().min(1).max(500).optional()
|
|
41
|
-
.describe("
|
|
42
|
+
.describe("Glassdoor URL. Prefer reviews_url from get_glassdoor_company. Either this or employer_id."),
|
|
42
43
|
category: z.enum(["career_development", "compensation", "culture", "diversity_and_inclusion", "management", "work_life_balance"]).optional()
|
|
43
|
-
.describe("
|
|
44
|
+
.describe("Review topic filter."),
|
|
44
45
|
employment_status: z.enum(["full_time", "part_time", "contract", "intern"]).optional()
|
|
45
|
-
.describe("
|
|
46
|
+
.describe("Employment type filter."),
|
|
46
47
|
}, async (params) => {
|
|
47
48
|
try {
|
|
48
49
|
const data = await getClient().post("/api/v1/glassdoor/reviews", params);
|
|
49
|
-
return
|
|
50
|
+
return trimResponse(data);
|
|
50
51
|
}
|
|
51
52
|
catch (err) {
|
|
52
53
|
return handleApiError(err);
|
|
53
54
|
}
|
|
54
55
|
});
|
|
55
|
-
server.tool("get_glassdoor_salaries", `Get Glassdoor salary
|
|
56
|
+
server.tool("get_glassdoor_salaries", `Get Glassdoor salary estimates by job title (P10-P90 percentiles). 10 titles/page. Pass salaries_url from get_glassdoor_company to skip a fetch. Slow (~41s). 1 credit/page.`, {
|
|
56
57
|
employer_id: employerIdField,
|
|
57
58
|
company: companyField,
|
|
58
59
|
url: z.string().min(1).max(500).optional()
|
|
59
|
-
.describe("
|
|
60
|
+
.describe("Glassdoor URL. Prefer salaries_url from get_glassdoor_company. Either this or employer_id."),
|
|
60
61
|
page: z.number().int().min(1).optional()
|
|
61
|
-
.describe("
|
|
62
|
+
.describe("Page, 1-based. 10 titles/page."),
|
|
62
63
|
}, async (params) => {
|
|
63
64
|
try {
|
|
64
65
|
const data = await getClient().post("/api/v1/glassdoor/salaries", params);
|
|
65
|
-
return
|
|
66
|
+
return trimResponse(data);
|
|
66
67
|
}
|
|
67
68
|
catch (err) {
|
|
68
69
|
return handleApiError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glassdoor.js","sourceRoot":"","sources":["../../src/tools/glassdoor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"glassdoor.js","sourceRoot":"","sources":["../../src/tools/glassdoor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,C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