doc_fetch
Download a technical document into the project's documentation library and index it with source, date, size and hash. Handles redirects, PDF viewers and scripted download portals via headless browser.
Instructions
Download a technical document into the project's documentation library (research/references by default) and index it with its source URL, date, size and hash. A plain fetch with browser-grade headers comes first; it follows redirects and a single PDF link on a viewer page. When a site answers with a scripted download portal or refuses the plain client, headless Chromium loads the page and takes the download it offers. If that fails too (login walls, bot checks), the error says so: open the URL in a browser, save the file, and use doc_import. Find URLs with web search first; manufacturer sites and distributor mirrors usually both work.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Direct URL of the document, usually a PDF datasheet, application note or reference-design archive. | |
| tags | No | Keywords for later lookup, e.g. ['poe', 'silvertel', 'ag5405']. | |
| notes | No | ||
| title | No | Human title, e.g. 'Silvertel Ag5400 PoE module datasheet'. | |
| expect | No | ||
| subdir | No | Folder inside the documentation library, e.g. datasheets, reference-designs, standards. | datasheets |
| browser | No | auto: try a plain fetch, then headless Chromium when the site answers with a page or refuses; always: start in the browser; never: plain fetch only. | auto |
| filename | No | File name to store under; default derived from the URL. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Stable id: first 12 hex digits of the file's SHA-256. | |
| file | Yes | Path relative to the documentation library. | |
| path | Yes | Path relative to the workspace. | |
| size | Yes | ||
| tags | No | ||
| notes | No | ||
| pages | No | ||
| title | Yes | ||
| sha256 | Yes | ||
| fetched | Yes | Date the file entered the library (YYYY-MM-DD). | |
| source_url | No | ||
| content_type | Yes |