Skip to main content
Glama

browser_get_url

Retrieve the current webpage URL during browser automation to track navigation progress or verify page location.

Instructions

Get the current page URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers and implements the 'browser_get_url' tool. Retrieves the current browser session driver from the StateManager, calls getCurrentUrl() on it, and formats the result as an MCP tool response with error handling.
    server.tool('browser_get_url', 'Get the current page URL', {}, async () => {
      try {
        const driver = stateManager.getDriver();
        const url = await driver.getCurrentUrl();
        return {
          content: [{ type: 'text', text: `Current page URL is: ${url}` }],
        };
      } catch (e) {
        return {
          content: [
            {
              type: 'text',
              text: `Error getting page URL: ${(e as Error).message}`,
            },
          ],
        };
      }
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states what the tool does but lacks behavioral details: it doesn't mention whether this requires an active browser session, if it returns a string or object, potential errors (e.g., no page loaded), or performance characteristics. For a tool with zero annotation coverage, this is insufficient disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately scannable and efficient. Every word earns its place in conveying the essential purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema), the description is adequate but incomplete. It lacks context about return format, error conditions, or dependencies on browser state. For a read-only tool with no annotations, more behavioral context would be helpful, though the low complexity mitigates some gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description doesn't need to explain parameters, and it correctly implies none are required by focusing solely on the action. No additional parameter semantics are needed or provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('current page URL'), making the purpose immediately understandable. It distinguishes from siblings by focusing on URL retrieval rather than navigation or other browser interactions. However, it doesn't explicitly differentiate from similar tools like 'browser_title' or 'browser_get_cookies' beyond the specific resource mentioned.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., requires an open browser session), nor does it suggest when other tools might be more appropriate (e.g., 'browser_title' for page title instead of URL). The context is implied but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/pshivapr/selenium-mcp'

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