Skip to main content
Glama

electron_cdp_evaluate

Run JavaScript inside an Electron app's context and return the result to inspect state, manipulate UI, or debug behavior.

Instructions

Execute JavaScript code in the Electron app context and return the result

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": {
      "script": "<script>",
      "returnValue": "<returnValue>"
    },
    "name": "electron_cdp_evaluate"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNo
scriptYesJavaScript code to execute in the app context
returnValueYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.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 disclosure burden and delivers almost nothing: it never says which process the code runs in (main vs renderer), whether the code is awaited, whether promises resolve, or whether the returned value must be JSON-serializable. For an arbitrary-code-execution tool, the absence of any safety or side-effect disclosure is a substantial gap.

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 or redundancy. It is compact and readable, though the space saved was not spent on the missing behavioral or parameter detail.

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?

Three parameters with two undocumented, zero annotations, and no output schema leaves the agent without critical information: process context, argument binding, serialization limits, and error behavior. Given the complexity and risk of executing arbitrary JavaScript, the definition does not supply enough to invoke it 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 only 33%: 'script' is documented in the schema, but 'args' and 'returnValue' are undocumented in both the schema and the description. The description says the result is returned but never explains how 'args' are injected into the script or what returnValue=false does (fire-and-forget vs. suppress output), so it adds 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 ('Execute') and resource ('JavaScript code in the Electron app context') plus a return behavior, which is enough to separate it from read-only siblings like electron_cdp_console or electron_cdp_network. It stops short of explicitly naming alternatives, so a 4 rather than a 5.

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 at all — nothing says whether this is the fallback when electron_click/electron_type/electron_verify_* cannot accomplish a task, or whether it should be preferred. No preconditions, no exclusions, and no mention of when NOT to run arbitrary script.

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