Skip to main content
Glama

variables

Retrieve and list local variables within the current scope of a Go program during debugging using Delve MCP. Input the debug session ID to analyze variable states efficiently.

Instructions

List local variables in current scope

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesID of the debug session

Implementation Reference

  • The core handler for the 'variables' tool. Sends 'ListLocalVars' command to the Delve debug session and returns the variables as formatted JSON text.
    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)
    Registers the 'variables' tool in the MCP server's tool list, including its name, description, and input schema.
    { name: "variables", description: "List local variables in current scope", inputSchema: { type: "object", properties: { sessionId: { type: "string", description: "ID of the debug session" } }, required: ["sessionId"] } },
  • Defines the input schema for the 'variables' tool, requiring a 'sessionId' string.
    inputSchema: { type: "object", properties: { sessionId: { type: "string", description: "ID of the debug session" } }, required: ["sessionId"] }
  • Routing logic in the main CallToolRequest handler that dispatches 'variables' (and other control commands) to the control handler module.
    if (["setBreakpoint", "removeBreakpoint", "continue", "next", "step", "stepout", "variables", "evaluate"].includes(name)) { return handleControlCommands(name, args); }

Other Tools

Related 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