Skip to main content
Glama
BrowserGenie

BrowserGenie MCP Server

by BrowserGenie

start_recording_macro

Record user clicks, typing, and navigation in a browser tab to create a macro for automation.

Instructions

Start recording user actions (clicks, typing, navigation) in a tab. Inject the macro recorder content script.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabIdNoTarget tab ID (defaults to currently active tab)
apiKeyNoAPI key for authentication if enabled

Implementation Reference

  • The `start_recording_macro` tool is registered on the MCP server via `server.tool()`. It accepts optional `tabId` and `apiKey` parameters, sends a 'start_recording_macro' command over the WebSocket bridge, and returns the result as JSON text.
    server.tool(
      'start_recording_macro',
      'Start recording user actions (clicks, typing, navigation) in a tab. Inject the macro recorder content script.',
      {
        tabId: z.number().optional().describe('Target tab ID (defaults to currently active tab)'),
        apiKey: z.string().optional().describe('API key for authentication if enabled'),
      },
      async ({ tabId, apiKey }) => {
        const result = await bridge.sendCommand({
          command: 'start_recording_macro',
          params: {},
          tabId,
          apiKey,
          timeout: LONG_TIMEOUT,
        });
        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) }] };
      }
    );
  • Input schema for start_recording_macro: tabId (optional number) and apiKey (optional string).
    {
      tabId: z.number().optional().describe('Target tab ID (defaults to currently active tab)'),
      apiKey: z.string().optional().describe('API key for authentication if enabled'),
    },
  • WebSocketBridge.sendCommand() is the helper method that serializes the 'start_recording_macro' command and sends it over WebSocket to the Chrome extension side, awaiting a response.
    async sendCommand(cmd: BridgeCommand): Promise<BridgeResponse> {
      if (!this.isConnected()) {
        return {
          success: false,
          error: {
            code: 'NOT_CONNECTED',
            message: 'Chrome extension is not connected. Ensure the extension is installed, enabled, and the browser is running.',
          },
        };
      }
    
      const id = crypto.randomUUID();
      const timeout = cmd.timeout ?? DEFAULT_TIMEOUT;
    
      return new Promise<BridgeResponse>((resolve, reject) => {
        const timer = setTimeout(() => {
          this.pending.delete(id);
          resolve({
            success: false,
            error: {
              code: 'TIMEOUT',
              message: `Command '${cmd.command}' timed out after ${timeout}ms`,
            },
          });
        }, timeout);
    
        this.pending.set(id, { resolve, reject, timer });
    
        const message = {
          id,
          type: 'request',
          command: cmd.command,
          params: cmd.params,
          tabId: cmd.tabId,
          apiKey: cmd.apiKey,
          timestamp: Date.now(),
        };
    
        this.client!.send(JSON.stringify(message));
      });
    }
  • The registerMacroTools function is called in registerAllTools to register all macro tools (including start_recording_macro) on the MCP server.
      registerMacroTools(server, bridge);
      registerVisualRegressionTools(server, bridge);
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions starting recording and injecting a script, but fails to disclose potential side effects (e.g., impact on tab state, data capture, or need to stop recording).

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

Conciseness4/5

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

Two sentences with the action front-loaded. No unnecessary words. However, could be more concise by removing the second sentence or integrating it into the first.

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?

No output schema, so description should explain what happens after recording (e.g., return value, state). Missing connection to sibling tools like 'stop_recording_macro'. The description is incomplete for an action that mutates tab state.

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

Parameters3/5

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

Input schema has 100% coverage (both parameters described). The tool description does not add meaning beyond the schema descriptions. Baseline 3 is appropriate as schema already documents tabId and apiKey.

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 action ('Start recording user actions') and the resource ('in a tab'), and mentions injection of the macro recorder content script. It distinguishes itself from siblings like 'stop_recording_macro' and 'replay_macro' by focusing on initiating the recording process.

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 explicit guidance on when to use this tool versus alternatives (e.g., when not to use it, or that it should precede stop_recording_macro). The description does not set usage context or prerequisites beyond the input parameters.

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