Skip to main content
Glama

set_active_session

Set the active debug session for Xdebug MCP Server to control which PHP debugging session receives subsequent commands like breakpoints and variable inspection.

Instructions

Set which debug session should be the active/default session for subsequent commands

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesSession ID to set as active

Implementation Reference

  • MCP tool registration and handler for 'set_active_session'. Validates input with Zod schema, calls SessionManager.setActiveSession(session_id), and returns formatted success or error response.
    server.tool( 'set_active_session', 'Set which debug session should be the active/default session for subsequent commands', { session_id: z.string().describe('Session ID to set as active'), }, async ({ session_id }) => { const success = sessionManager.setActiveSession(session_id); if (!success) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'Session not found', session_id, }), }, ], }; } return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: `Session "${session_id}" is now active`, }), }, ], }; } );
  • SessionManager method that sets the active session ID if the session exists in the map, returns boolean success.
    setActiveSession(id: string): boolean { if (this.sessions.has(id)) { this.activeSessionId = id; return true; } return false; }
  • Zod schema for the 'set_active_session' tool input parameter.
    session_id: z.string().describe('Session ID to set as active'), },

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