Skip to main content
Glama

execute_browserql

Execute GraphQL queries for browser automation tasks like web scraping, content extraction, and performance audits using Browserless.io.

Instructions

Execute BrowserQL GraphQL queries

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
variablesNo

Implementation Reference

  • MCP CallToolRequest handler for 'execute_browserql' that validates arguments, calls BrowserlessClient.executeBrowserQL, and formats the response as MCP content.
    case 'execute_browserql': {
      if (!args) throw new Error('Arguments are required');
      const result = await this.client!.executeBrowserQL(args as any);
      if (result.success && result.data) {
        return {
          content: [
            {
              type: 'text',
              text: 'BrowserQL query executed successfully.',
            },
            {
              type: 'text',
              text: JSON.stringify(result.data, null, 2),
            },
          ],
        };
      } else {
        throw new Error(result.error || 'Failed to execute BrowserQL query');
      }
    }
  • BrowserlessClient method implementing the core logic: sends POST request to Browserless /chromium/bql endpoint with the BrowserQL query and variables.
    async executeBrowserQL(request: BrowserQLRequest): Promise<BrowserlessResponse<BrowserQLResponse>> {
      try {
        const response: AxiosResponse<BrowserQLResponse> = await this.httpClient.post('/chromium/bql', request);
    
        return {
          success: true,
          data: response.data,
        };
      } catch (error) {
        return this.handleError(error);
      }
    }
  • src/index.ts:206-217 (registration)
    Tool registration in ListToolsRequestHandler, defining name, description, and input schema for execute_browserql.
    {
      name: 'execute_browserql',
      description: 'Execute BrowserQL GraphQL queries',
      inputSchema: {
        type: 'object',
        properties: {
          query: { type: 'string' },
          variables: { type: 'object' },
        },
        required: ['query'],
      },
    },
  • Zod schema and TypeScript type definition for BrowserQLRequest (input validation).
    export const BrowserQLRequestSchema = z.object({
      query: z.string(),
      variables: z.record(z.any()).optional(),
    });
    
    export type BrowserQLRequest = z.infer<typeof BrowserQLRequestSchema>;
  • TypeScript interface for BrowserQLResponse (output type).
    export interface BrowserQLResponse {
      data: any;
      errors?: any[];
    }
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 states the tool executes queries but doesn't describe what happens during execution (e.g., network calls, browser interactions, error handling), what permissions or resources are required, or what the output looks like. For a tool with potential side effects and no structured safety hints, this is a significant gap.

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, efficient sentence with zero wasted words. It's front-loaded with the core action ('Execute') and resource ('BrowserQL GraphQL queries'), making it easy to parse. Every word earns its place by conveying the essential purpose without redundancy.

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 the complexity (GraphQL execution likely involves network/browser operations), lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't cover execution behavior, error cases, return values, or how it integrates with sibling tools like 'initialize_browserless'. For a tool with such potential depth, more context is needed.

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?

The schema has 2 parameters with 0% description coverage, so the description must compensate. It mentions 'GraphQL queries' but doesn't explain the 'query' parameter's format (e.g., GraphQL syntax) or the 'variables' parameter's role (e.g., for query placeholders). The description adds minimal value beyond what's inferred from the tool name, failing to address the undocumented parameters adequately.

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

Purpose3/5

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

The description states the tool executes BrowserQL GraphQL queries, which provides a basic purpose (verb+resource). However, it doesn't specify what BrowserQL is or how it differs from standard GraphQL, nor does it distinguish this tool from siblings like 'execute_function' or 'run_performance_audit' that might also execute code/queries. The purpose is clear at a surface level but lacks specificity and differentiation.

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., needing an initialized browser session), exclusions (e.g., not for simple HTTP requests), or comparisons to siblings like 'execute_function' for non-GraphQL execution. Without such context, an agent must infer usage from the tool name alone.

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/Lizzard-Solutions/browserless-mcp'

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