Skip to main content
Glama

load_debug_profile

Load a saved Xdebug profile to resume debugging PHP applications with breakpoints, variable inspection, and stack traces.

Instructions

Load a saved debug profile

Input Schema

NameRequiredDescriptionDefault
nameYesProfile name to load

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "name": { "description": "Profile name to load", "type": "string" } }, "required": [ "name" ], "type": "object" }

Implementation Reference

  • The complete registration and inline handler for the 'load_debug_profile' MCP tool. It validates input with Zod schema, retrieves the profile from DebugConfigManager, restores watches by clearing and adding them, imports step filters, recreates logpoints, sets the profile as active, and returns loaded counts. Breakpoints are noted to be set manually.
    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', }), }, ], }; }
  • Registers all advanced tools including 'load_debug_profile' by calling registerAdvancedTools.
    // Advanced tools registerAdvancedTools(server, ctx as AdvancedToolsContext);
  • Helper method in DebugConfigManager used by the tool handler to retrieve the profile data from in-memory map (loaded from disk via loadProfiles).
    getProfile(name: string): DebugProfile | undefined { return this.profiles.get(name); }
  • Zod input schema for the load_debug_profile tool requiring a profile name.
    { name: z.string().describe('Profile name to load'), },

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