Skip to main content
Glama
Electron Debug MCP Server

Electron Debug MCP Server

by amafjarkasi

evaluate_main

Evaluates JavaScript in an Electron main or Node CDP target to inspect runtime state and debug main-process logic; use start_app with inspectMain:true for reliable target access.

Instructions

Evaluate JavaScript in the Electron main/node CDP target (use start_app with inspectMain:true for best results)

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": {
      "expression": "<expression>"
    },
    "name": "evaluate_main"
  }
}

Input Schema

NameRequiredDescriptionDefault
targetIdNoOptional explicit main/node target id from list_targets
processIdNoProcess ID. If omitted, uses the single running app.
expressionYes
returnByValueNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.15.1

TDQS

C2.9/5.0
Behavior2/5

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

Annotations mark this openWorldHint=true and destructiveHint=false, but evaluating arbitrary JavaScript in the main process is capable of mutating application state, files, or process internals — the description gives no warning about side effects, permissions, or how errors in the evaluated expression are surfaced. With no output schema, the caller also gets no statement of what is returned or how returnByValue affects it. What little is added (the inspectMain hint) is useful but far from sufficient 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 zero padding; the context qualifier comes first and the prerequisite parenthetical follows. It is efficient, though its brevity reflects omission rather than tight editing of richer content.

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?

For an arbitrary-code-execution tool with no output schema, two undocumented parameters, and only loose annotations, the definition is substantially incomplete. An agent cannot learn the return contract, error behavior, or the consequence of omitting targetId versus processId from this text.

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 coverage is 50%: targetId and processId are documented inline, but expression and returnByValue have no descriptions anywhere. The description does not compensate — it says nothing about what expression accepts (snippet vs IIFE vs awaited promise) or that returnByValue controls whether the result is serialized, which is exactly the kind of meaning the schema leaves out.

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?

The description states a specific verb and resource (evaluate JavaScript) and pins the execution context to the Electron main/node CDP target, which meaningfully distinguishes it from the sibling 'evaluate' that presumably targets the renderer. It stops short of naming that sibling explicitly, but the context qualifier does the differentiation work.

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

Usage Guidelines3/5

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

It gives one concrete prerequisite-style hint: use start_app with inspectMain:true for best results, which implies the app must be launched with main-process inspection enabled. There is no guidance on when to prefer this over 'evaluate', 'cdp_command', or 'attach', and no statement of what happens if the target isn't enabled.

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

Deploy Server

Other Tools