terminal_stop
Stop a terminal session in an Electron application by providing the session ID, allowing for clean termination of command execution processes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes |
Implementation Reference
- index.js:360-384 (registration)Registration of the 'terminal_stop' MCP tool, including input schema (sessionId) and inline handler that proxies a stop request to the Electron backend API endpoint /stop/{sessionId}.server.tool( "terminal_stop", { sessionId: z.string() }, async ({ sessionId }) => { try { // Check if server is running, start if not if (!(await isServerRunning())) { await startElectronProcess(); } const response = await axios.post(`${apiBaseUrl}/stop/${sessionId}`); const result = response.data; return { content: [{ type: "text", text: `Session ID: ${result.sessionId}\n\n ${result.message}`, exitCode: result.exitCode }] }; } catch (error) { return formatErrorResponse(error, sessionId); } } );
- index.js:365-383 (handler)The handler function for the terminal_stop tool. Ensures the Electron server is running, then sends a POST request to stop the specified terminal session and returns the result.async ({ sessionId }) => { try { // Check if server is running, start if not if (!(await isServerRunning())) { await startElectronProcess(); } const response = await axios.post(`${apiBaseUrl}/stop/${sessionId}`); const result = response.data; return { content: [{ type: "text", text: `Session ID: ${result.sessionId}\n\n ${result.message}`, exitCode: result.exitCode }] }; } catch (error) { return formatErrorResponse(error, sessionId); } }
- index.js:362-364 (schema)Input schema for terminal_stop tool, requiring a sessionId string.{ sessionId: z.string() },