smart_fetch
Fetches URLs and auto-optimizes content: HTML to clean markdown, JSON to schema/sample, cutting LLM token usage.
Instructions
Fetch any URL and auto-optimize based on content type.
For HTML: converts to clean markdown, stripping navigation, ads, and scripts. For JSON: returns a schema + sample by default for large arrays. Use the jsonpath parameter to drill into specific items or fields on follow-up calls. Dramatically reduces token usage compared to raw fetching.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ttl | No | Cache TTL in seconds (default 1800) | |
| url | Yes | URL to fetch | |
| headers | No | Optional HTTP headers (e.g. {'Authorization': 'Bearer token'}) | |
| jsonpath | No | JSONPath expression to drill into JSON data (e.g. '$[0:5]', '$[*].name', '$[?@.id==42]') | |
| max_chars | No | Maximum characters in output | |
| max_depth | No | Max nesting depth for JSON before flattening (default 5) | |
| use_cache | No | Return cached response if available (default True) | |
| extract_metadata | No | Include YAML frontmatter with page metadata (HTML only) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |