Skip to main content
Glama

OpenBrowser

Open a web browser to a specific URL within the RushDB graph database environment for direct web access during development workflows.

Instructions

Open a web browser to a specific URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to open

Implementation Reference

  • The core handler function for the OpenBrowser tool. Validates the input URL (only http/https allowed), determines platform-specific browser opener command, and executes it securely using child_process.execFile to open the URL in the default browser.
    export async function OpenBrowser(params: { url: string }) {
      const { url } = params;
      
      // Validate URL to prevent command injection
      let validatedUrl: string;
      try {
        // Validate URL format
        const parsedUrl = new URL(url);
        // Only allow http and https protocols
        if (!['http:', 'https:'].includes(parsedUrl.protocol)) {
          return {
            success: false,
            message: "Invalid URL protocol. Only http and https are supported.",
          };
        }
        validatedUrl = parsedUrl.toString();
      } catch (e) {
        return {
          success: false,
          message: `Invalid URL format: ${e instanceof Error ? e.message : String(e)}`,
        };
      }
      
      // Determine the command based on platform
      const command =
        platform() === "darwin"
          ? "open"
          : platform() === "win32"
          ? "start"
          : "xdg-open";
    
      return new Promise<{ success: boolean; message: string }>(
        (resolve) => {
          // Use execFile instead of exec to prevent command injection
          execFile(command, [validatedUrl], (error) => {
            if (error) {
              resolve({
                success: false,
                message: `Failed to open browser: ${error.message}`,
              });
            } else {
              resolve({
                success: true,
                message: `Successfully opened ${validatedUrl} in default browser`,
              });
            }
          });
        }
      );
    }
  • The input schema and metadata definition for the OpenBrowser tool, used for MCP tool listing and validation.
    {
      name: 'OpenBrowser',
      description: 'Open a web browser to a specific URL',
      inputSchema: {
        type: 'object',
        properties: { url: { type: 'string', description: 'The URL to open' } },
        required: ['url']
      }
    },
  • index.ts:318-329 (registration)
    Tool dispatch registration in the MCP CallToolRequestSchema handler's switch statement, which calls the OpenBrowser function with validated arguments and formats the response.
    case 'OpenBrowser':
      const openBrowserResult = await OpenBrowser({
        url: args.url as string
      })
      return {
        content: [
          {
            type: 'text',
            text: openBrowserResult.message
          }
        ]
      }
  • index.ts:72-75 (registration)
    Registers the tools list (including OpenBrowser schema) for MCP ListTools requests.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools
      }
  • index.ts:38-38 (registration)
    Imports the OpenBrowser handler function for use in the MCP server.
    import { OpenBrowser } from './tools/OpenBrowser.js'
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions opening a browser but doesn't specify whether this launches a new window/tab, requires user interaction, handles errors, or has any side effects. This leaves significant gaps for a tool that interacts with external systems.

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 appropriately sized for a simple tool and gets straight to the point without unnecessary elaboration.

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?

For a tool that opens external browsers with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after opening (e.g., success/failure indicators, whether control returns immediately), nor does it address potential security or compatibility considerations.

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?

Schema description coverage is 100%, so the input schema already documents the 'url' parameter thoroughly. The description adds no additional meaning about parameter usage, format expectations, or constraints beyond what's in the schema.

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 ('Open a web browser') and the target resource ('to a specific URL'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools, as none appear to be browser-related alternatives in the provided list.

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 offers no guidance on when to use this tool versus alternatives, prerequisites, or exclusions. It simply states what the tool does without context about appropriate scenarios or limitations.

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/rush-db/RushDB'

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