Skip to main content
Glama

get_url

Retrieve the current URL from a browser controlled through Chrome DevTools Protocol for automation workflows and navigation tracking.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.js:85-88 (handler)
    Inline handler function for the 'get_url' tool. It retrieves the current browser page URL using Playwright's page.url() method and returns it as text content.
    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 empty 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 if not already running and provides access to page object 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 }; }
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/Myestery/browser-cdp-mcp'

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