Skip to main content
Glama
Electron Debug MCP Server

Electron Debug MCP Server

by amafjarkasi

mock_electron_api

Mock Electron main-process APIs like dialog, shell, and app with custom return values or JS implementations to test app behavior under controlled conditions.

Instructions

Mock an Electron main-process API (e.g. dialog.showOpenDialog, shell.openExternal, app.getPath) with a custom return value or implementation. Requires inspectMain.

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": {
      "module": "<module>",
      "method": "<method>"
    },
    "name": "mock_electron_api"
  }
}

Input Schema

NameRequiredDescriptionDefault
methodYesMethod name to mock (e.g. 'showOpenDialog', 'openExternal', 'showMessageBox')
moduleYesElectron module name (e.g. 'dialog', 'shell', 'app', 'clipboard', 'autoUpdater')
returnsNoValue or Promise result to return when invoked
targetIdNo
processIdNoProcess ID. If omitted, uses the single running app.
implementationNoOptional JS function body to execute as mock

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.15.1

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare destructiveHint=false and openWorldHint=true, so the safety profile is partly covered. The description adds value by scoping the tool to the main process and noting the inspectMain prerequisite, but omits the mock lifecycle (does it persist across calls? must it be restored?) and whether the mock applies per-process or globally.

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 dense sentences with the action and examples front-loaded and no filler. The trailing "Requires inspectMain" is terse to the point of ambiguity about whether it names a tool or a field, but nothing is wasted.

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?

For a 6-parameter mutation-style tool with no output schema, the description covers the core action and one prerequisite but leaves targetId undefined, says nothing about mock persistence or cleanup, and gives no indication of failure modes. Adequate, but an agent would need to consult the schema and siblings to call it safely.

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 coverage is 83%, so the schema already documents module, method, processId, and implementation. The description only reinforces the module/method pairing via examples and hints that target selection depends on inspectMain; it adds nothing about the undocumented targetId parameter or how returns vs implementation interact.

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 (Mock) and resource (Electron main-process API) and backs it with concrete module.method examples like dialog.showOpenDialog and shell.openExternal, so an agent knows exactly what class of thing is being stubbed. It does not name the sibling that reverses this (restore_electron_mocks), so differentiation from siblings is only implicit.

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?

"Requires inspectMain" gives one prerequisite, which is genuinely useful routing information. However, there is no guidance on when to mock versus use real interaction, no mention of pairing with restore_electron_mocks to undo, and no statement about which targets can be mocked.

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