Skip to main content
Glama
workbackai

MCP NodeJS Debugger

by workbackai

retry_connect

Manually reconnects to the Node.js debugger when the connection is lost or unstable, allowing debugging to resume without restarting the server.

Instructions

Manually triggers a reconnection attempt to the Node.js debugger

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNoOptional port to connect to. Defaults to current port (9229)

Implementation Reference

  • The handler function for the 'retry_connect' tool. It optionally updates the port, disconnects the current WebSocket if connected, resets the retry count, and initializes a new connection attempt to the Node.js debugger.
    async ({ port }) => {
      try {
        // If a new port is specified, update the inspector's port
        if (port && port !== inspector.port) {
          inspector.port = port;
        }
        
        // If already connected, disconnect first
        if (inspector.connected && inspector.ws) {
          inspector.ws.close();
          inspector.connected = false;
    inspector.debuggerEnabled = false;
        }
        
        // Reset retry count and initialize
        inspector.retryCount = 0;
        inspector.initialize();
        
        return {
          content: [{
            type: "text",
            text: `Attempting to connect to Node.js debugger on port ${inspector.port}...`
          }]
        };
      } catch (err) {
        return {
          content: [{
            type: "text",
            text: `Error initiating connection retry: ${err.message}`
          }]
        };
      }
    }
  • The input schema definition for the 'retry_connect' tool, specifying an optional 'port' parameter using Zod validation.
    {
      port: z.number().optional().describe("Optional port to connect to. Defaults to current port (9229)")
    },
  • The registration of the 'retry_connect' tool using server.tool(), including the tool name, description, input schema, and inline handler function.
    server.tool(
      "retry_connect",
      "Manually triggers a reconnection attempt to the Node.js debugger",
      {
        port: z.number().optional().describe("Optional port to connect to. Defaults to current port (9229)")
      },
      async ({ port }) => {
        try {
          // If a new port is specified, update the inspector's port
          if (port && port !== inspector.port) {
            inspector.port = port;
          }
          
          // If already connected, disconnect first
          if (inspector.connected && inspector.ws) {
            inspector.ws.close();
            inspector.connected = false;
    		inspector.debuggerEnabled = false;
          }
          
          // Reset retry count and initialize
          inspector.retryCount = 0;
          inspector.initialize();
          
          return {
            content: [{
              type: "text",
              text: `Attempting to connect to Node.js debugger on port ${inspector.port}...`
            }]
          };
        } catch (err) {
          return {
            content: [{
              type: "text",
              text: `Error initiating connection retry: ${err.message}`
            }]
          };
        }
      }
    );
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. It states the tool triggers a reconnection attempt but does not explain what happens during this process (e.g., whether it blocks, retries multiple times, or handles errors), the expected outcomes, or any side effects like interrupting debugger state.

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 that is front-loaded with the core action and target, with no wasted words or unnecessary elaboration.

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 lack of annotations and output schema, the description is incomplete for a tool that performs a potentially complex operation like reconnection. It does not cover behavioral aspects, error handling, or what constitutes success, leaving significant gaps for an AI agent to understand its use.

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 the parameter 'port' fully documented in the schema. The description does not add any additional meaning or context beyond what the schema provides, such as why one might specify a port or implications of using the default.

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 specific action ('manually triggers a reconnection attempt') and the target resource ('to the Node.js debugger'), distinguishing it from sibling tools like 'continue' or 'step_into' that handle execution flow rather than connection management.

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, such as whether it should be used after a disconnection error, during initialization, or as a fallback for other connection methods. It also lacks 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/workbackai/mcp-nodejs-debugger'

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