Skip to main content
Glama

save_debug_profile

Save current Xdebug configuration including breakpoints, watches, and filters as a named profile for reuse in PHP debugging sessions.

Instructions

Save the current debug configuration (breakpoints, watches, filters) as a named profile

Input Schema

NameRequiredDescriptionDefault
nameYesProfile name
descriptionNoProfile description

Input Schema (JSON Schema)

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

Implementation Reference

  • Full registration of the 'save_debug_profile' tool, including input schema, description, and inline async handler that collects and saves current debug state (breakpoints, watches, filters, logpoints) to a named profile using DebugConfigManager.
    server.tool( 'save_debug_profile', 'Save the current debug configuration (breakpoints, watches, filters) as a named profile', { name: z.string().describe('Profile name'), description: z.string().optional().describe('Profile description'), }, async ({ name, description }) => { const session = ctx.sessionManager.getActiveSession(); // Create profile with current settings const profile = ctx.configManager.createProfile(name, description); // Add current breakpoints if (session) { const breakpoints = await session.listBreakpoints(); profile.breakpoints = breakpoints.map((bp) => ({ file: bp.filename || '', line: bp.lineno || 0, condition: bp.expression, enabled: bp.state === 'enabled', })); } // Add watches profile.watchExpressions = ctx.watchManager.getAllWatches().map((w) => w.expression); // Add step filters profile.stepFilters = ctx.stepFilter.getAllRules().map((r) => ({ pattern: r.pattern, type: r.type, enabled: r.enabled, })); // Add logpoints profile.logpoints = ctx.logpointManager.getAllLogpoints().map((lp) => ({ file: lp.file, line: lp.line, message: lp.message, condition: lp.condition, })); await ctx.configManager.saveAllProfiles(); return { content: [ { type: 'text', text: JSON.stringify({ success: true, profile: { name: profile.name, breakpoints: profile.breakpoints.length, watches: profile.watchExpressions.length, filters: profile.stepFilters.length, logpoints: profile.logpoints.length, }, }), }, ], }; } );

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