Skip to main content
Glama

update_breakpoint

Modify breakpoint settings in Xdebug debugging sessions to enable, disable, or adjust hit conditions for PHP application debugging.

Instructions

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

Input Schema

TableJSON 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

Implementation Reference

  • The main handler function for the 'update_breakpoint' MCP tool. It handles updates for both pending breakpoints (enable/disable only) and active session breakpoints by calling session.updateBreakpoint.
    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 },
            }),
          },
        ],
      };
    }
  • Input schema definition (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'),
    },
  • Registration of the 'update_breakpoint' tool using server.tool() in registerBreakpointTools function.
    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 method that performs the actual DBGP 'breakpoint_update' command to update an active breakpoint.
    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;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool updates breakpoints for active and pending sessions, but doesn't specify required permissions, whether changes are reversible, error conditions, or what happens to unspecified parameters. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is highly concise and front-loaded: a single sentence that directly states the tool's purpose and scope. Every word earns its place, with no redundant or vague phrasing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns, error handling, side effects, or dependencies on other tools like 'list_breakpoints'. For a tool with 5 parameters and complex behavior, more contextual information is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value by implying that 'hit conditions' relate to 'hit_value' and 'hit_condition' parameters, but doesn't provide additional semantics beyond what's in the schema. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Update a breakpoint (enable/disable or change hit conditions).' It specifies the verb ('update') and resource ('breakpoint') with concrete actions. However, it doesn't explicitly differentiate from sibling tools like 'set_breakpoint' or 'remove_breakpoint' beyond mentioning it works for both active and pending breakpoints.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage context by stating 'Works for both active session and pending breakpoints,' which implies when this tool is applicable. However, it doesn't explicitly state when to use this versus alternatives like 'set_breakpoint' (for creation) or 'remove_breakpoint' (for deletion), nor does it mention prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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