Skip to main content
Glama

get_url

Retrieves the current page URL during browser automation sessions to enable navigation tracking, link verification, and web scraping workflows.

Instructions

Get the current page URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execute function (handler) for the 'get_url' tool. It calls the browser's getUrl method and returns the URL in a standardized success response format.
    handler: async () => { const url = await browser.getUrl(); return { success: true, data: { url }, message: `Current URL: ${url}` }; }
  • The input schema for the 'get_url' tool, which takes no parameters.
    inputSchema: { type: 'object', properties: {}, required: [] },
  • Registration of the 'get_url' tool as an object in the array returned by createPlaywrightTools(browser), making it available for MCP.
    { name: 'get_url', description: 'Get the current page URL', inputSchema: { type: 'object', properties: {}, required: [] }, handler: async () => { const url = await browser.getUrl(); return { success: true, data: { url }, message: `Current URL: ${url}` }; } },
  • Supporting helper method getUrl on the SimpleBrowser class used by the tool handler to retrieve the current page URL via Playwright API.
    async getUrl() { await this.ensureLaunched(); return this.page.url(); }

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/zypin-testing/zypin-mcp'

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