crawlforge-mcp-server 4.7.2 → 4.8.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/CLAUDE.md +2 -2
- package/package.json +2 -1
- package/server.js +42 -9
- package/src/cli/commands/init.js +13 -2
- package/src/cli/commands/install-skills.js +10 -1
- package/src/cli/commands/monitor.js +81 -0
- package/src/cli/commands/uninstall-skills.js +10 -1
- package/src/core/ActionExecutor.js +51 -9
- package/src/core/ElicitationHelper.js +18 -5
- package/src/core/LLMsTxtAnalyzer.js +2 -1
- package/src/core/MonitorScheduler.js +281 -0
- package/src/core/MonitorStore.js +79 -0
- package/src/core/ResearchOrchestrator.js +2 -1
- package/src/core/crawlers/BFSCrawler.js +2 -1
- package/src/skills/agent-skills/crawlforge-batch-automation/SKILL.md +126 -0
- package/src/skills/agent-skills/crawlforge-batch-automation/references/actions.md +127 -0
- package/src/skills/agent-skills/crawlforge-change-tracking/SKILL.md +116 -0
- package/src/skills/agent-skills/crawlforge-deep-research/SKILL.md +108 -0
- package/src/skills/agent-skills/crawlforge-deep-research/references/workflows.md +76 -0
- package/src/skills/agent-skills/crawlforge-getting-started/SKILL.md +89 -0
- package/src/skills/agent-skills/crawlforge-getting-started/references/cli.md +71 -0
- package/src/skills/agent-skills/crawlforge-getting-started/references/credits.md +75 -0
- package/src/skills/agent-skills/crawlforge-stealth-browsing/SKILL.md +106 -0
- package/src/skills/agent-skills/crawlforge-stealth-browsing/references/engine-selection.md +63 -0
- package/src/skills/agent-skills/crawlforge-structured-extraction/SKILL.md +121 -0
- package/src/skills/agent-skills/crawlforge-structured-extraction/references/templates.md +39 -0
- package/src/skills/agent-skills/crawlforge-web-scraping/SKILL.md +141 -0
- package/src/skills/agent-skills/crawlforge-web-scraping/references/tool-reference.md +95 -0
- package/src/skills/installer.js +186 -34
- package/src/tools/advanced/batchScrape/worker.js +8 -2
- package/src/tools/basic/_fetch.js +14 -1
- package/src/tools/crawl/_sessionContext.js +3 -1
- package/src/tools/extract/_fetchAndParse.js +2 -1
- package/src/tools/extract/extractContent.js +2 -1
- package/src/tools/extract/processDocument.js +2 -1
- package/src/tools/scrape/_brandingExtractor.js +378 -0
- package/src/tools/scrape/unifiedScrape.js +66 -6
- package/src/tools/templates/ScrapeTemplateTool.js +2 -1
- package/src/tools/tracking/trackChanges/differ.js +3 -1
- package/src/tools/tracking/trackChanges/index.js +74 -21
- package/src/tools/tracking/trackChanges/schema.js +7 -2
- package/src/utils/hostRateLimiter.js +46 -0
- package/src/utils/robotsChecker.js +2 -1
- package/src/utils/sitemapParser.js +2 -1
- package/src/utils/ssrfGuard.js +161 -0
- package/src/utils/ssrfProtection.js +6 -9
- package/src/skills/crawlforge-cli.md +0 -157
- package/src/skills/crawlforge-mcp.md +0 -80
- package/src/skills/crawlforge-research.md +0 -104
- package/src/skills/crawlforge-stealth.md +0 -98
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Stealth Engine Selection
|
|
2
|
+
|
|
3
|
+
`stealth_mode` supports two browser engines via the `engine` parameter.
|
|
4
|
+
|
|
5
|
+
## playwright (default)
|
|
6
|
+
|
|
7
|
+
- Chromium-based with stealth patches applied.
|
|
8
|
+
- Masks `webdriver`, User-Agent, and navigator properties.
|
|
9
|
+
- Lower resource usage, faster startup.
|
|
10
|
+
- Good for most sites with basic bot detection.
|
|
11
|
+
|
|
12
|
+
## camoufox
|
|
13
|
+
|
|
14
|
+
- Firefox-based with **native** anti-detection (no runtime patches — uses
|
|
15
|
+
Firefox's genuine properties).
|
|
16
|
+
- Scores higher on CreepJS and against DataDome than patched Chromium.
|
|
17
|
+
- Heavier; install with `npm install camoufox`.
|
|
18
|
+
- Use for advanced fingerprinting: financial, trading, and e-commerce sites.
|
|
19
|
+
|
|
20
|
+
## Decision table
|
|
21
|
+
|
|
22
|
+
| Scenario | Recommended engine |
|
|
23
|
+
|----------|--------------------|
|
|
24
|
+
| General JS-rendered sites | playwright |
|
|
25
|
+
| Basic bot-detection bypass | playwright |
|
|
26
|
+
| Speed-critical scraping | playwright |
|
|
27
|
+
| Cloudflare-protected sites | camoufox |
|
|
28
|
+
| Sites with DataDome | camoufox |
|
|
29
|
+
| Sites with PerimeterX | camoufox |
|
|
30
|
+
| Financial / trading sites | camoufox |
|
|
31
|
+
|
|
32
|
+
## stealthConfig levels
|
|
33
|
+
|
|
34
|
+
| Level | Behavior |
|
|
35
|
+
|-------|----------|
|
|
36
|
+
| `basic` | Minimal fingerprint masking; lowest overhead. |
|
|
37
|
+
| `medium` (default) | Balanced fingerprint randomization + header spoofing. |
|
|
38
|
+
| `advanced` | Full anti-detection: human-behavior simulation, canvas/WebGL/audio/font/hardware spoofing, WebRTC blocking, timezone spoofing. |
|
|
39
|
+
|
|
40
|
+
## Key stealthConfig fields
|
|
41
|
+
|
|
42
|
+
- `randomizeFingerprint`, `hideWebDriver`, `blockWebRTC`, `spoofTimezone`,
|
|
43
|
+
`randomizeHeaders`, `useRandomUserAgent`, `simulateHumanBehavior`.
|
|
44
|
+
- `customUserAgent`, `customViewport {width,height}`, `locale`, `timezone`.
|
|
45
|
+
- `proxyRotation { enabled, proxies[], rotationInterval }`.
|
|
46
|
+
- `antiDetection { cloudflareBypass, recaptchaHandling, hideAutomation,
|
|
47
|
+
spoofMediaDevices, spoofBatteryAPI }`.
|
|
48
|
+
- `fingerprinting { canvasNoise, webglSpoofing, audioContextSpoofing,
|
|
49
|
+
fontSpoofing, hardwareSpoofing }`.
|
|
50
|
+
|
|
51
|
+
## Global override
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
export CRAWLFORGE_STEALTH_ENGINE=camoufox
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Forces the engine for all stealth calls regardless of the `engine` parameter.
|
|
58
|
+
|
|
59
|
+
## Sandboxing note
|
|
60
|
+
|
|
61
|
+
Stealth Chromium runs with `--no-sandbox` + `--disable-web-security` (a
|
|
62
|
+
deliberate fingerprint-spoofing trade-off). Camoufox (Firefox) is the
|
|
63
|
+
alternative when that trade-off is unacceptable.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: crawlforge-structured-extraction
|
|
3
|
+
description: "Extracts structured JSON and analyzes content with CrawlForge's extract_structured, extract_with_llm, scrape_structured, scrape_template, process_document, analyze_content, summarize_content, and list_ollama_models tools. Use when the user wants to extract specific fields, pull data into a JSON schema, extract by natural-language prompt, scrape with CSS selectors, get product, profile, or repo data from known sites (Amazon, LinkedIn, GitHub, YouTube, Reddit, and more), parse a PDF or DOCX, summarize a page, or analyze sentiment, entities, or keywords. Defaults to local Ollama for LLM extraction; OpenAI and Anthropic optional."
|
|
4
|
+
metadata:
|
|
5
|
+
version: 4.8.0
|
|
6
|
+
source: crawlforge-mcp-server
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# CrawlForge Structured Extraction & Analysis
|
|
10
|
+
|
|
11
|
+
Turn pages and documents into structured data, and run NLP analysis. Pick the
|
|
12
|
+
extraction method by how predictable the page is and whether an LLM is needed.
|
|
13
|
+
|
|
14
|
+
## Tool selection
|
|
15
|
+
|
|
16
|
+
| You have / want | Tool | Cost |
|
|
17
|
+
|-----------------|------|------|
|
|
18
|
+
| A well-known site (Amazon, GitHub, LinkedIn...) | `scrape_template` | 1 |
|
|
19
|
+
| Exact CSS selectors for the fields | `scrape_structured` | 2 |
|
|
20
|
+
| A JSON schema to fill (LLM, CSS fallback) | `extract_structured` | 3 |
|
|
21
|
+
| A natural-language extraction instruction | `extract_with_llm` | 3 |
|
|
22
|
+
| A PDF / DOCX / TXT to parse | `process_document` | 2 |
|
|
23
|
+
| A summary of long text | `summarize_content` | 4 |
|
|
24
|
+
| Sentiment / entities / keywords / readability | `analyze_content` | 3 |
|
|
25
|
+
| To list local LLMs available for extraction | `list_ollama_models` | 1 |
|
|
26
|
+
|
|
27
|
+
Cheapest-first rule: try `scrape_template` → `scrape_structured` (deterministic)
|
|
28
|
+
before reaching for the LLM tools.
|
|
29
|
+
|
|
30
|
+
## scrape_template — known sites, zero selectors (cost: 1)
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{ "tool": "scrape_template", "params": { "template": "github-repo", "url": "https://github.com/user/repo" } }
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Pass `template:"list"` to enumerate templates. Supports `amazon-product`,
|
|
37
|
+
`linkedin-profile`, `github-repo`, `youtube-video`, `tweet`, `reddit-thread`,
|
|
38
|
+
`hacker-news-front-page`, `producthunt-launch`, `stackoverflow-question`,
|
|
39
|
+
`npm-package`. Full field lists: [templates](references/templates.md).
|
|
40
|
+
CLI: `crawlforge template github-repo https://github.com/owner/repo`.
|
|
41
|
+
|
|
42
|
+
## scrape_structured — CSS selectors (cost: 2)
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"tool": "scrape_structured",
|
|
47
|
+
"params": { "url": "https://shop.com/products", "selectors": { "price": ".price", "name": ".product-title", "link": "a.product@href" } }
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Most reliable for consistent markup. Append `@attr` to a selector to read an
|
|
52
|
+
attribute (e.g. `a.link@href`, `img@src`). `max_results` caps matches per field.
|
|
53
|
+
|
|
54
|
+
## extract_structured — schema-driven (cost: 3)
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"tool": "extract_structured",
|
|
59
|
+
"params": {
|
|
60
|
+
"url": "https://jobs.example.com/post/123",
|
|
61
|
+
"schema": { "properties": { "title": { "type": "string" }, "salary": { "type": "string" } }, "required": ["title"] }
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Uses an LLM by default and falls back to CSS selectors when no LLM is
|
|
67
|
+
configured (`fallbackToSelectors:true`). Provide `selectorHints` to guide the
|
|
68
|
+
fallback. A schema with >3 required fields and no LLM configured triggers a
|
|
69
|
+
confirmation prompt. CLI: `crawlforge extract <url> --schema schema.json`.
|
|
70
|
+
|
|
71
|
+
## extract_with_llm — natural-language prompt (cost: 3)
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"tool": "extract_with_llm",
|
|
76
|
+
"params": { "url": "https://example.com/article", "prompt": "extract title, author, date, and a one-line summary", "provider": "ollama" }
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Defaults to a **local Ollama** model (`http://localhost:11434`, no API key).
|
|
81
|
+
Run `list_ollama_models` first to see installed models, then pass one via
|
|
82
|
+
`model` (e.g. `"llama3.2"`). Use `provider:"openai"` or `"anthropic"` with the
|
|
83
|
+
matching key for a cloud model. CLI: `crawlforge extract <url> --prompt "..." --model llama3.2`.
|
|
84
|
+
|
|
85
|
+
## process_document — PDF / DOCX / TXT (cost: 2)
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{ "tool": "process_document", "params": { "source": "https://example.com/report.pdf", "sourceType": "pdf_url" } }
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`sourceType`: `url`, `pdf_url`, `file`, `pdf_file`. Returns structured sections,
|
|
92
|
+
metadata, and word count. `options` passes through `maxPages`,
|
|
93
|
+
`pageRange:{start,end}`, `password`, `outputFormat`, etc.
|
|
94
|
+
|
|
95
|
+
## summarize_content & analyze_content
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{ "tool": "summarize_content", "params": { "text": "..long article..", "options": { "summaryLength": "short", "summaryType": "abstractive" } } }
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{ "tool": "analyze_content", "params": { "text": "..article text..", "options": { "extractTopics": true, "includeSentiment": true } } }
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`summarize_content` (cost 4) does extractive or abstractive summaries.
|
|
106
|
+
`analyze_content` (cost 3) returns language, sentiment, entities, topics,
|
|
107
|
+
keyword density, and readability. Both take raw `text` — feed them output from
|
|
108
|
+
`extract_content` / `extract_text`.
|
|
109
|
+
|
|
110
|
+
## LLM fallback chain
|
|
111
|
+
|
|
112
|
+
For LLM-backed extraction (extract_structured, extract_with_llm, abstractive
|
|
113
|
+
summarize): **Ollama (local, default) → OpenAI key → Anthropic key → MCP
|
|
114
|
+
Sampling**. No cloud key is required; local Ollama is the zero-cost default.
|
|
115
|
+
|
|
116
|
+
## Cost note
|
|
117
|
+
|
|
118
|
+
`scrape_template` & `list_ollama_models` = 1 · `scrape_structured`,
|
|
119
|
+
`process_document` = 2 · `extract_structured`, `extract_with_llm`,
|
|
120
|
+
`analyze_content` = 3 · `summarize_content` = 4. Cloud LLM usage is billed
|
|
121
|
+
separately by your provider, on top of credits.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# scrape_template — Site Templates
|
|
2
|
+
|
|
3
|
+
Pre-built extractors for well-known sites. Call
|
|
4
|
+
`scrape_template({ template: "list" })` (or CLI `crawlforge template --list`)
|
|
5
|
+
to enumerate at runtime. Cost: 1 credit per call.
|
|
6
|
+
|
|
7
|
+
| Template ID | Target | Typical fields returned |
|
|
8
|
+
|-------------|--------|-------------------------|
|
|
9
|
+
| `amazon-product` | Amazon product page (`/dp/...`) | title, price, rating, review count, availability, images, features |
|
|
10
|
+
| `linkedin-profile` | LinkedIn public profile | name, headline, location, current role, about, experience |
|
|
11
|
+
| `github-repo` | GitHub repository | name, owner, description, stars, forks, language, topics, README excerpt |
|
|
12
|
+
| `youtube-video` | YouTube watch page | title, channel, views, likes, published date, description |
|
|
13
|
+
| `tweet` | A single tweet/X post | author, handle, text, timestamp, likes, reposts |
|
|
14
|
+
| `reddit-thread` | Reddit thread | title, subreddit, author, score, top comments |
|
|
15
|
+
| `hacker-news-front-page` | HN front page | ranked stories: title, URL, points, author, comment count |
|
|
16
|
+
| `producthunt-launch` | Product Hunt launch | name, tagline, upvotes, maker, description |
|
|
17
|
+
| `stackoverflow-question` | Stack Overflow question | title, tags, votes, question body, accepted answer |
|
|
18
|
+
| `npm-package` | npm package page | name, version, description, weekly downloads, license, repo link |
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{ "tool": "scrape_template", "params": { "template": "amazon-product", "url": "https://amazon.com/dp/B0XXXXX" } }
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Parameters:
|
|
27
|
+
|
|
28
|
+
| Param | Type | Default | Notes |
|
|
29
|
+
|-------|------|---------|-------|
|
|
30
|
+
| `template` | string | — | A template ID above, or `list`. |
|
|
31
|
+
| `url` | string (URL) | — | Required unless `template` is `list`. |
|
|
32
|
+
| `timeout` | number | `15000` | 5000–60000 ms. |
|
|
33
|
+
|
|
34
|
+
## When a template does not exist for the site
|
|
35
|
+
|
|
36
|
+
Fall back, cheapest first:
|
|
37
|
+
1. `scrape_structured` with your own CSS selectors (cost 2).
|
|
38
|
+
2. `extract_structured` with a JSON schema (cost 3, LLM with CSS fallback).
|
|
39
|
+
3. `extract_with_llm` with a natural-language prompt (cost 3).
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: crawlforge-web-scraping
|
|
3
|
+
description: "Scrapes web pages and returns clean Markdown, HTML, plain text, links, or metadata using CrawlForge's scrape, fetch_url, extract_content, extract_text, extract_links, extract_metadata, map_site, and crawl_deep tools. Use when the user wants to scrape a URL, fetch a page, get the markdown or text of a website, extract links or metadata, read an article, map a site's URLs, generate a sitemap, or crawl a whole website or documentation site. Prefer the unified scrape tool to get multiple formats in one call; use map_site to discover URLs and crawl_deep to walk an entire site."
|
|
4
|
+
metadata:
|
|
5
|
+
version: 4.8.0
|
|
6
|
+
source: crawlforge-mcp-server
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# CrawlForge Web Scraping
|
|
10
|
+
|
|
11
|
+
Fetch and clean web content with the CrawlForge MCP server. This skill covers
|
|
12
|
+
single-page scraping (one URL → Markdown / HTML / text / links / metadata),
|
|
13
|
+
site discovery (sitemaps and URL maps), and whole-site crawling.
|
|
14
|
+
|
|
15
|
+
## When to use
|
|
16
|
+
|
|
17
|
+
- "Scrape this URL" / "get the markdown of this page" / "read this article" → `scrape`
|
|
18
|
+
- "Just give me the raw HTML / JSON / headers" → `fetch_url`
|
|
19
|
+
- "Give me the clean article text, no nav or ads" → `extract_content`
|
|
20
|
+
- "Get the plain text / markdown body" → `extract_text`
|
|
21
|
+
- "List every link on this page" → `extract_links`
|
|
22
|
+
- "Get the title / meta / Open Graph / SEO tags" → `extract_metadata`
|
|
23
|
+
- "Map all the URLs on this site" / "generate a sitemap" → `map_site`
|
|
24
|
+
- "Crawl the whole docs site" / "index every page" → `crawl_deep`
|
|
25
|
+
|
|
26
|
+
## Tool selection (fastest path first)
|
|
27
|
+
|
|
28
|
+
1. **`scrape`** is the default for single pages. One fetch returns many formats
|
|
29
|
+
at once — no N-request fan-out. Ask for exactly the formats you need.
|
|
30
|
+
2. Use the **single-purpose basic tools** (`fetch_url`, `extract_text`,
|
|
31
|
+
`extract_links`, `extract_metadata`) when you only want one cheap thing.
|
|
32
|
+
3. **`extract_content`** when you specifically want Readability-cleaned article
|
|
33
|
+
body (strips ads, nav, footers) — better than `extract_text` for articles.
|
|
34
|
+
4. **`map_site`** before a crawl to estimate scope / find section URLs.
|
|
35
|
+
5. **`crawl_deep`** to walk an entire site and (optionally) extract content.
|
|
36
|
+
|
|
37
|
+
If a page returns 403/429, a CAPTCHA, or empty "enable JavaScript" content,
|
|
38
|
+
switch to the **crawlforge-stealth-browsing** skill (`stealth_mode`).
|
|
39
|
+
|
|
40
|
+
## scrape — unified multi-format (cost: 2)
|
|
41
|
+
|
|
42
|
+
Get markdown + links + metadata in a single call:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"tool": "scrape",
|
|
47
|
+
"params": {
|
|
48
|
+
"url": "https://example.com/article",
|
|
49
|
+
"formats": ["markdown", "links", "metadata"],
|
|
50
|
+
"onlyMainContent": true
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`formats` accepts: `"markdown"`, `"html"`, `"rawHtml"`, `"text"`, `"links"`,
|
|
56
|
+
`"metadata"`, `"screenshot"`, or an object `{ "type": "json", "schema": {...},
|
|
57
|
+
"prompt": "..." }` for LLM-structured extraction. Partial success is supported:
|
|
58
|
+
a failing format adds a `warnings[]` entry instead of failing the whole call.
|
|
59
|
+
`onlyMainContent` (default `true`) strips boilerplate via Readability.
|
|
60
|
+
|
|
61
|
+
CLI equivalent:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
crawlforge scrape https://example.com/article --extract --format markdown
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## fetch_url — raw HTTP (cost: 1)
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{ "tool": "fetch_url", "params": { "url": "https://example.com", "timeout": 15000 } }
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Returns headers + body. Good for JSON/XML APIs or as a first step before
|
|
74
|
+
`extract_text` / `extract_content`. Supports `headers` (e.g. auth tokens).
|
|
75
|
+
|
|
76
|
+
## extract_content vs extract_text
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{ "tool": "extract_content", "params": { "url": "https://blog.example.com/post" } }
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{ "tool": "extract_text", "params": { "url": "https://example.com/article", "output_format": "markdown" } }
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`extract_content` (cost 2) = Readability-cleaned article body, best for RAG.
|
|
87
|
+
`extract_text` (cost 1) = faster, strips tags; pass `output_format:"markdown"`
|
|
88
|
+
for RAG-friendly output.
|
|
89
|
+
|
|
90
|
+
## extract_links / extract_metadata (cost: 1 each)
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{ "tool": "extract_links", "params": { "url": "https://example.com", "filter_external": true } }
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{ "tool": "extract_metadata", "params": { "url": "https://example.com" } }
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## map_site — discover URLs (cost: 2)
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"tool": "map_site",
|
|
105
|
+
"params": { "url": "https://example.com", "include_sitemap": true, "max_urls": 500 }
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Reads `sitemap.xml` when available. Pass `search:"pricing"` to rank discovered
|
|
110
|
+
URLs by relevance and get a `ranked_urls:[{url,score}]` array (default output
|
|
111
|
+
is unchanged when `search` is omitted).
|
|
112
|
+
|
|
113
|
+
CLI: `crawlforge map https://example.com --pretty` (add `--format xml` for a sitemap file).
|
|
114
|
+
|
|
115
|
+
## crawl_deep — walk a whole site (cost: 4, scales with pages)
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"tool": "crawl_deep",
|
|
120
|
+
"params": {
|
|
121
|
+
"url": "https://docs.example.com",
|
|
122
|
+
"max_depth": 3,
|
|
123
|
+
"max_pages": 200,
|
|
124
|
+
"extract_content": true
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
BFS crawl up to depth 5 / 1000 pages. Use `include_patterns` /
|
|
130
|
+
`exclude_patterns` (regex) to scope, `respect_robots` to honor robots.txt
|
|
131
|
+
(on by default). Crawls projected over ~500 pages trigger a confirmation
|
|
132
|
+
prompt (elicitation). CLI: `crawlforge crawl https://docs.example.com --depth 3 --max-pages 200`.
|
|
133
|
+
|
|
134
|
+
## Cost note
|
|
135
|
+
|
|
136
|
+
Cheapest first: `fetch_url`, `extract_text`, `extract_links`,
|
|
137
|
+
`extract_metadata` = 1 credit · `scrape`, `extract_content`, `map_site` =
|
|
138
|
+
2 · `crawl_deep` = 4 (grows with `max_pages`). Prefer one `scrape` call over
|
|
139
|
+
several single-format calls when you need multiple formats.
|
|
140
|
+
|
|
141
|
+
See [tool reference](references/tool-reference.md) for the full parameter list.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Web Scraping & Crawl Tools — Parameter Reference
|
|
2
|
+
|
|
3
|
+
Authoritative parameters for the scraping/discovery/crawl tools. Costs are in
|
|
4
|
+
CrawlForge credits.
|
|
5
|
+
|
|
6
|
+
## scrape (cost: 2)
|
|
7
|
+
|
|
8
|
+
| Param | Type | Default | Notes |
|
|
9
|
+
|-------|------|---------|-------|
|
|
10
|
+
| `url` | string (URL) | — | Required. |
|
|
11
|
+
| `formats` | array | `["markdown"]` | Any of `markdown`, `html`, `rawHtml`, `text`, `links`, `metadata`, `screenshot`, or `{type:"json", schema?, prompt?}`. |
|
|
12
|
+
| `onlyMainContent` | boolean | `true` | Strip boilerplate via Readability. |
|
|
13
|
+
| `timeoutMs` | number | `15000` | 1000–60000. |
|
|
14
|
+
|
|
15
|
+
Partial success: a format that fails produces a `warnings[]` entry rather than
|
|
16
|
+
failing the whole call. `{type:"json"}` may incur external LLM cost (billed by
|
|
17
|
+
your provider).
|
|
18
|
+
|
|
19
|
+
## fetch_url (cost: 1)
|
|
20
|
+
|
|
21
|
+
| Param | Type | Default | Notes |
|
|
22
|
+
|-------|------|---------|-------|
|
|
23
|
+
| `url` | string (URL) | — | Required. |
|
|
24
|
+
| `headers` | object | — | Custom HTTP headers (e.g. auth tokens). |
|
|
25
|
+
| `timeout` | number | `10000` | 1000–30000 ms. |
|
|
26
|
+
|
|
27
|
+
## extract_text (cost: 1)
|
|
28
|
+
|
|
29
|
+
| Param | Type | Default | Notes |
|
|
30
|
+
|-------|------|---------|-------|
|
|
31
|
+
| `url` | string (URL) | — | Required. |
|
|
32
|
+
| `remove_scripts` | boolean | `true` | Strip `script` tags. |
|
|
33
|
+
| `remove_styles` | boolean | `true` | Strip `style` tags. |
|
|
34
|
+
| `output_format` | enum | `text` | `text` or `markdown` (use markdown for RAG). |
|
|
35
|
+
|
|
36
|
+
## extract_links (cost: 1)
|
|
37
|
+
|
|
38
|
+
| Param | Type | Default | Notes |
|
|
39
|
+
|-------|------|---------|-------|
|
|
40
|
+
| `url` | string (URL) | — | Required. |
|
|
41
|
+
| `filter_external` | boolean | `false` | Only return outbound links. |
|
|
42
|
+
| `base_url` | string (URL) | — | Resolve relative links against this. |
|
|
43
|
+
|
|
44
|
+
## extract_metadata (cost: 1)
|
|
45
|
+
|
|
46
|
+
| Param | Type | Notes |
|
|
47
|
+
|-------|------|-------|
|
|
48
|
+
| `url` | string (URL) | Required. Returns title, description, OG tags, canonical, schema.org. |
|
|
49
|
+
|
|
50
|
+
## extract_content (cost: 2)
|
|
51
|
+
|
|
52
|
+
| Param | Type | Notes |
|
|
53
|
+
|-------|------|-------|
|
|
54
|
+
| `url` | string (URL) | Required. Readability-cleaned article body (markdown). |
|
|
55
|
+
| `options` | object | Additional extraction options. |
|
|
56
|
+
|
|
57
|
+
## map_site (cost: 2)
|
|
58
|
+
|
|
59
|
+
| Param | Type | Default | Notes |
|
|
60
|
+
|-------|------|---------|-------|
|
|
61
|
+
| `url` | string (URL) | — | Required. |
|
|
62
|
+
| `include_sitemap` | boolean | — | Include `sitemap.xml` data. |
|
|
63
|
+
| `max_urls` | number | — | 1–10000. |
|
|
64
|
+
| `group_by_path` | boolean | — | Group URLs by path segment. |
|
|
65
|
+
| `include_metadata` | boolean | — | Per-URL metadata. |
|
|
66
|
+
| `domain_filter` | object | — | `whitelist`, `blacklist`, `include_patterns`, `exclude_patterns`. |
|
|
67
|
+
| `search` | string | — | Rank URLs by relevance; emits `ranked_urls:[{url,score}]`. |
|
|
68
|
+
|
|
69
|
+
## crawl_deep (cost: 4, scales with max_pages)
|
|
70
|
+
|
|
71
|
+
| Param | Type | Default | Notes |
|
|
72
|
+
|-------|------|---------|-------|
|
|
73
|
+
| `url` | string (URL) | — | Required start URL. |
|
|
74
|
+
| `max_depth` | number | — | 1–5. |
|
|
75
|
+
| `max_pages` | number | — | 1–1000. |
|
|
76
|
+
| `include_patterns` | string[] | — | Regex URL allow-list. |
|
|
77
|
+
| `exclude_patterns` | string[] | — | Regex URL deny-list. |
|
|
78
|
+
| `follow_external` | boolean | — | Follow off-domain links. |
|
|
79
|
+
| `respect_robots` | boolean | `true`* | Honor robots.txt. |
|
|
80
|
+
| `extract_content` | boolean | — | Extract page content during crawl. |
|
|
81
|
+
| `content_max_length` | number | `500` | Max chars per page; sets a `truncated` flag. |
|
|
82
|
+
| `concurrency` | number | — | 1–20 concurrent requests. |
|
|
83
|
+
| `enable_link_analysis` | boolean | — | Compute PageRank over crawled pages. |
|
|
84
|
+
| `session` | object | — | Shared cookie jar for login-then-crawl. |
|
|
85
|
+
|
|
86
|
+
*Server default honors `RESPECT_ROBOTS_TXT`. Crawls projected over ~500 pages
|
|
87
|
+
trigger an elicitation confirmation.
|
|
88
|
+
|
|
89
|
+
## CLI quick map
|
|
90
|
+
|
|
91
|
+
| Tool | CLI |
|
|
92
|
+
|------|-----|
|
|
93
|
+
| `scrape` / `fetch_url` | `crawlforge scrape <url> [--extract --format markdown]` |
|
|
94
|
+
| `map_site` | `crawlforge map <url> [--format xml]` |
|
|
95
|
+
| `crawl_deep` | `crawlforge crawl <url> --depth 3 --max-pages 200` |
|