stop
Terminate script execution immediately to stop the debug session in PHP applications using Xdebug.
Instructions
Stop the debug session and terminate script execution immediately
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | Session ID |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"session_id": {
"description": "Session ID",
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/tools/execution.ts:240-288 (registration)Registration of the MCP 'stop' tool, including schema and handler function.server.tool( 'stop', 'Stop the debug session and terminate script execution immediately', { session_id: z.string().optional().describe('Session ID'), }, async ({ session_id }) => { const session = sessionManager.resolveSession(session_id); if (!session) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'No active debug session' }), }, ], }; } try { await session.stop(); return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: 'Debug session stopped', }), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'Stop failed', message: error instanceof Error ? error.message : String(error), }), }, ], }; } } );
- src/tools/execution.ts:246-287 (handler)The execution handler for the 'stop' tool that resolves the session and calls session.stop() to terminate the debuggee.async ({ session_id }) => { const session = sessionManager.resolveSession(session_id); if (!session) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'No active debug session' }), }, ], }; } try { await session.stop(); return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: 'Debug session stopped', }), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'Stop failed', message: error instanceof Error ? error.message : String(error), }), }, ], }; } }
- src/tools/execution.ts:243-245 (schema)Input schema for the 'stop' tool: optional session_id parameter.{ session_id: z.string().optional().describe('Session ID'), },
- src/tools/index.ts:57-57 (registration)High-level registration of execution tools group, which includes the 'stop' tool.registerExecutionTools(server, ctx.sessionManager);