open_urls
Open multiple URLs at once in your default browser to streamline web navigation.
Instructions
Open a list of URLs in the default browser.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| urls | Yes |
Implementation Reference
- src/server.py:20-38 (handler)The open_urls tool handler function that accepts a list of URLs, validates them, opens each in the default browser using webbrowser.open(), and returns a dict of results.
def open_urls(urls: list[str]) -> dict[str, str]: """ Open a list of URLs in the default browser. """ results = {} for url in urls: parsed_url = urlparse(url) if not parsed_url.scheme: parsed_url = urlparse(f"https://{url}") if not parsed_url.netloc: results[url] = "Error: Invalid URL. Please provide a valid URL." continue processed_url = urlunparse(parsed_url) try: webbrowser.open(processed_url) results[url] = "URL opened successfully." except Exception as e: results[url] = f"Error opening URL: {e}" return results - src/server.py:19-19 (registration)The tool is registered with FastMCP via the @mcp.tool() decorator with readOnlyHint=True annotation, indicating the tool is read-only.
@mcp.tool(annotations=ToolAnnotations(readOnlyHint=True))