load_debug_profile
Load a saved debug profile to resume debugging PHP applications with breakpoints, variable inspection, and stack traces.
Instructions
Load a saved debug profile
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Profile name to load |
Implementation Reference
- src/tools/advanced.ts:568-612 (handler)The async handler function for the load_debug_profile tool. It fetches the profile from configManager, clears and reloads watches, step filters, logpoints, sets active profile, and returns load summary.async ({ name }) => { const profile = ctx.configManager.getProfile(name); if (!profile) { return { content: [{ type: 'text', text: JSON.stringify({ error: `Profile not found: ${name}` }) }], }; } // Clear current settings ctx.watchManager.clearAllWatches(); // Load watches for (const expr of profile.watchExpressions) { ctx.watchManager.addWatch(expr); } // Load step filters ctx.stepFilter.importConfig(profile.stepFilters); // Load logpoints for (const lp of profile.logpoints) { ctx.logpointManager.createLogpoint(lp.file, lp.line, lp.message, lp.condition); } ctx.configManager.setActiveProfile(name); return { content: [ { type: 'text', text: JSON.stringify({ success: true, loaded: { name: profile.name, breakpoints: profile.breakpoints.length, watches: profile.watchExpressions.length, filters: profile.stepFilters.length, logpoints: profile.logpoints.length, }, note: 'Breakpoints need to be set manually using set_breakpoint for each entry', }), }, ], }; }
- src/tools/advanced.ts:565-567 (schema)Input schema for the tool: requires 'name' string parameter identifying the profile to load.{ name: z.string().describe('Profile name to load'), },
- src/tools/advanced.ts:562-613 (registration)Direct registration of the load_debug_profile tool using server.tool() in advanced tools module.server.tool( 'load_debug_profile', 'Load a saved debug profile', { name: z.string().describe('Profile name to load'), }, async ({ name }) => { const profile = ctx.configManager.getProfile(name); if (!profile) { return { content: [{ type: 'text', text: JSON.stringify({ error: `Profile not found: ${name}` }) }], }; } // Clear current settings ctx.watchManager.clearAllWatches(); // Load watches for (const expr of profile.watchExpressions) { ctx.watchManager.addWatch(expr); } // Load step filters ctx.stepFilter.importConfig(profile.stepFilters); // Load logpoints for (const lp of profile.logpoints) { ctx.logpointManager.createLogpoint(lp.file, lp.line, lp.message, lp.condition); } ctx.configManager.setActiveProfile(name); return { content: [ { type: 'text', text: JSON.stringify({ success: true, loaded: { name: profile.name, breakpoints: profile.breakpoints.length, watches: profile.watchExpressions.length, filters: profile.stepFilters.length, logpoints: profile.logpoints.length, }, note: 'Breakpoints need to be set manually using set_breakpoint for each entry', }), }, ], }; } );
- src/tools/index.ts:61-61 (registration)Top-level registration call to registerAdvancedTools, which includes the load_debug_profile tool among advanced tools.registerAdvancedTools(server, ctx as AdvancedToolsContext);
- src/session/debug-config.ts:76-78 (helper)DebugConfigManager.getProfile(name) method called by the handler to retrieve the DebugProfile data from in-memory map.getProfile(name: string): DebugProfile | undefined { return this.profiles.get(name); }
- src/session/debug-config.ts:19-42 (schema)TypeScript interface defining the structure of a DebugProfile used by the tool.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; }; }