discover_links
Extract all links from a webpage, optionally filtering by regex pattern, to build a targeted URL list for batch fetching.
Instructions
Discover all links on a webpage. Use this BEFORE fetch_batch to find relevant URLs.
USE THIS TOOL WHEN:
Exploring a documentation site to find relevant pages
Building a list of URLs to fetch in batch
Finding all subpages under a section (e.g., all /api/ docs)
Checking what content exists before deciding what to read
RECOMMENDED WORKFLOW:
discover_links(url="https://docs.example.com/", filter_pattern="/guide/")
Review the returned links and select relevant ones
fetch_batch(urls=[selected_urls], max_length_per_url=1500)
FILTER EXAMPLES:
filter_pattern="/docs/" → Only links containing '/docs/'
filter_pattern="getting-started|quickstart" → Links with either term
filter_pattern=".md$" → Only markdown file links
NOTES:
Returns up to 100 links (more are noted but omitted to save context)
Relative URLs are automatically resolved to absolute URLs
JavaScript/mailto/anchor links are excluded
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The webpage URL to scan for links (e.g., a docs index or sitemap) | |
| filter_pattern | No | Regex to filter links. Examples: '/docs/', '\.pdf$', 'api|guide'. Leave empty for all links. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |