Skip to main content
Glama

set_pause_on_exceptions

Control when the debugger pauses on exceptions—choose to pause on all exceptions, only uncaught ones, or never—to precisely catch errors during JavaScript debugging sessions.

Instructions

Configures whether the debugger should pause when exceptions are thrown. Useful for catching errors as they occur.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesID of the debugging session.
stateYesWhen to pause: "none" (never pause on exceptions), "uncaught" (pause only on uncaught exceptions), "all" (pause on all exceptions, including caught ones).

Implementation Reference

  • The tool handler for 'set_pause_on_exceptions'. Parses session_id and state from input, calls sessionManager.setPauseOnExceptions(), and returns success with the state.
    case 'set_pause_on_exceptions': {
      const params = z
        .object({
          session_id: z.string(),
          state: z.enum(['none', 'uncaught', 'all']),
        })
        .parse(args);
    
      await sessionManager.setPauseOnExceptions(
        params.session_id,
        params.state
      );
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              {
                success: true,
                state: params.state,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • Input schema for the tool: requires session_id (string) and state (enum: 'none', 'uncaught', 'all').
    inputSchema: {
      type: 'object',
      properties: {
        session_id: {
          type: 'string',
          description: 'ID of the debugging session.',
        },
        state: {
          type: 'string',
          enum: ['none', 'uncaught', 'all'],
          description:
            'When to pause: "none" (never pause on exceptions), ' +
            '"uncaught" (pause only on uncaught exceptions), ' +
            '"all" (pause on all exceptions, including caught ones).',
        },
      },
      required: ['session_id', 'state'],
  • src/server.ts:381-403 (registration)
    Registration of the tool in the server's tool list with name 'set_pause_on_exceptions', description, and input schema.
      name: 'set_pause_on_exceptions',
      description:
        'Configures whether the debugger should pause when exceptions are thrown. ' +
        'Useful for catching errors as they occur.',
      inputSchema: {
        type: 'object',
        properties: {
          session_id: {
            type: 'string',
            description: 'ID of the debugging session.',
          },
          state: {
            type: 'string',
            enum: ['none', 'uncaught', 'all'],
            description:
              'When to pause: "none" (never pause on exceptions), ' +
              '"uncaught" (pause only on uncaught exceptions), ' +
              '"all" (pause on all exceptions, including caught ones).',
          },
        },
        required: ['session_id', 'state'],
      },
    },
  • SessionManager.setPauseOnExceptions() - delegates to the CDP client for the given session.
    async setPauseOnExceptions(
      sessionId: string,
      state: 'none' | 'uncaught' | 'all'
    ): Promise<void> {
      const session = this.getSession(sessionId);
      await session.cdpClient.setPauseOnExceptions(state);
    }
  • CDPClient.setPauseOnExceptions() - sends the Debugger.setPauseOnExceptions CDP command with the given state.
    async setPauseOnExceptions(
      state: 'none' | 'uncaught' | 'all'
    ): Promise<void> {
      this.ensureConnected();
      await this.client!.Debugger.setPauseOnExceptions({state});
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It does not disclose persistence, scope (session vs global), default state, or interaction with other breakpoints. The description only states the obvious.

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?

Two sentences, no extraneous words. The first sentence defines the action, the second provides a use case. Efficient and front-loaded.

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?

Lacks important details: no output schema, no annotations, no mention of session lifecycle, default behavior, or implications. Given the number of siblings, more context about when and how to use is necessary.

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 coverage is 100%, so baseline is 3. The description adds no new meaning beyond the schema; it merely restates the high-level purpose. The schema already explains the enum values and required parameters.

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

Purpose5/5

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

The description clearly states the tool configures pause-on-exception behavior using specific verb 'configures' and resource 'debugger'/'exceptions'. It is distinct from siblings like set_breakpoint or pause_execution.

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

Usage Guidelines2/5

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

The phrase 'Useful for catching errors as they occur' provides a generic use case but no explicit guidance on when to use vs alternatives (e.g., breakpoints), when not to use, or how it differs from other pause options.

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/johngrimes/mcp-js-debugger'

If you have feedback or need assistance with the MCP directory API, please join our Discord server