Skip to main content
Glama

open_URL_with_authorization

Open Moodle-protected URLs in a browser by handling authentication automatically, allowing access to course materials and resources without manual login.

Instructions

Open a URL in a new authorized browser window after Moodle login (show to user).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesTarget URL to open after Moodle login

Implementation Reference

  • main.py:161-182 (handler)
    The primary handler function for the 'open_URL_with_authorization' tool. It instantiates MUSTerClientWithHead, calls openUrl on the input URL, retrieves the current URL and page title from the Selenium driver, and returns a structured success response or error dictionary.
    def tool_open_URL_with_authorization(url: str) -> Dict[str, Any]: try: muster_client_with_head = MUSTerClientWithHead() driver = muster_client_with_head.openUrl(url) if driver: current_url = driver.current_url page_title = driver.title return { "success": True, "message": "URL opened successfully with Moodle authorization", "opened_url": url, "current_url": current_url, "page_title": page_title, "note": "A new browser window is now open and logged in. It will remain open until manually closed.", } else: return {"error": "Failed to open URL - driver not initialized"} except Exception as e: return {"error": f"Failed to open URL with authorization: {str(e)}"}
  • main.py:68-81 (registration)
    Tool registration within the list_muster_tools() function, returned by the @server.list_tools() handler. Defines the tool name, description, and JSON input schema for MCP protocol compliance.
    Tool( name="open_URL_with_authorization", description="Open a URL in a new authorized browser window after Moodle login (show to user).", inputSchema={ "type": "object", "properties": { "url": { "type": "string", "description": "Target URL to open after Moodle login", } }, "required": ["url"], }, ),
  • main.py:215-216 (registration)
    Dispatch routing in the @server.call_tool() handler that matches the tool name and invokes the corresponding tool handler function with parsed arguments.
    if name == "open_URL_with_authorization": return _wrap_json(tool_open_URL_with_authorization(args["url"]))
  • Supporting utility method in the MUSTerClientWithHead class. Ensures the user is logged into Moodle via Selenium WebDriver (headed browser), navigates to the provided URL, and returns the driver instance for further inspection.
    def openUrl(self, url: str): if not self.logged_in: if not self.login(): raise Exception("Failed to login to Moodle") self.driver.get(url) return self.driver

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/Cosmostima/MUSTer_MCP'

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