@crawlbrulee/mcp 1.1.0 → 1.2.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 +33 -29
- package/dist/index.js +35 -35
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -85,9 +85,12 @@ html, raw html, links, images, screenshot, page metadata).
|
|
|
85
85
|
"cleanup": { "ads_and_popups": true, "exclude_selectors": ["nav", "footer"] },
|
|
86
86
|
"cache": { "max_age": 3600 },
|
|
87
87
|
"location": { "locale": "en-US", "country": "US" },
|
|
88
|
+
"zero_data_retention": false,
|
|
88
89
|
}
|
|
89
90
|
```
|
|
90
91
|
|
|
92
|
+
`zero_data_retention` (boolean, default `false`) keeps the result out of the shared cache; anything stored to deliver it is kept for 24 hours, then deleted. it adds 1 credit and must be enabled for your organization. `scrape_async` takes it too. see [zero data retention](https://crawlbrulee.com/docs/zero-data-retention).
|
|
93
|
+
|
|
91
94
|
**output** — full scrape result. page metadata (title, OG tags, etc.) is returned under `metadata`. extracted `images` are returned as absolute urls — query strings are preserved, and relative `src`s are resolved against the page url. screenshots are returned as signed download urls the agent can fetch separately. in rare cases a screenshot can't be captured: when you requested other outputs too, the `screenshot` field is simply left out while the rest is still returned — but a screenshot-only call that can't deliver errors instead (`unsupported_screenshot_output`, HTTP 422, when the content type can't be screenshotted) and isn't billed. the result also carries `page_status_code` and a top-level `response_meta.usage` block:
|
|
92
95
|
|
|
93
96
|
```jsonc
|
|
@@ -99,15 +102,14 @@ html, raw html, links, images, screenshot, page metadata).
|
|
|
99
102
|
"metadata": { "title": "Example Domain" },
|
|
100
103
|
"response_meta": {
|
|
101
104
|
"usage": {
|
|
102
|
-
// total_credit_cost = engine_credit_cost × proxy_multiplier + screenshot_slicing_credit_cost
|
|
105
|
+
// total_credit_cost = engine_credit_cost × proxy_multiplier + screenshot_slicing_credit_cost + zero_data_retention_credit_cost
|
|
103
106
|
"total_credit_cost": 1,
|
|
104
107
|
"engine_credit_cost": 1, // http 1, browser 3, screenshot 5, cache 0
|
|
105
108
|
"proxy_multiplier": 1, // basic 1, advanced 5
|
|
106
109
|
"screenshot_slicing_credit_cost": 0, // 1 when the screenshot was split into slices, otherwise 0
|
|
110
|
+
"zero_data_retention_credit_cost": 0, // 1 when zero_data_retention added its credit, otherwise 0
|
|
107
111
|
"engine": "http", // "http" | "browser" | "screenshot" | "cache"
|
|
108
112
|
"proxy": "basic", // resolved tier actually used: "basic" | "advanced" (never "auto")
|
|
109
|
-
"credits": 1, // deprecated: same as total_credit_cost
|
|
110
|
-
"screenshot_slices": 0, // deprecated: same as screenshot_slicing_credit_cost
|
|
111
113
|
},
|
|
112
114
|
},
|
|
113
115
|
}
|
|
@@ -115,8 +117,6 @@ html, raw html, links, images, screenshot, page metadata).
|
|
|
115
117
|
|
|
116
118
|
**a page the site served is a result, not an error.** `page_status_code` is the HTTP status the site answered with for the final page, after redirects. a 404, 410 or 503 page comes back with its content and its status here, so check `page_status_code` before you trust the content: a 404 means the markdown is the site's "not found" page. 2xx and 4xx pages are billed, except 403, 407, 408, 429 and 451; 5xx pages are never billed. when the site can't be reached at all, the tool returns a `target_unreachable` error instead (see [errors](#errors)).
|
|
117
119
|
|
|
118
|
-
`credits` and `screenshot_slices` are the old names of `total_credit_cost` and `screenshot_slicing_credit_cost`. they are deprecated and will be removed in a future version. older api versions send only the old names and no `page_status_code`.
|
|
119
|
-
|
|
120
120
|
alongside `response_meta.usage`, the result surfaces any non-fatal `warnings` — stable string codes an agent can switch on. an outsized page is truncated rather than refused, and the code names which part was cut:
|
|
121
121
|
|
|
122
122
|
| code | what it means for the payload |
|
|
@@ -182,7 +182,7 @@ build (or fetch a cached) link-map for a website. combines sitemap discovery wit
|
|
|
182
182
|
|
|
183
183
|
returned urls are normalized the same way `scrape` normalizes its returned `url`, so map-then-scrape stays on one host. results are ordered with the most useful links first.
|
|
184
184
|
|
|
185
|
-
the response's `response_meta` carries `pagination`, `truncation`, and a `usage` block (`total_credit_cost` = `engine_credit_cost` × `proxy_multiplier`, billed `engine`, resolved `proxy` tier
|
|
185
|
+
the response's `response_meta` carries `pagination`, `truncation`, and a `usage` block (`total_credit_cost` = `engine_credit_cost` × `proxy_multiplier` + `zero_data_retention_credit_cost`, billed `engine`, resolved `proxy` tier). map has no screenshot slicing and no `page_status_code`, since it reads many files, not one page. a map that found nothing because the site answered only with statuses we don't bill (a `5xx`, for example), or not at all, is empty and free.
|
|
186
186
|
|
|
187
187
|
```jsonc
|
|
188
188
|
{
|
|
@@ -192,9 +192,12 @@ the response's `response_meta` carries `pagination`, `truncation`, and a `usage`
|
|
|
192
192
|
"max_urls": 5000,
|
|
193
193
|
"page": 1,
|
|
194
194
|
"limit": 1000,
|
|
195
|
+
"zero_data_retention": false,
|
|
195
196
|
}
|
|
196
197
|
```
|
|
197
198
|
|
|
199
|
+
`zero_data_retention` works as it does on `scrape` (see [zero data retention](https://crawlbrulee.com/docs/zero-data-retention)).
|
|
200
|
+
|
|
198
201
|
a map stopped by your own `max_urls` returns exactly that many links with `response_capped: false` — the signal that the site has more is `truncation.discovery_cap_reason`:
|
|
199
202
|
|
|
200
203
|
```jsonc
|
|
@@ -233,32 +236,33 @@ every tool returns an mcp error result (`isError: true`) when the api call fails
|
|
|
233
236
|
[<errorName>] <message> (HTTP <status>)
|
|
234
237
|
```
|
|
235
238
|
|
|
236
|
-
a few codes add a short next step after that, e.g. `target_unreachable`. branch on the `errorName` code, not on the rest of the text.
|
|
239
|
+
a few codes add a short next step after that, e.g. `target_unreachable` and `zero_data_retention_not_enabled`. branch on the `errorName` code, not on the rest of the text.
|
|
237
240
|
|
|
238
241
|
agents can branch on the `errorName` code. the set comes from the sdk's `ApiErrorName` union plus two synthetic codes added by this mcp (`missing_api_key`, `internal_error`):
|
|
239
242
|
|
|
240
|
-
| code
|
|
241
|
-
|
|
|
242
|
-
| `missing_api_key`
|
|
243
|
-
| `invalid_credentials`
|
|
244
|
-
| `service_unavailable`
|
|
245
|
-
| `too_many_requests`
|
|
246
|
-
| `usage_allocation_error`
|
|
247
|
-
| `validation_error`
|
|
248
|
-
| `invalid_url`
|
|
249
|
-
| `blocked_url`
|
|
250
|
-
| `antibot_blocked`
|
|
251
|
-
| `too_many_redirects`
|
|
252
|
-
| `page_too_large`
|
|
253
|
-
| `target_unreachable`
|
|
254
|
-
| `
|
|
255
|
-
| `
|
|
256
|
-
| `
|
|
257
|
-
| `
|
|
258
|
-
| `
|
|
259
|
-
| `
|
|
260
|
-
| `
|
|
261
|
-
| `
|
|
243
|
+
| code | meaning |
|
|
244
|
+
| --------------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
245
|
+
| `missing_api_key` | `CRAWLBRULEE_API_KEY` is not set in the mcp host's env. |
|
|
246
|
+
| `invalid_credentials` | server rejected the api key (revoked, wrong env, etc.). |
|
|
247
|
+
| `service_unavailable` | temporary backend failure (HTTP 503). your key is fine — retry with backoff. |
|
|
248
|
+
| `too_many_requests` | rate limit hit — back off and retry. |
|
|
249
|
+
| `usage_allocation_error` | plan credit / concurrency cap exceeded. show `usage` to user. |
|
|
250
|
+
| `validation_error` | input failed server validation. |
|
|
251
|
+
| `invalid_url` | target url was rejected before fetching. |
|
|
252
|
+
| `blocked_url` | target url is on the blocklist. |
|
|
253
|
+
| `antibot_blocked` | origin's anti-bot defenses blocked the fetch. |
|
|
254
|
+
| `too_many_redirects` | origin redirected the fetch in a loop (HTTP 422). the target's doing — don't retry blindly. |
|
|
255
|
+
| `page_too_large` | the page's html was too large to process (HTTP 422). terminal — never retry it. |
|
|
256
|
+
| `target_unreachable` | we could not reach the site at all (HTTP 502). not billed. retry later or check the url. |
|
|
257
|
+
| `zero_data_retention_not_enabled` | `zero_data_retention` is not enabled for your organization (HTTP 403). not billed. |
|
|
258
|
+
| `scrape_error` | the scrape could not be completed. a page the site served, even a 404, is never this error. |
|
|
259
|
+
| `unsupported_screenshot_output` | screenshot-only request on a content type that can't be screenshotted (HTTP 422). not billed. |
|
|
260
|
+
| `not_found` | async job ID unknown, or submitted more than 24 hours ago (`scrape_status` / `scrape_result`). |
|
|
261
|
+
| `request_timeout` | network / read timeout. safe to retry. |
|
|
262
|
+
| `client_closed_request` | caller cancelled before completion. |
|
|
263
|
+
| `internal_server_error` | unhandled server-side failure. |
|
|
264
|
+
| `crawlbrulee_error` | sdk error without a typed name. |
|
|
265
|
+
| `internal_error` | bug in this mcp — please open an issue. |
|
|
262
266
|
|
|
263
267
|
the api docs carry the canonical [error reference](https://crawlbrulee.com/docs/errors) — every error name, what causes it, and how to recover.
|
|
264
268
|
|
package/dist/index.js
CHANGED
|
@@ -73,7 +73,10 @@ function isMissingApiKeyError(err) {
|
|
|
73
73
|
* `target_unreachable` arrives as a plain `CrawlbruleeError` (the SDK has no class
|
|
74
74
|
* for it yet), so it is matched by name.
|
|
75
75
|
*/
|
|
76
|
-
const ERROR_HINTS = {
|
|
76
|
+
const ERROR_HINTS = {
|
|
77
|
+
zero_data_retention_not_enabled: "Zero data retention is not enabled for this organization. Send the request again without `zero_data_retention`, or ask us to turn it on (sales@crawlbrulee.com). Not billed.",
|
|
78
|
+
target_unreachable: "We could not reach the site: it did not answer, took too long, or its certificate was not valid. Retry later or check the URL. Not billed. This is not the same as a page that says \"not found\": a page the site served comes back as a result, with its status in page_status_code."
|
|
79
|
+
};
|
|
77
80
|
function crawlbruleeErrorResult(err) {
|
|
78
81
|
const code = err.errorName ?? "crawlbrulee_error";
|
|
79
82
|
const httpPart = err.status > 0 ? ` (HTTP ${err.status})` : "";
|
|
@@ -198,7 +201,8 @@ const Schema_ApiScrapeRequest = z.object({
|
|
|
198
201
|
require_js: z.boolean().default(false).describe("Use a headless browser to render JavaScript before scraping"),
|
|
199
202
|
cleanup: Schema_ApiScrapeCleanup.prefault({ ...DEFAULT_SCRAPE_CLEANUP }),
|
|
200
203
|
proxy: Schema_ApiProxyType.describe("Proxy tier to use for fetching"),
|
|
201
|
-
location: Schema_ApiScrapeLocation.optional()
|
|
204
|
+
location: Schema_ApiScrapeLocation.optional(),
|
|
205
|
+
zero_data_retention: z.boolean().optional().describe("Keeps the result out of the shared cache; anything stored to deliver it is kept for 24 hours, then deleted. Adds 1 credit. Must be enabled for your organization. See https://crawlbrulee.com/docs/zero-data-retention.")
|
|
202
206
|
}).strict();
|
|
203
207
|
|
|
204
208
|
//#endregion
|
|
@@ -230,7 +234,8 @@ const Schema_ApiMapRequest = z.object({
|
|
|
230
234
|
max_urls: z.number().int().positive().max(MAX_API_MAP_MAX_URLS).default(DEFAULT_API_MAP_MAX_URLS).describe("Maximum number of URLs to discover and store in the map. Default 5000, maximum 100000. Sitemap discovery stops as soon as this many URLs have been found, so a smaller value is a faster and lighter crawl, not just a smaller answer."),
|
|
231
235
|
page: z.number().int().positive().default(1).describe("Page number for paginated results"),
|
|
232
236
|
limit: z.number().int().positive().max(MAX_API_MAP_PAGE_LIMIT).default(DEFAULT_API_MAP_PAGE_LIMIT).describe("Number of URLs to return per page. Default 5000, maximum 10000."),
|
|
233
|
-
location: Schema_ApiMapLocation.optional()
|
|
237
|
+
location: Schema_ApiMapLocation.optional(),
|
|
238
|
+
zero_data_retention: z.boolean().optional().describe("Keeps the result out of the shared cache; anything stored to deliver it is kept for 24 hours, then deleted. Adds 1 credit. Must be enabled for your organization. See https://crawlbrulee.com/docs/zero-data-retention.")
|
|
234
239
|
});
|
|
235
240
|
|
|
236
241
|
//#endregion
|
|
@@ -262,12 +267,12 @@ const Schema_ApiScreenshotProperties = z.looseObject({
|
|
|
262
267
|
});
|
|
263
268
|
const Schema_ApiScreenshotSlice = z.looseObject({
|
|
264
269
|
row_nr: z.number().describe("Row index of this slice (0-based)"),
|
|
265
|
-
url: z.string().describe("
|
|
270
|
+
url: z.string().describe("Signed link to download this slice image. It expires 24 hours after the scrape (for an async scrape, 24 hours after you submitted it). Download the image, do not keep the link"),
|
|
266
271
|
type: z.literal("slice").describe("Slice type identifier"),
|
|
267
272
|
properties: Schema_ApiScreenshotProperties.describe("Image properties for this slice")
|
|
268
273
|
});
|
|
269
274
|
const Schema_ApiScreenshotResponse = z.looseObject({
|
|
270
|
-
url: z.string().describe("
|
|
275
|
+
url: z.string().describe("Signed link to download the full screenshot image. It expires 24 hours after the scrape (for an async scrape, 24 hours after you submitted it). Download the image, do not keep the link"),
|
|
271
276
|
type: openEnum(["viewport", "full_page"]).describe("Screenshot capture mode that was used"),
|
|
272
277
|
properties: Schema_ApiScreenshotProperties.describe("Image properties for the full screenshot"),
|
|
273
278
|
slices: z.array(Schema_ApiScreenshotSlice).optional().describe("Individual tile slices (present when slice action_after was requested)")
|
|
@@ -286,27 +291,20 @@ const Schema_CreditCost = z.number().int().nonnegative();
|
|
|
286
291
|
const Schema_ApiProxyMultiplier = z.number().int().positive();
|
|
287
292
|
const PROXY_MULTIPLIER_DESCRIPTION = "The multiplier of the proxy tier the request ran on: 1 for \"basic\", 5 for \"advanced\". Always reported, even when the engine cost is 0. Older api versions do not send it.";
|
|
288
293
|
const Schema_ApiUsageMeta = z.looseObject({
|
|
289
|
-
total_credit_cost: Schema_CreditCost.optional().describe("Credits charged for this request. Always equals engine_credit_cost × proxy_multiplier + screenshot_slicing_credit_cost. 0 when nothing is billed: a cache hit, or a page whose status is not billed (see page_status_code). Older api versions do not send it
|
|
294
|
+
total_credit_cost: Schema_CreditCost.optional().describe("Credits charged for this request. Always equals engine_credit_cost × proxy_multiplier + screenshot_slicing_credit_cost + zero_data_retention_credit_cost. 0 when nothing is billed: a cache hit, or a page whose status is not billed (see page_status_code). Older api versions do not send it."),
|
|
290
295
|
engine_credit_cost: Schema_CreditCost.optional().describe("The engine base charged, before the proxy multiplier: 1 for \"http\", 3 for \"browser\", 5 for \"screenshot\", 0 for \"cache\". Also 0 when the page is not billed (see page_status_code). Older api versions do not send it."),
|
|
291
296
|
proxy_multiplier: Schema_ApiProxyMultiplier.optional().describe(PROXY_MULTIPLIER_DESCRIPTION),
|
|
292
|
-
screenshot_slicing_credit_cost: Schema_CreditCost.optional().describe("The screenshot slicing add-on: 1 when the screenshot was split into slices on this request (a flat +1 credit outside the proxy multiplier, however many slices it made), else 0. A cache hit that reused slices that already existed costs 0. Older api versions do not send it
|
|
297
|
+
screenshot_slicing_credit_cost: Schema_CreditCost.optional().describe("The screenshot slicing add-on: 1 when the screenshot was split into slices on this request (a flat +1 credit outside the proxy multiplier, however many slices it made), else 0. A cache hit that reused slices that already existed costs 0. Older api versions do not send it."),
|
|
298
|
+
zero_data_retention_credit_cost: Schema_CreditCost.optional().describe("Credits added by zero data retention: 1 on a billed, fresh result, else 0. Older api versions do not send it."),
|
|
293
299
|
engine: openEnum([
|
|
294
300
|
"http",
|
|
295
301
|
"browser",
|
|
296
302
|
"screenshot",
|
|
297
303
|
"cache"
|
|
298
304
|
]).describe("The engine the request was billed at — \"http\", \"browser\", \"screenshot\", or \"cache\" (the result was served from cache). Reflects what was delivered, never what was requested."),
|
|
299
|
-
proxy: openEnum(API_RESOLVED_PROXY_TIER_VALUES$1).describe("The proxy tier the request actually ran on (resolved value — never `auto`; `auto` is resolved server-side to `basic` or `advanced`). \"advanced\" multiplies the engine base by 5.")
|
|
300
|
-
credits: Schema_CreditCost.meta({
|
|
301
|
-
description: "Deprecated: use total_credit_cost, which always has the same value. This field will be removed in a future version.",
|
|
302
|
-
deprecated: true
|
|
303
|
-
}).optional(),
|
|
304
|
-
screenshot_slices: Schema_CreditCost.meta({
|
|
305
|
-
description: "Deprecated: use screenshot_slicing_credit_cost, which always has the same value. Despite its name this is a 0/1 charge, not a count of slices. This field will be removed in a future version.",
|
|
306
|
-
deprecated: true
|
|
307
|
-
}).optional()
|
|
305
|
+
proxy: openEnum(API_RESOLVED_PROXY_TIER_VALUES$1).describe("The proxy tier the request actually ran on (resolved value — never `auto`; `auto` is resolved server-side to `basic` or `advanced`). \"advanced\" multiplies the engine base by 5.")
|
|
308
306
|
});
|
|
309
|
-
const Schema_ApiResponseMeta = z.looseObject({ usage: Schema_ApiUsageMeta.describe("What this request cost and why: total_credit_cost = engine_credit_cost × proxy_multiplier + screenshot_slicing_credit_cost, plus the billed engine and the resolved proxy tier.") });
|
|
307
|
+
const Schema_ApiResponseMeta = z.looseObject({ usage: Schema_ApiUsageMeta.describe("What this request cost and why: total_credit_cost = engine_credit_cost × proxy_multiplier + screenshot_slicing_credit_cost + zero_data_retention_credit_cost, plus the billed engine and the resolved proxy tier.") });
|
|
310
308
|
const Schema_ApiScrapeMeta = z.looseObject({
|
|
311
309
|
title: z.string().optional().describe("Page title from the <title> tag"),
|
|
312
310
|
description: z.string().optional().describe("Meta description"),
|
|
@@ -360,17 +358,14 @@ const DISCOVERY_CAP_REASONS = [
|
|
|
360
358
|
"file_size",
|
|
361
359
|
"unread_files"
|
|
362
360
|
];
|
|
363
|
-
/** Map usage has no screenshot-slice add-on. The new parts are optional: older api versions
|
|
361
|
+
/** Map usage has no screenshot-slice add-on. The new parts are optional: older api versions do not send them. */
|
|
364
362
|
const Schema_ApiMapUsageMeta = z.looseObject({
|
|
365
|
-
total_credit_cost: z.number().int().nonnegative().optional().describe("Credits charged for this map request. Always equals engine_credit_cost × proxy_multiplier. 0 for a cache hit, and for an empty map when the site answered only with statuses we do not bill (a 5xx, for example) or not at all. Older api versions do not send it
|
|
363
|
+
total_credit_cost: z.number().int().nonnegative().optional().describe("Credits charged for this map request. Always equals engine_credit_cost × proxy_multiplier + zero_data_retention_credit_cost. 0 for a cache hit, and for an empty map when the site answered only with statuses we do not bill (a 5xx, for example) or not at all. Older api versions do not send it."),
|
|
366
364
|
engine_credit_cost: z.number().int().nonnegative().optional().describe("The engine base charged, before the proxy multiplier: 1 for \"http\", 0 for \"cache\". Also 0 for an empty map that is not billed. Older api versions do not send it."),
|
|
367
365
|
proxy_multiplier: Schema_ApiProxyMultiplier.optional().describe(PROXY_MULTIPLIER_DESCRIPTION),
|
|
366
|
+
zero_data_retention_credit_cost: z.number().int().nonnegative().optional().describe("Credits added by zero data retention: 1 on a billed, fresh result, else 0. Older api versions do not send it."),
|
|
368
367
|
engine: openEnum(["http", "cache"]).describe("The map billing engine: `http` for fresh discovery or `cache` for a cached result"),
|
|
369
|
-
proxy: openEnum(API_RESOLVED_PROXY_TIER_VALUES).describe("The proxy tier the request actually ran on (resolved value — never `auto`)")
|
|
370
|
-
credits: z.number().int().nonnegative().meta({
|
|
371
|
-
description: "Deprecated: use total_credit_cost, which always has the same value. This field will be removed in a future version.",
|
|
372
|
-
deprecated: true
|
|
373
|
-
}).optional()
|
|
368
|
+
proxy: openEnum(API_RESOLVED_PROXY_TIER_VALUES).describe("The proxy tier the request actually ran on (resolved value — never `auto`)")
|
|
374
369
|
});
|
|
375
370
|
const Schema_ApiMapLinkItem = z.looseObject({ url: z.string().describe("The discovered URL") });
|
|
376
371
|
const Schema_ApiMapPagination = z.looseObject({
|
|
@@ -394,7 +389,7 @@ const Schema_ApiMapResult = z.looseObject({
|
|
|
394
389
|
response_meta: z.looseObject({
|
|
395
390
|
pagination: Schema_ApiMapPagination.describe("Pagination details for the result set"),
|
|
396
391
|
truncation: Schema_ApiMapTruncation.describe("Information about whether the results were truncated"),
|
|
397
|
-
usage: Schema_ApiMapUsageMeta.describe("What this map request cost: total_credit_cost = engine_credit_cost × proxy_multiplier, plus the billed engine and the resolved proxy tier.")
|
|
392
|
+
usage: Schema_ApiMapUsageMeta.describe("What this map request cost: total_credit_cost = engine_credit_cost × proxy_multiplier + zero_data_retention_credit_cost, plus the billed engine and the resolved proxy tier.")
|
|
398
393
|
}).describe("Response metadata including pagination, truncation, and usage info")
|
|
399
394
|
});
|
|
400
395
|
|
|
@@ -415,11 +410,11 @@ const DESCRIPTION$6 = [
|
|
|
415
410
|
"retry will not help. `discovery_capped` says discovery stopped early, `sitemaps_skipped` how",
|
|
416
411
|
"many sitemap files were skipped or only partly read.",
|
|
417
412
|
"`limit` (default 5000, max 10000) only pages the answer.",
|
|
413
|
+
"Set `zero_data_retention: true` to keep the result out of the shared cache; anything stored to deliver it is kept for 24 hours, then deleted. It adds 1 credit and must be enabled for the organization (else a `zero_data_retention_not_enabled` error, not billed). See https://crawlbrulee.com/docs/zero-data-retention.",
|
|
418
414
|
"Returned URLs are normalized the same way `scrape` normalizes its returned `url`, so",
|
|
419
415
|
"map-then-scrape stays on one host. Results are ordered with the most useful links first.",
|
|
420
416
|
"The response carries `response_meta.usage`: `total_credit_cost` = `engine_credit_cost` ×",
|
|
421
|
-
"`proxy_multiplier`, plus `engine` and `proxy` (the resolved tier, never `auto`)
|
|
422
|
-
"old, deprecated name of `total_credit_cost`. Map has no screenshot slicing and no",
|
|
417
|
+
"`proxy_multiplier` + `zero_data_retention_credit_cost`, plus `engine` and `proxy` (the resolved tier, never `auto`). Map has no screenshot slicing and no",
|
|
423
418
|
"`page_status_code`: it reads many files, not one page. A map that found nothing because the site",
|
|
424
419
|
"answered only with statuses we don't bill (a 5xx, for example), or not at all, is empty and free. If the site cannot be reached, the",
|
|
425
420
|
"tool can return a `target_unreachable` error (HTTP 502, not billed): retry later or check the URL."
|
|
@@ -446,12 +441,13 @@ const DESCRIPTION$5 = [
|
|
|
446
441
|
"407, 408, 429 and 451; 5xx pages are never billed.",
|
|
447
442
|
"If the site cannot be reached at all the tool returns a `target_unreachable` error (HTTP 502,",
|
|
448
443
|
"not billed): retry later or check the URL.",
|
|
449
|
-
"Screenshot URLs in the response are signed download links
|
|
444
|
+
"Screenshot URLs in the response are signed download links that expire 24 hours after the scrape:",
|
|
445
|
+
"download the image if you need it later; do not keep the link.",
|
|
450
446
|
"The response also carries `response_meta.usage`: `total_credit_cost` = `engine_credit_cost` ×",
|
|
451
|
-
"`proxy_multiplier` + `screenshot_slicing_credit_cost`, plus `engine` and `proxy` (the resolved",
|
|
447
|
+
"`proxy_multiplier` + `screenshot_slicing_credit_cost` + `zero_data_retention_credit_cost`, plus `engine` and `proxy` (the resolved",
|
|
452
448
|
"tier — never `auto`). `engine` is the billed engine (`http`, `browser`, `screenshot`, `cache`); a",
|
|
453
|
-
"cache hit is represented by `engine: \"cache\"`.
|
|
454
|
-
"
|
|
449
|
+
"cache hit is represented by `engine: \"cache\"`.",
|
|
450
|
+
"Set `zero_data_retention: true` to keep the result out of the shared cache; anything stored to deliver it is kept for 24 hours, then deleted. It adds 1 credit and must be enabled for the organization (else a `zero_data_retention_not_enabled` error, not billed). See https://crawlbrulee.com/docs/zero-data-retention.",
|
|
455
451
|
"Extraction is capped per page: 30,000 links, 10,000 inline images and 10,000,000 characters of",
|
|
456
452
|
"HTML. A page past a cap is truncated rather than refused, and the response `warnings` array names",
|
|
457
453
|
"which one (`links_truncated`, `inline_images_truncated`, `raw_html_truncated`) — so treat that",
|
|
@@ -511,7 +507,8 @@ const DESCRIPTION$4 = [
|
|
|
511
507
|
"Optionally attach a per-job completion `webhook`: we deliver a single",
|
|
512
508
|
"signed `scrape.complete` POST to your endpoint when the job finishes (HTTPS required",
|
|
513
509
|
"in production), and echoes your opaque `webhook.metadata` back in the delivery",
|
|
514
|
-
"(under `data.metadata`, alongside `data.page_status_code` (on success) and `data.response_meta.usage`)."
|
|
510
|
+
"(under `data.metadata`, alongside `data.page_status_code` (on success) and `data.response_meta.usage`).",
|
|
511
|
+
"Set `zero_data_retention: true` to keep the result out of the shared cache; anything stored to deliver it is kept for 24 hours, then deleted. It adds 1 credit and must be enabled for the organization (else a `zero_data_retention_not_enabled` error, not billed). See https://crawlbrulee.com/docs/zero-data-retention."
|
|
515
512
|
].join(" ");
|
|
516
513
|
function registerScrapeAsyncTool(server, getClient) {
|
|
517
514
|
server.registerTool("scrape_async", {
|
|
@@ -534,7 +531,9 @@ const DESCRIPTION$3 = [
|
|
|
534
531
|
"404 or 503 page comes back with its content, not as an error. A 404 means the markdown is the",
|
|
535
532
|
"site's \"not found\" page, not the page you asked for. 2xx and 4xx pages are billed, except 403,",
|
|
536
533
|
"407, 408, 429 and 451; 5xx pages are never billed.",
|
|
537
|
-
"Screenshot URLs are
|
|
534
|
+
"A job answers for 24 hours after it was submitted, then returns `not_found`. Screenshot URLs are",
|
|
535
|
+
"signed download links that expire at the same moment, however late you fetch the result: download",
|
|
536
|
+
"the image if you need it later."
|
|
538
537
|
].join(" ");
|
|
539
538
|
function registerScrapeResultTool(server, getClient) {
|
|
540
539
|
server.registerTool("scrape_result", {
|
|
@@ -557,7 +556,8 @@ const DESCRIPTION$2 = [
|
|
|
557
556
|
"billed; retry later or check the url. Poll this until the status is",
|
|
558
557
|
"`done`, then call `scrape_result` to fetch",
|
|
559
558
|
"the page. If you registered a completion webhook on submit you can skip polling and react",
|
|
560
|
-
"to the delivery instead."
|
|
559
|
+
"to the delivery instead. A job answers for 24 hours after it was submitted; after that this",
|
|
560
|
+
"returns `not_found`, the same as for an unknown job id."
|
|
561
561
|
].join(" ");
|
|
562
562
|
function registerScrapeStatusTool(server, getClient) {
|
|
563
563
|
server.registerTool("scrape_status", {
|
|
@@ -622,7 +622,7 @@ function registerWhoamiTool(server, getClient) {
|
|
|
622
622
|
//#endregion
|
|
623
623
|
//#region src/version.ts
|
|
624
624
|
const SERVER_NAME = "crawlbrulee";
|
|
625
|
-
const SERVER_VERSION = "1.1
|
|
625
|
+
const SERVER_VERSION = "1.2.1";
|
|
626
626
|
|
|
627
627
|
//#endregion
|
|
628
628
|
//#region src/server.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlbrulee/mcp",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"mcpName": "io.github.crawlbrulee/mcp",
|
|
5
5
|
"description": "official mcp server for crawlbrulee — EU-native web scraping for AI agents & developers. native scrape and map tools for your agent.",
|
|
6
6
|
"keywords": [
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"prepublishOnly": "pnpm verify"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@crawlbrulee/sdk": "^1.1
|
|
66
|
+
"@crawlbrulee/sdk": "^1.2.1",
|
|
67
67
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
68
68
|
"zod": "^4.0.0"
|
|
69
69
|
},
|