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); }

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