Skip to main content
Glama
@yawlabs/electron-mcp

@yawlabs/electron-mcp

Official
by YawLabs

electron_scaffold_ipc_channel

Read-onlyIdempotent

Generate complete IPC boilerplate for a new feature, including the ipcMain handler, preload contextBridge function, TypeScript types, and renderer usage example for a type-safe channel.

Instructions

Generate complete IPC boilerplate for a new feature: ipcMain handler in the main process, preload bridge function with contextBridge, TypeScript type declarations, and renderer-side usage example. Produces all the files needed for a secure, type-safe IPC channel.

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": {
      "channelName": "<channelName>",
      "direction": "<direction>",
      "description": "<description>"
    },
    "name": "electron_scaffold_ipc_channel"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoTypeScript type for the arguments, e.g. '{ userId: string }' or 'string'. Omit for no arguments.
directionYesCommunication direction for the channel
returnTypeNoTypeScript type for the return value (renderer-to-main only), e.g. '{ name: string; email: string }'. Omit for void.
channelNameYesThe IPC channel name, e.g. 'get-user-data', 'save-settings', 'open-file-dialog'
descriptionYesWhat this IPC channel does, e.g. 'Fetches user profile from the database'
apiNamespaceNoThe namespace on window.electronAPI to group this under, e.g. 'users', 'settings'. Defaults to 'api'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.7.2
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Changed4 schema fields changedv1.2.15
    • addedInput schema / properties / apiNamespace / pattern
      Added value: +"^[a-zA-Z_$][\\w$]*$"
    • addedInput schema / properties / args / pattern
      Added value: +"^[^`\\r\\n]*$"
    • addedInput schema / properties / channelName / pattern
      Added value: +"^[a-zA-Z0-9][a-zA-Z0-9._:-]*$"
    • addedInput schema / properties / returnType / pattern
      Added value: +"^[^`\\r\\n]*$"
  3. First observedv1.2.13

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the safety bar is low; the description earns credit for naming the concrete artifacts and the security posture (contextBridge, type-safe). The remaining gap is that it never says whether files are written to disk or the source is returned as content — 'Produces all the files needed' sits in mild tension with readOnlyHint=true and would benefit from one clarifying clause. Overwrite behavior is only indirectly covered by idempotentHint.

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 front-loaded sentences; the artifact list is the payload and arrives immediately. The second sentence restates 'complete boilerplate' as 'produces all the files needed' and adds only 'secure, type-safe', so it is slightly redundant rather than wasteful.

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

Completeness4/5

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

For a 6-parameter generator with no output schema, the description does the important work of describing what gets produced. It stops short of specifying return shape (file objects vs. concatenated source) and file-writing semantics, which are the two things an agent would still need to guess.

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 all six parameters (channelName, direction, args, returnType, apiNamespace, description) are documented with examples in the schema. The description mentions no parameter at all, so it adds nothing beyond the structured field — baseline 3 for a fully-covered 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?

Specific verb and resource: 'Generate complete IPC boilerplate for a new feature', with an explicit enumeration of the artifacts produced (ipcMain handler, contextBridge preload function, TypeScript declarations, renderer example). This implicitly separates it from electron_generate_preload_bridge, which covers only one of those pieces, but no sibling is named, so differentiation is inferential rather than stated.

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?

The phrase 'for a new feature' lightly implies when to reach for it (adding a new IPC channel), but there is no explicit when-to-use, no when-not-to-use, and no comparison against electron_generate_preload_bridge or the audit siblings. An agent must infer routing from the artifact list alone.

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