fetch_markdown
Extract markdown content from web pages using Jina reader API. Convert HTML to structured markdown for documentation or analysis purposes.
Instructions
Return markdown content of a web page via Jina reader.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
Implementation Reference
- main.py:10-21 (handler)Core handler logic for the fetch_markdown tool: fetches the markdown content from a given URL using the Jina reader API, handling URL normalization.def fetch_markdown_impl(url: str) -> str: """Fetch a web page using Jina reader and return its markdown text. The Jina reader endpoint is `https://r.jina.ai/{original_url}`. The `url` argument may be a full URL (including scheme) or a hostname/path. """ if not url.startswith("http://") and not url.startswith("https://"): url = "https://" + url target = "https://r.jina.ai/" + url resp = requests.get(target, timeout=15) resp.raise_for_status() return resp.text
- main.py:25-27 (registration)Registration of the 'fetch_markdown' tool using the @mcp.tool decorator, including schema (url: str -> str) and docstring. Thin wrapper delegating to the impl.def fetch_markdown(url: str) -> str: """Return markdown content of a web page via Jina reader.""" return fetch_markdown_impl(url)