@scavio/mcp-server 0.13.1 → 0.14.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 +23 -10
- package/dist/auth/cimd.d.ts +2 -0
- package/dist/auth/cimd.js +20 -0
- package/dist/auth/cimd.js.map +1 -0
- package/dist/auth/provider.d.ts +12 -0
- package/dist/auth/provider.js +43 -0
- package/dist/auth/provider.js.map +1 -0
- package/dist/auth/routes.d.ts +2 -0
- package/dist/auth/routes.js +214 -0
- package/dist/auth/routes.js.map +1 -0
- package/dist/auth/stores.d.ts +33 -0
- package/dist/auth/stores.js +69 -0
- package/dist/auth/stores.js.map +1 -0
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/client.js +4 -1
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/env.d.ts +3 -0
- package/dist/lib/env.js +4 -0
- package/dist/lib/env.js.map +1 -1
- package/dist/lib/errors.d.ts +5 -1
- package/dist/lib/errors.js +5 -1
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/tool-error.js +10 -0
- package/dist/lib/tool-error.js.map +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/index.d.ts +5 -4
- package/dist/tools/index.js +5 -4
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/instagram.js +59 -58
- package/dist/tools/instagram.js.map +1 -1
- package/dist/tools/kuaishou.js +47 -46
- 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 +1 -1
package/dist/tools/booking.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
|
|
@@ -11,102 +12,84 @@ const ISO_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
|
11
12
|
// occupancy block. Built per-tool so no two tool schemas share an instance.
|
|
12
13
|
const stayFields = () => ({
|
|
13
14
|
checkin: z.string().regex(ISO_DATE, "checkin must be YYYY-MM-DD").optional()
|
|
14
|
-
.describe("
|
|
15
|
+
.describe("YYYY-MM-DD. MUST send with checkout."),
|
|
15
16
|
checkout: z.string().regex(ISO_DATE, "checkout must be YYYY-MM-DD").optional()
|
|
16
|
-
.describe("
|
|
17
|
+
.describe("YYYY-MM-DD. MUST send with checkin."),
|
|
17
18
|
adults: z.number().int().min(1).optional()
|
|
18
|
-
.describe("
|
|
19
|
+
.describe("Default 2."),
|
|
19
20
|
children_ages: z.array(z.number().int().min(0).max(17)).max(10).optional()
|
|
20
|
-
.describe("One AGE
|
|
21
|
+
.describe("One AGE per child, not a count."),
|
|
21
22
|
rooms: z.number().int().min(1).optional()
|
|
22
|
-
.describe("
|
|
23
|
+
.describe("Default 1."),
|
|
23
24
|
currency: z.string().regex(/^[A-Za-z]{3}$/, "currency must be a 3-letter ISO 4217 code").optional()
|
|
24
|
-
.describe("
|
|
25
|
+
.describe("e.g. 'USD'. Default USD."),
|
|
25
26
|
});
|
|
26
27
|
const hotelField = () => z.string().min(1).max(500)
|
|
27
|
-
.describe("
|
|
28
|
+
.describe("Booking.com URL or slug. Prefer URL from search_booking; wrong slug+country is a BILLED 404.");
|
|
28
29
|
const countryCodeField = () => z.string().regex(/^[A-Za-z]{2}$/, "country_code must be a two-letter country code").optional()
|
|
29
|
-
.describe("
|
|
30
|
+
.describe("e.g. 'us'. Only for bare slugs. Wrong value is a billed 404.");
|
|
30
31
|
export function registerBookingTools(server, getClient) {
|
|
31
|
-
server.tool("search_booking", `Search Booking.com
|
|
32
|
-
|
|
33
|
-
Either destination or dest_id is required. A search with NEITHER returns Booking's homepage — it still costs a credit and returns nothing. dest_type is silently ignored by Booking without dest_id, so it is rejected here rather than billed.
|
|
34
|
-
|
|
35
|
-
checkin and checkout must be sent TOGETHER. Send only one and Booking prices a default range of its own, returning real prices for dates you never asked for. currency defaults to USD; without it Booking prices off the proxy exit and two identical requests can disagree.
|
|
36
|
-
|
|
37
|
-
Chain the url on a result row into get_booking_hotel or get_booking_reviews — that is always cheaper than guessing a slug plus country_code, which is a real, BILLED 404 when wrong.
|
|
38
|
-
|
|
39
|
-
Paginate with page: 25 properties per page. min_review_score is an ENUM of '6', '7', '8' or '9' — Booking silently drops any other threshold. Costs 1 credit per page.`, {
|
|
32
|
+
server.tool("search_booking", `Search Booking.com stays. Requires destination or dest_id. checkin+checkout MUST be sent together. 25/page. 1 credit/page.`, {
|
|
40
33
|
destination: z.string().min(1).max(200).optional()
|
|
41
|
-
.describe("
|
|
34
|
+
.describe("e.g. 'Austin, Texas'. Required unless dest_id."),
|
|
42
35
|
dest_id: z.string().regex(/^\d+$/, "dest_id must be numeric").optional()
|
|
43
|
-
.describe("
|
|
36
|
+
.describe("Numeric destination id. Required unless destination."),
|
|
44
37
|
dest_type: z.enum(["city", "region", "country", "district", "landmark", "airport", "hotel"]).optional()
|
|
45
|
-
.describe("
|
|
38
|
+
.describe("Only with dest_id."),
|
|
46
39
|
page: z.number().int().min(1).optional()
|
|
47
|
-
.describe("
|
|
40
|
+
.describe("Page, 1-based."),
|
|
48
41
|
sort_by: z.enum(["popularity", "price_low", "price_high", "stars_high", "stars_low", "stars_and_price", "distance", "review_score"]).optional()
|
|
49
|
-
.describe("
|
|
42
|
+
.describe("Sort order."),
|
|
50
43
|
min_price: z.number().min(0).optional()
|
|
51
|
-
.describe("
|
|
44
|
+
.describe("Min price/night."),
|
|
52
45
|
max_price: z.number().min(0).optional()
|
|
53
|
-
.describe("
|
|
46
|
+
.describe("Max price/night."),
|
|
54
47
|
stars: z.array(z.number().int().min(1).max(5)).min(1).max(5).optional()
|
|
55
|
-
.describe("
|
|
48
|
+
.describe("e.g. [4, 5]."),
|
|
56
49
|
min_review_score: z.enum(["6", "7", "8", "9"]).optional()
|
|
57
|
-
.describe("
|
|
50
|
+
.describe("Min review score."),
|
|
58
51
|
property_type: z.union([
|
|
59
52
|
z.enum(["apartments", "hostels", "hotels", "motels", "resorts", "bed_and_breakfasts", "villas", "campgrounds", "vacation_homes", "lodges", "homestays"]),
|
|
60
53
|
z.number().int().min(1),
|
|
61
54
|
]).optional()
|
|
62
|
-
.describe("
|
|
55
|
+
.describe("Type name or numeric id."),
|
|
63
56
|
free_cancellation: z.boolean().optional()
|
|
64
|
-
.describe("
|
|
57
|
+
.describe("Free cancellation only."),
|
|
65
58
|
no_prepayment: z.boolean().optional()
|
|
66
|
-
.describe("
|
|
59
|
+
.describe("No prepayment only."),
|
|
67
60
|
breakfast_included: z.boolean().optional()
|
|
68
|
-
.describe("
|
|
61
|
+
.describe("Breakfast included only."),
|
|
69
62
|
...stayFields(),
|
|
70
63
|
}, async (params) => {
|
|
71
64
|
try {
|
|
72
65
|
const data = await getClient().post("/api/v1/booking/search", params);
|
|
73
|
-
return
|
|
66
|
+
return trimResponse(data);
|
|
74
67
|
}
|
|
75
68
|
catch (err) {
|
|
76
69
|
return handleApiError(err);
|
|
77
70
|
}
|
|
78
71
|
});
|
|
79
|
-
server.tool("get_booking_hotel", `
|
|
80
|
-
|
|
81
|
-
It takes dates because Booking prices a STAY, not a property. Omit them and you do not get a property without prices — you get prices for a two-night range Booking chose. The response echoes whichever dates were used, so a price is never for an unknown stay. checkin and checkout must be sent together.
|
|
82
|
-
|
|
83
|
-
Accepts a booking.com property URL or the bare page slug. country_code is only consulted for a bare slug and defaults to 'us'; a wrong country on a bare slug is a real, BILLED 404, so chaining the url a search_booking row returns is always cheaper.
|
|
84
|
-
|
|
85
|
-
Single-property lookup with NO pagination. Costs 1 credit.`, {
|
|
72
|
+
server.tool("get_booking_hotel", `Full Booking.com property: rooms, rates, facilities, policies. Send checkin+checkout together. 1 credit.`, {
|
|
86
73
|
hotel: hotelField(),
|
|
87
74
|
country_code: countryCodeField(),
|
|
88
75
|
...stayFields(),
|
|
89
76
|
}, async (params) => {
|
|
90
77
|
try {
|
|
91
78
|
const data = await getClient().post("/api/v1/booking/hotel", params);
|
|
92
|
-
return
|
|
79
|
+
return trimResponse(data);
|
|
93
80
|
}
|
|
94
81
|
catch (err) {
|
|
95
82
|
return handleApiError(err);
|
|
96
83
|
}
|
|
97
84
|
});
|
|
98
|
-
server.tool("get_booking_reviews", `
|
|
99
|
-
|
|
100
|
-
There is NO PAGE PARAMETER — do not try to paginate this and do not invent one. One call returns one response: total_count is the property's WHOLE review history, count is how many reviews this response actually holds.
|
|
101
|
-
|
|
102
|
-
Accepts a booking.com property URL or the bare page slug, exactly like get_booking_hotel; country_code is only consulted for a bare slug and a wrong one is a real, BILLED 404. The stay parameters are accepted because Booking serves the review page inside a priced stay context. Costs 1 credit.`, {
|
|
85
|
+
server.tool("get_booking_reviews", `Booking.com guest reviews with score breakdown. No pagination. 1 credit.`, {
|
|
103
86
|
hotel: hotelField(),
|
|
104
87
|
country_code: countryCodeField(),
|
|
105
88
|
...stayFields(),
|
|
106
89
|
}, async (params) => {
|
|
107
90
|
try {
|
|
108
91
|
const data = await getClient().post("/api/v1/booking/reviews", params);
|
|
109
|
-
return
|
|
92
|
+
return trimResponse(data);
|
|
110
93
|
}
|
|
111
94
|
catch (err) {
|
|
112
95
|
return handleApiError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking.js","sourceRoot":"","sources":["../../src/tools/booking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"booking.js","sourceRoot":"","sources":["../../src/tools/booking.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,+EAA+E;AAC/E,+EAA+E;AAC/E,yEAAyE;AACzE,2EAA2E;AAC3E,gFAAgF;AAChF,wBAAwB;AAExB,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AAEvC,8EAA8E;AAC9E,4EAA4E;AAC5E,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CAAC;IACxB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,4BAA4B,CAAC,CAAC,QAAQ,EAAE;SACzE,QAAQ,CAAC,sCAAsC,CAAC;IACnD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC,QAAQ,EAAE;SAC3E,QAAQ,CAAC,qCAAqC,CAAC;IAClD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;SACvC,QAAQ,CAAC,YAAY,CAAC;IACzB,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC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O,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,0EAA0E,EAC1E;QACE,KAAK,EAAE,UAAU,EAAE;QACnB,YAAY,EAAE,gBAAgB,EAAE;QAChC,GAAG,UAAU,EAAE;KAChB,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAC,IAAI,CAAC,yBAAyB,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,CACF,CAAC;AACJ,CAAC"}
|
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,MAAM,SAAS,EAAE,CAAC,IAAI,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC;YACvE,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAAC,OAA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,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,EAAE,MAA+B,EAAE,EAAE;QACvE,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAClD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AAuC,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,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ebay.js","sourceRoot":"","sources":["../../src/tools/ebay.ts"],"names":[],"mappings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E,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"}
|