fetch-text
Retrieve and extract the text of a URL. Auto-detects the format (HTML / PDF / Markdown / plain text).
Behavior
- Research PDF (parsed into sections): the first call returns the
title, the abstract, and a section index — every section name with
its size — rather than the body text. Call again with the same
urlplussectionto read one section. A long paper runs to tens of thousands of words; the index lets you read the two sections that answer the question instead of flooding the conversation with the rest. - Other PDFs: page-by-page text extraction, truncated at 8000 chars.
- HTML: structured text with links and image references preserved.
- Markdown / plain: returned as-is.
- Page candidate images (Open Graph, Twitter cards, in-page
<img>tags) are surfaced as part of the result so a downstreamdisplaycan pick a primary image without re-fetching.
Reading a paper
{"tool": "fetch-text", "url": "<pdf url>"}→ title, abstract, section index.- Pick the sections that bear on the question — not all of them.
{"tool": "fetch-text", "url": "<same url>", "section": "Results"}→ that section.
Asking for a section that isn't in the index returns an error listing the names that are, so re-read the index rather than guessing. Section names match case-insensitively, and an unambiguous prefix works.
For a paper's reference list, use semantic-scholar with a
paper_id — the citation graph gives resolved records, which beats
parsing a bibliography out of the PDF.
When to use vs search-web
fetch-text— you already have a specific URL and want its content.search-web— you're looking for information and don't yet have the URL.
Examples
{"thought": "see what's in this paper", "tool": "fetch-text", "url": "https://arxiv.org/pdf/1706.03762"}
{"thought": "the index listed a Results section — read it", "tool": "fetch-text", "url": "https://arxiv.org/pdf/1706.03762", "section": "Results"}
{"thought": "load today's weather forecast page", "tool": "fetch-text", "url": "https://forecast.weather.gov/MapClick.php?lat=37.87&lon=-122.27"}
Notes
- Section support needs a reachable GROBID server.
GROBID_URLoverrides the defaulthttp://localhost:8070/api/processFulltextDocument; set it to an empty string to disable. With GROBID unavailable, PDFs fall back to flat page text and thesectionarg has nothing to resolve against.