Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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 ), }, ], }; } );
  • 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 ), }, ], }; }
  • 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; }; }
  • Helper method in DebugConfigManager that returns all loaded debug profiles, called directly by the tool handler.
    getAllProfiles(): DebugProfile[] { return Array.from(this.profiles.values()); }
  • 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); } } }

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