fetchWebContent
Retrieve and clean web pages, docs, or PDFs by removing ads while preserving code and tables. Use outline, section IDs, BM25 focus, batching, and paging for long or token-heavy content.
Instructions
Fetch readable web content/docs/PDFs. Auto-cleans ads, keeps code/tables. Supports outline mode & sectionId for long docs, BM25 focus, batch URLs (1-3), and startIndex paging.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "fetchWebContent"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | (Deprecated: use format='raw') Return raw response body without extraction | |
| url | No | Public HTTP(S) URL or array of 1-3 URLs to fetch. Array fetches concurrently and splits maxChars budget | |
| mode | No | Extraction mode: 'full' (default) returns content body; 'outline' returns H1-H4 heading tree with section slug IDs and char estimates — use on long docs to avoid burning tokens | |
| urls | No | (Optional alias for url array) Batch URLs (1~3 URLs run concurrently) | |
| cache | No | Cache mode: 'default' uses disk Markdown cache; 'reload' forces re-fetching upstream | |
| focus | No | Keyword or topic to target. Uses BM25 semantic scoring to rank and extract relevant paragraphs, saving tokens on long pages | |
| format | No | Content format: 'markdown' (default, keeps headings, code blocks, tables), 'text' (compact plain text), or 'raw' (unprocessed HTML/source) | |
| extract | No | Extract structured JSON via CSS selectors without LLM | |
| maxChars | No | Max characters to return (default 30000). Use with startIndex for paging | |
| selector | No | CSS selector to narrow extraction to a specific DOM subtree | |
| citations | No | Rewrite inline links as numbered citations and append a '## References' list | |
| focusMode | No | Focus scoring algorithm (default 'bm25'; 'window' keeps ±2500 char slice around first match) | |
| sectionId | No | Directly extract a specific section by heading slug ID or title (from outline mode). Reads until next same-level heading | |
| startIndex | No | Character offset to start reading from. Use nextStartIndex from a previous response to page through long content | |
| readability | No | Force readability parser (default: auto-detected based on content) | |
| retainLinks | No | Inline link style: 'all' (default), 'text' (strip URLs, saves tokens on index pages), 'none' | |
| includeLinks | No | Include extracted links array in metadata |