Skip to main content
Glama

tauri_ipc_emit_event

Emit Tauri events to test event handlers in Tauri v2 applications. Use this tool to verify IPC communication and event-driven functionality during development and debugging.

Instructions

[Tauri Apps Only] Emit a Tauri event to test event handlers. Requires active tauri_driver_session. Events are Tauri-specific (not DOM events). For browser DOM events, use Chrome DevTools MCP instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventNameYes
payloadNo
appIdentifierNoApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.

Implementation Reference

  • Registration of the 'tauri_ipc_emit_event' tool, linking schema and handler function
    { name: 'tauri_ipc_emit_event', description: '[Tauri Apps Only] Emit a Tauri event to test event handlers. ' + 'Requires active tauri_driver_session. Events are Tauri-specific (not DOM events). ' + 'For browser DOM events, use Chrome DevTools MCP instead.', category: TOOL_CATEGORIES.IPC_PLUGIN, schema: EmitTestEventSchema, annotations: { title: 'Emit Tauri Event', readOnlyHint: false, destructiveHint: false, openWorldHint: false, }, handler: async (args) => { const parsed = EmitTestEventSchema.parse(args); return await emitTestEvent(parsed.eventName, parsed.payload, parsed.appIdentifier); }, },
  • Zod schema for input validation of the tauri_ipc_emit_event tool
    export const EmitTestEventSchema = z.object({ eventName: z.string(), payload: z.unknown(), appIdentifier: z.union([ z.string(), z.number() ]).optional().describe( 'App port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.' ), });
  • Handler function that executes the tool: emits the event via IPC to the Tauri MCP bridge plugin
    export async function emitTestEvent(eventName: string, payload: unknown, appIdentifier?: string | number): Promise<string> { try { const result = await executeIPCCommand({ command: 'plugin:mcp-bridge|emit_event', args: { eventName, payload, }, appIdentifier, }); const parsed = JSON.parse(result); if (!parsed.success) { throw new Error(parsed.error || 'Unknown error'); } return JSON.stringify(parsed.result); } catch(error: unknown) { const message = error instanceof Error ? error.message : String(error); throw new Error(`Failed to emit event: ${message}`); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hypothesi/mcp-server-tauri'

If you have feedback or need assistance with the MCP directory API, please join our Discord server