fetch_url_text
Extract visible text content from web pages by providing a URL. This tool downloads readable text for analysis or processing in 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:12-12 (registration)Registers the fetch_url_text tool using the @mcp.tool() decorator from FastMCP.@mcp.tool()
- url_text_fetcher/mcp_server.py:13-18 (handler)The handler function that executes the tool: fetches the URL with requests, parses HTML with BeautifulSoup, and returns the 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:13-14 (schema)Function signature and docstring define the input schema (url: str) and output (str), used by MCP for tool schema.def fetch_url_text(url: str) -> str: """Download all visible text from a URL."""