Skip to main content
Glama

browser_run_code

Run Python automation code inside the persistent browser daemon to control pages, extract data, and execute multi-step browser tasks.

Instructions

Execute Python automation code directly inside the resident browser daemon.

Input Schema

NameRequiredDescriptionDefault
codeYes
tab_indexNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.7/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden. It implies persistence ('resident browser daemon') but says nothing about whether the code runs sandboxed, what page/DOM access it has, mutation risk, timeouts, or error behavior for arbitrary Python — significant gaps for a code-execution tool.

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?

A single front-loaded sentence with no filler, which is structurally clean. It is arguably terse to the point of under-specification for a high-risk execution tool, but there is no wasted text.

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?

An output schema exists so return values need not be explained, but for a tool that executes arbitrary Python in a live browser with zero annotations and zero parameter documentation, the description omits what an agent must know to call it safely and correctly.

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?

Schema description coverage is 0% with two parameters. The phrase 'Python automation code' incidentally conveys the language for 'code', but nothing is said about available APIs, globals, or context. 'tab_index' is completely undocumented in both schema and description, including whether it defaults to the active tab.

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?

States a specific verb (Execute) and resource (Python automation code in the resident browser daemon), which is clearer than a generic 'run code'. It does not, however, distinguish itself from close siblings like browser_evaluate or browser_batch, so an agent cannot tell from the text alone which execution surface to pick.

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?

There is no when-to-use guidance, no prerequisites, and no mention of alternatives. With siblings such as browser_evaluate, browser_batch, and browser_get_content present, the description leaves the routing decision entirely to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.