Skip to main content
Glama
BrowserGenie

BrowserGenie MCP Server

by BrowserGenie

assert_tabs_match

Verify two tabs match by comparing URL, title, and DOM hash to ensure cross-tab state synchronization.

Instructions

Verify two tabs have the same state (URL, title, DOM hash). Useful for cross-tab state sync testing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabIdAYesFirst tab ID
tabIdBYesSecond tab ID
apiKeyNoAPI key for authentication if enabled

Implementation Reference

  • Handler function for the 'assert_tabs_match' tool. It accepts tabIdA and tabIdB (plus optional apiKey), sends the 'assert_tabs_match' command via WebSocket bridge, and returns the result (comparison of URL, title, and DOM hash) or an error.
    server.tool(
      'assert_tabs_match',
      'Verify two tabs have the same state (URL, title, DOM hash). Useful for cross-tab state sync testing.',
      {
        tabIdA: z.number().describe('First tab ID'),
        tabIdB: z.number().describe('Second tab ID'),
        apiKey: z.string().optional().describe('API key for authentication if enabled'),
      },
      async ({ tabIdA, tabIdB, apiKey }) => {
        const result = await bridge.sendCommand({
          command: 'assert_tabs_match',
          params: { tabIdA, tabIdB },
          apiKey,
        });
        if (!result.success) {
          return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true };
        }
        return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
      }
    );
  • Zod schema defining the input parameters for assert_tabs_match: tabIdA (required number), tabIdB (required number), and optional apiKey string.
    {
      tabIdA: z.number().describe('First tab ID'),
      tabIdB: z.number().describe('Second tab ID'),
      apiKey: z.string().optional().describe('API key for authentication if enabled'),
    },
  • Registration of the 'assert_tabs_match' tool on the McpServer via server.tool(), within the registerTabManagementTools function which is called from registerAllTools in index.ts.
    server.tool(
      'assert_tabs_match',
      'Verify two tabs have the same state (URL, title, DOM hash). Useful for cross-tab state sync testing.',
      {
        tabIdA: z.number().describe('First tab ID'),
        tabIdB: z.number().describe('Second tab ID'),
        apiKey: z.string().optional().describe('API key for authentication if enabled'),
      },
      async ({ tabIdA, tabIdB, apiKey }) => {
        const result = await bridge.sendCommand({
          command: 'assert_tabs_match',
          params: { tabIdA, tabIdB },
          apiKey,
        });
        if (!result.success) {
          return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true };
        }
        return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
      }
    );
Behavior2/5

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

With no annotations provided, the description must fully disclose behavioral traits, but it fails to mention side effects, failure behavior (e.g., thrown exception or return value), or prerequisites like tab existence. It only states the verification action, leaving significant gaps.

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: one sentence with two clear clauses. It is front-loaded with the primary action and immediately provides context. No wasted words, every part earns its place.

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

Completeness4/5

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

For a simple assertion tool with only two required parameters and no output schema, the description covers the essential information: what it compares and when to use it. However, it lacks details on failure behavior and edge cases, so it is slightly incomplete.

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 input schema already fully covers all three parameters with descriptions (100% coverage). The description adds value by explaining the meaning of 'state' (URL, title, DOM hash), which is not present in the schema, enriching the parameter semantics context.

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

Purpose5/5

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

The description clearly states the tool's purpose: verifying two tabs have the same state by comparing URL, title, and DOM hash. It also provides a use case (cross-tab state sync testing), distinguishing it from sibling assertion tools like assert_element or assert_css_property.

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

Usage Guidelines4/5

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

The description explicitly mentions 'cross-tab state sync testing' as the intended use case, giving clear context for when to apply the tool. However, it does not explicitly state when not to use it or list alternatives, though the context is sufficient for an experienced user.

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/BrowserGenie/mcp'

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