Skip to main content
Glama
Arc DevTools MCP Server

Arc DevTools MCP Server

by fukayatti

evaluate_script

Executes a JavaScript function in the currently selected Arc page and returns the result as JSON, so you can inspect or extract page data.

Instructions

Evaluate a JavaScript function inside the currently selected page. Returns the response as JSON so returned values have to JSON-serializable.

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": {
      "function": "<function>"
    },
    "name": "evaluate_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoAn optional list of arguments to pass to the function.
functionYesA JavaScript function declaration to be executed by the tool in the currently selected page. Example without arguments: `() => { return document.title }` or `async () => { return await fetch("example.com") }`. Example with arguments: `(el) => { return el.innerText; }`

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.4

TDQS

B3.2/5.0
Behavior3/5

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

Annotations only supply readOnlyHint=false, so the description carries the rest of the burden. It usefully discloses that results are serialized to JSON and therefore must be JSON-serializable, but it omits the significant behavioral fact that arbitrary script execution can mutate page state and trigger network calls, and says nothing about whether async functions are awaited (only the schema example hints at it).

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?

Two short sentences with the core action front-loaded and no filler. Minor deductions for an awkwardly wrapped line and the ungrammatical clause 'have to JSON-serializable'.

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

Completeness3/5

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

With no output schema, the description correctly covers return-value serialization, which is the most important consumer-facing fact. However, for a non-read-only tool that executes arbitrary code, the absence of any note on side effects, awaiting async functions, or scoping to the selected page's context leaves meaningful gaps.

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?

Schema description coverage is 100%, including examples for both the no-argument and argument forms, so the baseline is 3. The description itself adds nothing about the optional args array or how element uids from the snapshot are passed in, so it contributes no meaning beyond the schema.

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 and resource: evaluates a JavaScript function inside the currently selected page, and names the return encoding (JSON). It is unambiguous what the tool does, though it does not explicitly contrast itself with observation tools like take_snapshot or list_console_messages that an agent might also use to inspect page state.

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 or when-not-to-use guidance, no mention of preferring structured sibling tools (snapshot, click, fill) for routine interactions, and no warning about side effects. The only usage-relevant statement is the JSON-serializability requirement on return values, which constrains the call but does not help the agent decide to make it.

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