electron_scaffold_ipc_channel
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
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | TypeScript type for the arguments, e.g. '{ userId: string }' or 'string'. Omit for no arguments. | |
| direction | Yes | Communication direction for the channel | |
| returnType | No | TypeScript type for the return value (renderer-to-main only), e.g. '{ name: string; email: string }'. Omit for void. | |
| channelName | Yes | The IPC channel name, e.g. 'get-user-data', 'save-settings', 'open-file-dialog' | |
| description | Yes | What this IPC channel does, e.g. 'Fetches user profile from the database' | |
| apiNamespace | No | The namespace on window.electronAPI to group this under, e.g. 'users', 'settings'. Defaults to 'api'. |