Conversation
The `web_fetch` tool previously fetched pages as HTML and converted to
markdown. Many documentation platforms (Mintlify, GitBook, Fumadocs)
publish a clean markdown twin at `{path}.md`, which is cheaper to
process and produces better output than HTML-to-markdown conversion.
The tool now supports three strategies, controlled via `tool.options`:
- `auto` (default): probe `{url}.md` first; fall back to HTML
- `markdown`: require the `.md` variant; error if unavailable
- `html`: skip the probe and fetch HTML directly (previous behavior)
Per-domain overrides are supported via `options.domains`, e.g.:
```toml
options.domains."github.com" = "html"
options.domains."*.mintlify.app" = "markdown"
```
Defaults ship with `github.com`, `docs.rs`, and `crates.io` pinned to
`html` since those sites don't follow the `.md` convention.
The implementation splits the monolithic `fetch.rs` into three
sub-modules: `html` (old pipeline), `markdown` (new pipeline), and
`options` (strategy/domain rule parsing). Section listing and extraction
now work for both HTML and markdown sources, using GitHub-style heading
slugs as anchor IDs in both cases.
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
web_fetchtool previously fetched pages as HTML and converted to markdown. Many documentation platforms (Mintlify, GitBook, Fumadocs) publish a clean markdown twin at{path}.md, which is cheaper to process and produces better output than HTML-to-markdown conversion.The tool now supports three strategies, controlled via
tool.options:auto(default): probe{url}.mdfirst; fall back to HTMLmarkdown: require the.mdvariant; error if unavailablehtml: skip the probe and fetch HTML directly (previous behavior)Per-domain overrides are supported via
options.domains, e.g.:Defaults ship with
github.com,docs.rs, andcrates.iopinned tohtmlsince those sites don't follow the.mdconvention.The implementation splits the monolithic
fetch.rsinto three sub-modules:html(old pipeline),markdown(new pipeline), andoptions(strategy/domain rule parsing). Section listing and extraction now work for both HTML and markdown sources, using GitHub-style heading slugs as anchor IDs in both cases.