list_debug_profiles
Retrieve all saved debug configurations for PHP applications to quickly access and manage debugging sessions.
Instructions
List all saved debug profiles
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/advanced.ts:615-647 (registration)Registration of the 'list_debug_profiles' MCP tool, including input schema (empty object), description, and inline async handler that loads profiles via DebugConfigManager and returns a formatted JSON response with active profile and list of profiles.server.tool( 'list_debug_profiles', 'List all saved debug profiles', {}, async () => { await ctx.configManager.loadProfiles(); const profiles = ctx.configManager.getAllProfiles(); const activeProfile = ctx.configManager.getActiveProfile(); return { content: [ { type: 'text', text: JSON.stringify( { activeProfile: activeProfile?.name || null, profiles: profiles.map((p) => ({ name: p.name, description: p.description, breakpoints: p.breakpoints.length, watches: p.watchExpressions.length, createdAt: p.createdAt, updatedAt: p.updatedAt, })), }, null, 2 ), }, ], }; } );
- src/tools/advanced.ts:619-646 (handler)The core handler logic for the list_debug_profiles tool, which ensures profiles are loaded and serializes the list of profiles with metadata for MCP response.async () => { await ctx.configManager.loadProfiles(); const profiles = ctx.configManager.getAllProfiles(); const activeProfile = ctx.configManager.getActiveProfile(); return { content: [ { type: 'text', text: JSON.stringify( { activeProfile: activeProfile?.name || null, profiles: profiles.map((p) => ({ name: p.name, description: p.description, breakpoints: p.breakpoints.length, watches: p.watchExpressions.length, createdAt: p.createdAt, updatedAt: p.updatedAt, })), }, null, 2 ), }, ], }; }
- src/session/debug-config.ts:19-42 (schema)TypeScript interface defining the structure of a DebugProfile, used by the tool's handler to serialize profile data.export interface DebugProfile { name: string; description?: string; createdAt: Date; updatedAt: Date; breakpoints: BreakpointConfig[]; watchExpressions: string[]; logpoints: Array<{ file: string; line: number; message: string; condition?: string; }>; stepFilters: Array<{ pattern: string; type: 'include' | 'exclude'; enabled: boolean; }>; settings: { maxDepth?: number; maxChildren?: number; skipVendor?: boolean; }; }
- src/session/debug-config.ts:90-92 (helper)Helper method in DebugConfigManager that returns all loaded debug profiles, called directly by the tool handler.getAllProfiles(): DebugProfile[] { return Array.from(this.profiles.values()); }
- src/session/debug-config.ts:160-182 (helper)Helper method that loads debug profiles from disk (profiles.json), ensuring fresh data before listing.async loadProfiles(): Promise<void> { try { const filePath = path.join(this.configDir, 'profiles.json'); const content = await fs.readFile(filePath, 'utf8'); const data = JSON.parse(content); this.profiles.clear(); for (const profile of data.profiles || []) { this.profiles.set(profile.name, { ...profile, createdAt: new Date(profile.createdAt), updatedAt: new Date(profile.updatedAt), }); } this.activeProfileName = data.activeProfile || null; logger.info(`Loaded ${this.profiles.size} profiles from ${filePath}`); } catch (error) { if ((error as NodeJS.ErrnoException).code !== 'ENOENT') { logger.error('Failed to load profiles:', error); } } }