Skip to main content
Glama

get_current_url

Retrieve the current URL of a specified browser tab in Firefox using the Firefox MCP Server. Ideal for automation and multi-tab debugging workflows with Playwright integration.

Instructions

Get current page URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabIdNo

Implementation Reference

  • The core handler function for the 'get_current_url' tool. It ensures the browser is running, gets the page for the specified or active tab, retrieves the current URL using page.url(), and returns it formatted in MCP response.
    async getCurrentUrl(args = {}) {
      this.ensureBrowserRunning();
      const { tabId } = args;
      const page = this.getPage(tabId);
      const url = page.url();
      
      return {
        content: [{
          type: 'text',
          text: `Current URL in tab '${tabId || this.activeTabId}': ${url}`
        }]
      };
    }
  • The tool schema definition in the listTools response, specifying name, description, and input schema (optional tabId string).
    {
      name: 'get_current_url',
      description: 'Get current page URL',
      inputSchema: {
        type: 'object',
        properties: { tabId: { type: 'string' } }
      }
    },
  • Registration in the CallToolRequestSchema handler switch statement, dispatching calls to the getCurrentUrl method.
    case 'get_current_url':
      return await this.getCurrentUrl(args);
  • Helper method used by getCurrentUrl to retrieve the Playwright Page object for the given tabId or the active tab.
    getPage(tabId) {
      if (tabId) {
        if (!this.pages.has(tabId)) {
          throw new Error(`Tab '${tabId}' not found`);
        }
        return this.pages.get(tabId);
      } else {
        if (!this.activeTabId || !this.pages.has(this.activeTabId)) {
          throw new Error('No active tab. Use create_tab or set_active_tab first.');
        }
        return this.pages.get(this.activeTabId);
      }
    }
  • Helper method called by getCurrentUrl to ensure the browser instance is launched before accessing pages.
    ensureBrowserRunning() {
      if (!this.browser) {
        throw new Error('Firefox browser is not running. Please launch it first using the launch_firefox_multi tool.');
      }
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states what the tool does, not how it behaves. It doesn't disclose whether this requires specific permissions, if it returns just the URL string or structured data, error conditions, or dependencies like an open browser tab.

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 extremely concise with just four words, front-loading the core purpose without any wasted text. Every word earns its place, making it easy to parse quickly.

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

Completeness2/5

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

Given no annotations, 0% schema coverage, no output schema, and one undocumented parameter, the description is incomplete. It doesn't address key contextual aspects like return format, error handling, or how it interacts with browser state, leaving significant gaps for agent understanding.

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

Parameters2/5

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

Schema description coverage is 0%, and the description provides no information about the 'tabId' parameter. It doesn't explain what 'tabId' is, how to obtain it, or if it's optional (0 required parameters). The description fails to compensate for the lack of schema documentation.

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 verb 'Get' and the resource 'current page URL', making the purpose immediately understandable. It doesn't distinguish from siblings like 'navigate' or 'get_page_content', but the purpose is specific enough for a basic retrieval operation.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_page_content' (which might include URL) or 'navigate' (which sets URLs). The description lacks any context about prerequisites, such as needing an active browser session or tab.

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

Related 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/JediLuke/firefox-mcp-server'

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