Skip to main content
Glama

evaluate

Evaluate expressions in Go debug sessions to inspect variables and test code behavior during debugging.

Instructions

Evaluate an expression in current scope

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesID of the debug session
exprYesExpression to evaluate

Implementation Reference

  • The core handler logic for the 'evaluate' tool. It extracts the expression from args, sends an 'Eval' command to the active Delve debug session, and returns the evaluated variable as JSON.
    case "evaluate": { const { expr } = args; const response = await sendDelveCommand(session, "Eval", { expr }); return { content: [{ type: "text", text: JSON.stringify(response.Variable, null, 2) }] }; }
  • src/server.ts:252-268 (registration)
    Registers the 'evaluate' tool in the ListToolsRequestHandler, providing its name, description, and input schema definition.
    name: "evaluate", description: "Evaluate an expression in current scope", inputSchema: { type: "object", properties: { sessionId: { type: "string", description: "ID of the debug session" }, expr: { type: "string", description: "Expression to evaluate" } }, required: ["sessionId", "expr"] } },
  • src/server.ts:411-412 (registration)
    In the CallToolRequestHandler, dispatches calls to the 'evaluate' tool to the handleControlCommands function in control.ts.
    if (["setBreakpoint", "removeBreakpoint", "continue", "next", "step", "stepout", "variables", "evaluate"].includes(name)) { return handleControlCommands(name, args);
  • Defines the input schema for the 'evaluate' tool, requiring sessionId and expr parameters.
    inputSchema: { type: "object", properties: { sessionId: { type: "string", description: "ID of the debug session" }, expr: { type: "string", description: "Expression to evaluate" } }, required: ["sessionId", "expr"] }

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