Skip to main content
Glama
win4r
by win4r

execute_browser_task

Automate browser actions by executing tasks described in plain text, enabling web automation through the Browser-use MCP Server.

Instructions

执行浏览器自动化任务

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYes要执行的任务描述

Implementation Reference

  • The core handler function that executes the browser task by running a shell command to activate a Python virtual environment and execute 'app.py --task "${task}"'. This is the exact implementation of the tool logic.
      private async executeBrowserTask(task: string): Promise<string> {
        const command = `cd /Users/charlesqin/PycharmProjects/PythonProject && \
    source /Users/charlesqin/PycharmProjects/PythonProject/.venv/bin/activate && \
    python app.py --task "${task}"`;
    
        try {
          const { stdout, stderr } = await execAsync(command);
          if (stderr) {
            console.error('执行命令时出现警告:', stderr);
          }
          return stdout || '任务执行完成,但没有输出结果';
        } catch (error: any) {
          throw new Error(`执行命令失败: ${error?.message || '未知错误'}`);
        }
      }
  • src/index.ts:60-91 (registration)
    Registers the CallToolRequestSchema handler, which validates the tool name 'execute_browser_task', extracts the 'task' argument, calls the core handler, and formats the response or error.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
      if (request.params.name !== 'execute_browser_task') {
        throw new McpError(
          ErrorCode.MethodNotFound,
          `未知工具: ${request.params.name}`
        );
      }
    
      const { task } = request.params.arguments as { task: string };
    
      try {
        const result = await this.executeBrowserTask(task);
        return {
          content: [
            {
              type: 'text',
              text: result,
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: `执行出错: ${error?.message || '未知错误'}`,
            },
          ],
          isError: true,
        };
      }
    });
  • src/index.ts:41-58 (registration)
    Registers the tool 'execute_browser_task' in the ListToolsRequestSchema response, including its description and input schema requiring a 'task' string.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: 'execute_browser_task',
          description: '执行浏览器自动化任务',
          inputSchema: {
            type: 'object',
            properties: {
              task: {
                type: 'string',
                description: '要执行的任务描述',
              },
            },
            required: ['task'],
          },
        },
      ],
    }));
  • Defines the input schema for the tool: an object with a required 'task' property of type string.
    inputSchema: {
      type: 'object',
      properties: {
        task: {
          type: 'string',
          description: '要执行的任务描述',
        },
      },
      required: ['task'],
    },
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. The description only states what the tool does at a high level ('execute browser automation tasks') without revealing any behavioral traits such as whether it's read-only or destructive, authentication requirements, rate limits, error handling, or what happens during execution. This leaves the agent with insufficient information to understand the tool's behavior.

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—a single phrase in Chinese that directly states the tool's function. There's no wasted language or unnecessary elaboration, making it front-loaded and efficient. However, this conciseness comes at the cost of completeness.

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

Completeness1/5

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

Given that there are no annotations and no output schema, the description is incomplete for a tool that performs browser automation. It fails to explain what the tool returns, what side effects it might have, error conditions, or any behavioral context. For a potentially complex automation tool with zero structured metadata, the description is grossly inadequate.

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?

The input schema has 100% description coverage with one parameter 'task' documented as '要执行的任务描述' (description of the task to execute). The description adds no additional meaning beyond what the schema provides—it doesn't explain what constitutes a valid task description, provide examples, or clarify semantics. With high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

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

Purpose2/5

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

The description '执行浏览器自动化任务' (Execute browser automation tasks) is a tautology that essentially restates the tool name 'execute_browser_task' in Chinese. It provides a generic verb+resource combination but lacks specificity about what types of browser automation tasks are supported or what resources are affected. No sibling tools exist for differentiation, but the description remains vague about the actual purpose.

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

Usage Guidelines1/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, such as what scenarios it's designed for, prerequisites, or limitations. There are no alternatives mentioned (though none exist as siblings), but the description fails to give any context about appropriate usage scenarios or constraints.

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/win4r/browser-use-MCP-Server'

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