Skip to main content
Glama
electron-stagewright

Electron Stagewright

Inject into running Electron app

electron_inject

Attach to a running Electron app without a debug flag by injecting the Node inspector using its process ID, enabling inspection and automation of the live desktop app.

Instructions

Attach to a running Electron process that was NOT started with a debug flag, by injecting the Node inspector. Provide pid. Returns: { ok, session_id, transport, windows, capabilities }. Errors: INJECT_FAILED (handshake failed or inspector belongs to another process; retryable — try electron_attach when the app already exposes a debug endpoint), TRANSPORT_UNSUPPORTED, BAD_ARGUMENT.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYesProcess id of the running Electron app.
timeoutMsNoMax wait for the inspector handshake.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.0
  2. Removedv0.4.1
  3. First observedv0.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only give readOnlyHint=false and openWorldHint=false; the description goes well beyond by disclosing the return shape ({ ok, session_id, transport, windows, capabilities }) and three named error conditions with retryability and a remediation path. This is exactly the extra context annotations cannot supply for an injection/mutation 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?

Front-loads the key precondition and mechanism in the first clause, then compresses return shape and errors into a tight list. Dense but every element earns its place; slightly runs together as one long block without visual separation.

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

Completeness5/5

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

No output schema exists, yet the description still names the return fields and enumerates failure modes with retry guidance, so an agent knows both what comes back and how to recover. Nothing needed to invoke this tool correctly is missing.

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% and both params (pid, timeoutMs) are already documented there. The description only restates 'Provide pid', adding no format, range, or default detail beyond the schema. Baseline 3 applies when the schema does the heavy lifting.

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 (attach), the resource (a running Electron process), and the decisive precondition (NOT started with a debug flag) plus the mechanism (injecting the Node inspector). This immediately distinguishes it from the sibling electron_attach, which targets apps already exposing a debug endpoint.

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

Usage Guidelines5/5

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

Explicitly frames the selection condition (app lacks a debug flag) and routes to the alternative in the error guidance: 'try electron_attach when the app already exposes a debug endpoint'. Both the when and the when-not are stated, along with the retryable nature of INJECT_FAILED.

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