fetch_url_text
Extract and download all visible text content from any webpage using a URL. Designed for web scraping and integration with LM Studio.
Instructions
Download all visible text from a URL.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
Implementation Reference
- url_text_fetcher/mcp_server.py:13-18 (handler)The handler function that implements the 'fetch_url_text' tool. It downloads the webpage using requests, parses it with BeautifulSoup, and extracts all visible text.def fetch_url_text(url: str) -> str: """Download all visible text from a URL.""" resp = requests.get(url, timeout=10) resp.raise_for_status() soup = BeautifulSoup(resp.text, "html.parser") return soup.get_text(separator="\n", strip=True)
- url_text_fetcher/mcp_server.py:12-12 (registration)The @mcp.tool() decorator registers the fetch_url_text function as an MCP tool.@mcp.tool()