Skip to main content
Glama

get_url

Retrieve the current URL from a browser session controlled by the Chrome DevTools Protocol for automation workflows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.js:85-88 (handler)
    Handler function for 'get_url' tool: retrieves the current page URL using Playwright's page.url() after ensuring the browser is launched.
    server.tool("get_url", {}, async () => { const { page } = await ensureBrowser(); return { content: [{ type: "text", text: page.url() }] }; });
  • server.js:85-88 (registration)
    Registration of the 'get_url' tool using server.tool with no input schema and inline handler.
    server.tool("get_url", {}, async () => { const { page } = await ensureBrowser(); return { content: [{ type: "text", text: page.url() }] }; });
  • Helper function ensureBrowser() that launches Chromium browser and initializes page and CDP session if not already done. Used by get_url handler.
    async function ensureBrowser() { if (!browser) { browser = await chromium.launch({ headless: false, args: ["--disable-web-security", "--allow-running-insecure-content"], }); page = await browser.newPage(); cdp = await page.context().newCDPSession(page); } return { browser, page, cdp }; }

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/Myestery/browser-cdp-mcp'

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