Skip to main content
Glama
mendableai

Firecrawl MCP Server

by mendableai

firecrawl_browser_execute

Execute browser automation code to navigate pages, click elements, extract data, and run multi-step workflows using bash, Python, or JavaScript commands in an active browser session.

Instructions

Execute code in a browser session. Supports agent-browser commands (bash), Python, or JavaScript.

Best for: Browser automation, navigating pages, clicking elements, extracting data, multi-step browser workflows. Requires: An active browser session (create one with firecrawl_browser_create first).

Arguments:

  • sessionId: The browser session ID (required)

  • code: The code to execute (required)

  • language: "bash", "python", or "node" (optional, defaults to "bash")

Recommended: Use bash with agent-browser commands (pre-installed in every sandbox):

{
  "name": "firecrawl_browser_execute",
  "arguments": {
    "sessionId": "session-id-here",
    "code": "agent-browser open https://example.com",
    "language": "bash"
  }
}

Common agent-browser commands:

  • agent-browser open <url> — Navigate to URL

  • agent-browser snapshot — Get accessibility tree with clickable refs (for AI)

  • agent-browser snapshot -i -c — Interactive elements only, compact

  • agent-browser click @e5 — Click element by ref from snapshot

  • agent-browser type @e3 "text" — Type into element

  • agent-browser fill @e3 "text" — Clear and fill element

  • agent-browser get text @e1 — Get text content

  • agent-browser get title — Get page title

  • agent-browser get url — Get current URL

  • agent-browser screenshot [path] — Take screenshot

  • agent-browser scroll down — Scroll page

  • agent-browser wait 2000 — Wait 2 seconds

  • agent-browser --help — Full command reference

For Playwright scripting, use Python (has proper async/await support):

{
  "name": "firecrawl_browser_execute",
  "arguments": {
    "sessionId": "session-id-here",
    "code": "await page.goto('https://example.com')\ntitle = await page.title()\nprint(title)",
    "language": "python"
  }
}

Note: Prefer bash (agent-browser) or Python. Returns: Execution result including stdout, stderr, and exit code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYes
codeYes
languageNo
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing behavioral traits: it explains the execution environment (browser session), language support, default behavior (language defaults to 'bash'), and return format (execution result with stdout, stderr, exit code). It doesn't mention rate limits or authentication needs, but covers most essential behavioral aspects.

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?

The description is well-structured with clear sections (Best for, Requires, Arguments, Recommended, Common commands, For Playwright, Note, Returns) and uses bullet points and code blocks effectively. While comprehensive, every sentence earns its place by providing essential guidance or examples, though it could be slightly more concise in the command listing.

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

Completeness5/5

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

Given the tool's complexity (browser automation with multiple language options), no annotations, no output schema, and 0% schema coverage, the description provides complete context: purpose, prerequisites, parameter details, extensive examples, language recommendations, common commands, and return value explanation. It leaves no significant gaps for agent understanding.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by providing detailed parameter explanations: sessionId is 'The browser session ID (required)', code is 'The code to execute (required)', and language is explained with enum values, default behavior, and language-specific recommendations. Multiple code examples show exactly how to use each parameter.

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 as 'Execute code in a browser session' with specific language support (bash, Python, JavaScript) and distinguishes it from siblings by focusing on browser automation rather than crawling, scraping, or session management. It explicitly mentions what it does and how it differs from other tools like firecrawl_browser_create.

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

Usage Guidelines5/5

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

The description provides explicit guidance with 'Best for:' section listing specific use cases (browser automation, navigating pages, etc.), 'Requires:' section stating prerequisite (active browser session from firecrawl_browser_create), and 'Note:' section recommending language preferences. It clearly tells when to use this tool versus alternatives.

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/mendableai/firecrawl-mcp-server'

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