| name | fetch-urls |
| description | Fetch a URL as markdown, extract a single anchor section from a web page, or list all page anchors with hierarchy. Supports pagination for large pages. Use when you need to read a URL, fetch a specific section of a page, or discover what sections a page has. |
| allowed_tools | ["Bash"] |
Fetch URLs
Fetch web content via a Python script. Three modes: full page, single anchor section, or anchor discovery.
Commands
Full page as markdown:
uv run "$SKILLS_DIR/scripts/fetch_anchor.py" "<url>"
Single anchor section (URL must contain #fragment):
uv run "$SKILLS_DIR/scripts/fetch_anchor.py" "<url>#<anchor>" --only-current-anchor
List all anchors (shows heading hierarchy):
uv run "$SKILLS_DIR/scripts/fetch_anchor.py" "<url>" --list-anchors
Pagination (for large pages or sections):
uv run "$SKILLS_DIR/scripts/fetch_anchor.py" "<url>" --max-length 5000 --start-index 5000
Raw HTML (combine with any mode above):
uv run "$SKILLS_DIR/scripts/fetch_anchor.py" "<url>" --raw
Flags
| Flag | Description |
|---|
--only-current-anchor | Return only the section matching the URL's #fragment |
--raw | Output raw HTML instead of markdown |
--max-length N | Limit output to N characters (enables pagination) |
--start-index N | Start at character N (use with --max-length for next page) |
--list-anchors | List all anchors, grouped by heading hierarchy |
Workflow
- Full page: pass the URL. HTML is simplified via readability, then converted to markdown. Non-HTML (JSON, plain text) is returned as-is.
- Anchor mode: if the user provides a URL with
#fragment, pass it with --only-current-anchor. The fragment is extracted from the URL automatically. Captures the full section including all sub-headings at lower levels.
- Discovery: if the user asks for a section but the anchor ID is unknown, use
--list-anchors first. Output shows heading hierarchy with indentation and levels (h1-h6) so you can pick the right anchor.
- Pagination: for large content, use
--max-length. The script appends a truncation notice with the next --start-index value.
Requirements
Requires uv on the system. The script uses PEP 723 inline metadata — uv run resolves and caches dependencies automatically (no venv needed).