Skip to main content
Glama

variables

List local variables in the current scope during Go program debugging to inspect program state and identify issues.

Instructions

List local variables in current scope

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesID of the debug session

Implementation Reference

  • The core handler logic for the 'variables' tool. It sends a 'ListLocalVars' command to the Delve debugger session and returns the local variables as a formatted JSON string.
    case "variables": {
      const response = await sendDelveCommand(session, "ListLocalVars", {});
      return {
        content: [{
          type: "text",
          text: JSON.stringify(response.Variables, null, 2)
        }]
      };
    }
  • src/server.ts:237-250 (registration)
    Registration of the 'variables' tool in the MCP server's tool list, including name, description, and input schema requiring a sessionId.
    {
      name: "variables",
      description: "List local variables in current scope",
      inputSchema: {
        type: "object",
        properties: {
          sessionId: {
            type: "string",
            description: "ID of the debug session"
          }
        },
        required: ["sessionId"]
      }
    },
  • src/server.ts:410-413 (registration)
    Dispatch/registration routing for control commands including 'variables', which delegates to handleControlCommands.
    // Control commands
    if (["setBreakpoint", "removeBreakpoint", "continue", "next", "step", "stepout", "variables", "evaluate"].includes(name)) {
      return handleControlCommands(name, args);
    }
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. It states the tool lists variables but doesn't mention whether this is a read-only operation, what format the output takes, whether it requires specific debug session states, or any limitations like pagination or scope depth. This leaves significant behavioral gaps for a debugging tool.

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 states the tool's purpose without unnecessary words. It's front-loaded with the core functionality and contains zero redundant information, making it optimally concise for its purpose.

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 debugging tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'current scope' means operationally, what the output format looks like, or how this tool integrates with the debugging workflow alongside siblings like 'evaluate' or 'step'. The agent would need to guess important contextual details.

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 input schema has 100% description coverage, with the single parameter 'sessionId' clearly documented. The description doesn't add any parameter-specific information beyond what the schema provides, which is acceptable given the high schema coverage. The baseline score of 3 reflects adequate but minimal value addition.

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 verb ('List') and resource ('local variables in current scope'), making the tool's function immediately understandable. However, it doesn't differentiate from potential sibling tools that might also list variables in different contexts or scopes, which prevents 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 like 'evaluate' or other debugging tools in the sibling list. There's no mention of prerequisites, context requirements, or exclusions, leaving the agent to infer usage from the tool name alone.

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