Skip to main content
Glama
chrome-remote-debugging-mcp

chrome-remote-debugging-mcp

by danilin-em

evaluate_file

Runs a JavaScript file from an absolute path inside a Chrome tab, returning the final expression value or error and optionally saving output to a file.

Instructions

Evaluate a JavaScript file in a Chrome tab — evaluate for big scripts.

path must be absolute (~ is expanded) and names a UTF-8 file on the machine running this server, not the one running Chrome. Its contents run exactly as an evaluate expression: the value of the last statement is returned, promises are awaited (30 s limit), and stack traces of a JS exception name the file. Returns {"tab_id", "value", "type"} or {"error": ...}. output_path saves the value to a file instead, exactly as in evaluate.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "tab_id": "<tab_id>"
    },
    "name": "evaluate_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
tab_idYes
output_pathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.1

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses execution semantics (last-statement value returned, promises awaited with a 30 s limit, stack traces naming the file), the return shape {tab_id, value, type} or {error: ...}, and how output_path redirects the value to a file. It stops short of flagging that this is arbitrary code execution in the browser and any auth/security expectations, which matters for a tool that runs user code.

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?

Four short sentences, each doing real work: purpose and sibling routing first, then path constraints, then execution/return semantics, then output_path. No padding or restated schema.

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

Completeness4/5

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

For a three-parameter tool with no annotations and no output schema, the description covers return format, error format, timeout behavior, and path/host semantics, which is nearly everything needed to call it correctly. The main remaining gap is the meaning of tab_id and the fact that this executes arbitrary code in the browser context.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate, and it does for two of three parameters: path must be absolute, ~ is expanded, and it must be a UTF-8 file on the server host rather than the Chrome host; output_path saves the value to a file 'exactly as in evaluate'. tab_id is only implicitly defined as the target Chrome tab, leaving one parameter under-specified.

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?

States a specific verb and resource ('Evaluate a JavaScript file in a Chrome tab') and immediately distinguishes itself from the sibling evaluate tool by scoping itself to file-based scripts ('evaluate for big scripts'). An agent can tell exactly what this does and how it differs from the inline evaluator.

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

Usage Guidelines4/5

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

Names the alternative (evaluate) and gives the selecting condition (big scripts, i.e., file-based rather than inline). It does not spell out when-not to use this (e.g., tiny expressions) or any prerequisites around tab state, but the routing signal is clear.

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