Skip to main content
Glama

evaluate

Evaluate a Go expression within an active debug session to inspect variables and test code logic.

Instructions

Evaluate an expression in current scope

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesID of the debug session
exprYesExpression to evaluate

Implementation Reference

  • The handler function that executes the 'evaluate' tool. It extracts the 'expr' argument, sends an 'Eval' command to the Delve debugger via sendDelveCommand, and returns the result 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:251-268 (registration)
    Registration of the 'evaluate' tool in the ListToolsRequestSchema handler. Defines the tool's name, description, and input schema requiring 'sessionId' (string) and 'expr' (string).
    {
      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-413 (registration)
    The CallToolRequestSchema handler that routes the 'evaluate' tool name to handleControlCommands.
    if (["setBreakpoint", "removeBreakpoint", "continue", "next", "step", "stepout", "variables", "evaluate"].includes(name)) {
      return handleControlCommands(name, args);
    }
  • The sendDelveCommand helper used by the evaluate handler to send the 'Eval' API command to the Delve debugger via HTTP POST.
    export async function sendDelveCommand(session: DebugSession, command: string, args: any = {}): Promise<any> {
      const { stdout } = await exec(`curl -s -X POST http://localhost:${session.port}/api/v2/${command} -d '${JSON.stringify(args)}'`);
      return JSON.parse(stdout);
    }
Behavior2/5

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

No annotations are provided, and the description is minimal. It implies evaluation but does not disclose side effects, scope context, or whether it is read-only. The agent is left to infer behavior from the name alone.

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, clear sentence with no wasted information. It front-loads the core purpose efficiently.

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?

Given no output schema and the simplicity of the tool, the description could be more complete by indicating what the tool returns (e.g., evaluated value, errors) and any constraints (e.g., expression language). It omits critical contextual information for an AI agent to use it effectively.

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%, so the schema already documents both parameters. The description does not add any additional meaning beyond what is in the schema, meeting the baseline expectation.

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 'evaluate' and the resource 'expression in current scope', distinguishing it from sibling tools like 'exec' or 'variables' by focusing on expression evaluation.

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?

No guidance on when to use this tool versus alternatives such as 'exec' or 'variables'. The description does not provide context for its typical use case within a debug session.

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