Skip to main content
Glama

update_breakpoint

Modify breakpoint behavior in PHP debugging sessions by enabling/disabling or adjusting hit conditions and values for precise control over execution flow.

Instructions

Update a breakpoint (enable/disable or change hit conditions). Works for both active session and pending breakpoints.

Input Schema

NameRequiredDescriptionDefault
breakpoint_idYesThe breakpoint ID to update
stateNoEnable or disable the breakpoint
hit_valueNoNew hit count value
hit_conditionNoNew hit condition
session_idNoSession ID

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "breakpoint_id": { "description": "The breakpoint ID to update", "type": "string" }, "hit_condition": { "description": "New hit condition", "enum": [ ">=", "==", "%" ], "type": "string" }, "hit_value": { "description": "New hit count value", "type": "integer" }, "session_id": { "description": "Session ID", "type": "string" }, "state": { "description": "Enable or disable the breakpoint", "enum": [ "enabled", "disabled" ], "type": "string" } }, "required": [ "breakpoint_id" ], "type": "object" }

Implementation Reference

  • Primary MCP tool registration, input schema (Zod), and handler logic for 'update_breakpoint'. Dispatches to pending breakpoints or active session.
    server.tool( 'update_breakpoint', 'Update a breakpoint (enable/disable or change hit conditions). Works for both active session and pending breakpoints.', { breakpoint_id: z.string().describe('The breakpoint ID to update'), state: z .enum(['enabled', 'disabled']) .optional() .describe('Enable or disable the breakpoint'), hit_value: z.number().int().optional().describe('New hit count value'), hit_condition: z .enum(['>=', '==', '%']) .optional() .describe('New hit condition'), session_id: z.string().optional().describe('Session ID'), }, async ({ breakpoint_id, state, hit_value, hit_condition, session_id }) => { // Check if it's a pending breakpoint if (breakpoint_id.startsWith('pending_')) { const enabled = state === undefined ? undefined : state === 'enabled'; if (enabled !== undefined) { const success = pendingBreakpoints.setBreakpointEnabled(breakpoint_id, enabled); return { content: [ { type: 'text', text: JSON.stringify({ success, breakpoint_id, updates: { state }, message: success ? 'Pending breakpoint updated' : 'Failed to update pending breakpoint (may not exist)', }), }, ], }; } return { content: [ { type: 'text', text: JSON.stringify({ success: false, breakpoint_id, message: 'Only enable/disable is supported for pending breakpoints', }), }, ], }; } const session = sessionManager.resolveSession(session_id); if (!session) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'No active debug session' }), }, ], }; } const success = await session.updateBreakpoint(breakpoint_id, { state: state as 'enabled' | 'disabled' | undefined, hitValue: hit_value, hitCondition: hit_condition as HitCondition | undefined, }); return { content: [ { type: 'text', text: JSON.stringify({ success, breakpoint_id, updates: { state, hit_value, hit_condition }, }), }, ], }; } );
  • Session class helper method implementing the core DBGP 'breakpoint_update' command to modify breakpoint properties.
    async updateBreakpoint( breakpointId: string, options: { state?: 'enabled' | 'disabled'; hitValue?: number; hitCondition?: HitCondition; } ): Promise<boolean> { const args: Record<string, string> = { d: breakpointId }; if (options.state) args['s'] = options.state; if (options.hitValue !== undefined) args['h'] = options.hitValue.toString(); if (options.hitCondition) args['o'] = options.hitCondition; const response = await this.connection.sendCommand('breakpoint_update', args); return !response.error; }
  • Input schema validation using Zod for the update_breakpoint tool parameters.
    { breakpoint_id: z.string().describe('The breakpoint ID to update'), state: z .enum(['enabled', 'disabled']) .optional() .describe('Enable or disable the breakpoint'), hit_value: z.number().int().optional().describe('New hit count value'), hit_condition: z .enum(['>=', '==', '%']) .optional() .describe('New hit condition'), session_id: z.string().optional().describe('Session ID'),
  • Explicit registration of the 'update_breakpoint' tool with MCP server.
    server.tool( 'update_breakpoint', 'Update a breakpoint (enable/disable or change hit conditions). Works for both active session and pending breakpoints.', { breakpoint_id: z.string().describe('The breakpoint ID to update'), state: z .enum(['enabled', 'disabled']) .optional() .describe('Enable or disable the breakpoint'), hit_value: z.number().int().optional().describe('New hit count value'), hit_condition: z .enum(['>=', '==', '%']) .optional() .describe('New hit condition'), session_id: z.string().optional().describe('Session ID'), }, async ({ breakpoint_id, state, hit_value, hit_condition, session_id }) => { // Check if it's a pending breakpoint if (breakpoint_id.startsWith('pending_')) { const enabled = state === undefined ? undefined : state === 'enabled'; if (enabled !== undefined) { const success = pendingBreakpoints.setBreakpointEnabled(breakpoint_id, enabled); return { content: [ { type: 'text', text: JSON.stringify({ success, breakpoint_id, updates: { state }, message: success ? 'Pending breakpoint updated' : 'Failed to update pending breakpoint (may not exist)', }), }, ], }; } return { content: [ { type: 'text', text: JSON.stringify({ success: false, breakpoint_id, message: 'Only enable/disable is supported for pending breakpoints', }), }, ], }; } const session = sessionManager.resolveSession(session_id); if (!session) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'No active debug session' }), }, ], }; } const success = await session.updateBreakpoint(breakpoint_id, { state: state as 'enabled' | 'disabled' | undefined, hitValue: hit_value, hitCondition: hit_condition as HitCondition | undefined, }); return { content: [ { type: 'text', text: JSON.stringify({ success, breakpoint_id, updates: { state, hit_value, hit_condition }, }), }, ], }; } );

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