Skip to main content
Glama
workbackai

MCP NodeJS Debugger

by workbackai

set_breakpoint

Set a breakpoint at a specific line in a Node.js file to pause execution for debugging.

Instructions

Sets a breakpoint at specified line and file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesFile path where to set breakpoint
lineYesLine number for breakpoint

Implementation Reference

  • The main handler function for the set_breakpoint tool. Converts the file path to a file URL, escapes it for regex, and sends a Debugger.setBreakpointByUrl command to the inspector with 0-based line number. Stores the breakpoint ID locally and returns success or error message.
    async ({ file, line }) => {
      try {
        // Ensure debugger is enabled
        if (!inspector.debuggerEnabled) {
          await inspector.enableDebugger();
        }
        
        // Convert file path to a URL-like format that the debugger can understand
        // For local files, typically file:///path/to/file.js
        let fileUrl = file;
        if (!file.startsWith('file://') && !file.startsWith('http://') && !file.startsWith('https://')) {
          fileUrl = `file://${file.startsWith('/') ? '' : '/'}${file}`;
        }
        
        const response = await inspector.send('Debugger.setBreakpointByUrl', {
          lineNumber: line - 1, // Chrome DevTools Protocol uses 0-based line numbers
          urlRegex: fileUrl.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), // Escape special regex characters
          columnNumber: 0
        });
        
        // Store the breakpoint for future reference
        inspector.breakpoints.set(response.breakpointId, { file, line, id: response.breakpointId });
        
        return {
          content: [{
            type: "text",
            text: `Breakpoint set successfully. ID: ${response.breakpointId}`
          }]
        };
      } catch (err) {
        return {
          content: [{
            type: "text",
            text: `Error setting breakpoint: ${err.message}`
          }]
        };
      }
    }
  • Zod schema defining the input parameters: file (string) and line (number).
      file: z.string().describe("File path where to set breakpoint"),
      line: z.number().describe("Line number for breakpoint")
    },
  • Registers the set_breakpoint tool with the MCP server using server.tool(), providing name, description, input schema, and handler function.
    server.tool(
      "set_breakpoint",
      "Sets a breakpoint at specified line and file",
      {
        file: z.string().describe("File path where to set breakpoint"),
        line: z.number().describe("Line number for breakpoint")
      },
      async ({ file, line }) => {
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Sets a breakpoint' implies a write operation, it doesn't disclose critical behavioral traits such as whether this requires specific permissions, if the breakpoint persists across sessions, what happens on invalid inputs, or any rate limits. The description is minimal and lacks necessary context for safe use.

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 a single, efficient sentence with zero waste. It's front-loaded with the core action and appropriately sized for a simple tool, making it easy to parse quickly.

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 the complexity of a breakpoint-setting tool (a mutation with no annotations and no output schema), the description is incomplete. It doesn't explain the return value, error conditions, or behavioral implications, leaving significant gaps for an AI agent to understand how to use it correctly in context.

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?

The schema description coverage is 100%, with both parameters ('file' and 'line') well-documented in the schema. The description adds no additional meaning beyond what the schema provides (e.g., format examples or constraints), so it meets the baseline score of 3 for high schema coverage.

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 action ('Sets a breakpoint') and specifies the target ('at specified line and file'), which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'delete_breakpoint' or 'list_breakpoints', which would be needed for a perfect score.

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 description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an active debugging session), exclusions, or when to choose other breakpoint-related tools like 'delete_breakpoint' or 'list_breakpoints'.

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/workbackai/mcp-nodejs-debugger'

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