Skip to main content
Glama

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

NameRequiredDescriptionDefault
session_idNoSession 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

  • 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), }), }, ], }; } } );
  • 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), }), }, ], }; } }
  • Input schema for the 'stop' tool: optional session_id parameter.
    { session_id: z.string().optional().describe('Session ID'), },
  • High-level registration of execution tools group, which includes the 'stop' tool.
    registerExecutionTools(server, ctx.sessionManager);

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/kpanuragh/xdebug-mcp'

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