Skip to main content
Glama
alexandru2882

URL Text Fetcher MCP Server

fetch_page_links

Extract all links from a web page by providing its URL. This tool helps identify and collect hyperlinks for web scraping and content analysis.

Instructions

Return a list of all links on the page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes

Implementation Reference

  • The main handler function for the 'fetch_page_links' tool. It is decorated with @mcp.tool() for registration, fetches the webpage content using requests, parses it with BeautifulSoup, and extracts all href attributes from anchor tags returning them as a list of strings.
    @mcp.tool() def fetch_page_links(url: str) -> List[str]: """Return a list of all links on the page.""" resp = requests.get(url, timeout=10) resp.raise_for_status() soup = BeautifulSoup(resp.text, "html.parser") return [a['href'] for a in soup.find_all('a', href=True)]
  • The @mcp.tool() decorator registers the fetch_page_links function as an MCP tool.
    @mcp.tool()
  • The function signature defines the input schema (url: str) and output schema (List[str]), along with the docstring describing the tool's purpose.
    def fetch_page_links(url: str) -> List[str]: """Return a list of all links on the page."""
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alexandru2882/url-text-fetcher-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server