Skip to main content
Glama

attach

Connect to a running Go process by specifying its Process ID to enable debugging operations through the Delve debugger interface.

Instructions

Attach to a running process

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYesProcess ID to attach to

Implementation Reference

  • The core handler logic for the 'attach' tool. It validates the 'pid' argument, calls startDebugSession to attach to the process, and returns a confirmation message with the session ID.
    case "attach": {
      const pid = Number(args?.pid);
      if (!pid) {
        throw new Error("Process ID is required");
      }
    
      const session = await startDebugSession("attach", pid.toString());
      return {
        content: [{
          type: "text",
          text: `Attached to process ${pid} with session ${session.id}`
        }]
      };
    }
  • src/server.ts:86-98 (registration)
    Tool registration entry for 'attach', defining the tool name, description, and input schema (requiring a numeric 'pid').
      name: "attach",
      description: "Attach to a running process",
      inputSchema: {
        type: "object",
        properties: {
          pid: {
            type: "number",
            description: "Process ID to attach to"
          }
        },
        required: ["pid"]
      }
    },
  • src/server.ts:406-408 (registration)
    Routing logic in the main request handler that dispatches 'attach' tool calls to handleDebugCommands in debug.ts.
    if (["debug", "attach", "exec", "test", "core", "dap", "replay", "trace"].includes(name)) {
      return handleDebugCommands(name, args);
    }
  • Type definition for DebugSession 'type' field that includes 'attach' as a valid mode.
    type: string; // 'debug' | 'attach' | 'exec' | 'test' | 'core' | 'replay' | 'trace' | 'dap'
    target: string;
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Attach to a running process' implies this is a mutation operation that likely requires specific permissions and may affect process execution, but the description doesn't disclose what 'attach' actually does behaviorally (e.g., pauses execution, enables debugging, requires elevated privileges). It provides minimal context beyond the basic action.

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 extremely concise at just 5 words, front-loading the essential action and target. Every word earns its place with zero waste or redundancy. The structure efficiently communicates the core purpose without 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?

For a tool that likely performs a sensitive operation (attaching to running processes) with no annotations and no output schema, the description is inadequate. It doesn't explain what 'attach' means in this context, what the tool actually does to the process, what permissions are required, or what the expected outcome is. The minimal description leaves too many open questions for a potentially complex operation.

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% with the single 'pid' parameter fully documented in the schema. The description doesn't add any parameter semantics beyond what the schema provides (e.g., doesn't explain what types of processes can be attached to, what happens if the PID doesn't exist, or format requirements). Baseline 3 is appropriate when 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 action ('Attach') and target ('to a running process'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from sibling tools like 'debug', 'trace', or 'replay' which might also involve process interaction in debugging contexts.

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. With sibling tools like 'debug', 'trace', and 'replay' available, there's no indication whether 'attach' is for initial debugging setup, ongoing monitoring, or a specific debugging phase. No prerequisites or exclusions are mentioned.

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/dwisiswant0/delve-mcp'

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