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"]
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'evaluate' and 'current scope', but doesn't explain what happens during evaluation (e.g., side effects, error handling, or output format). This is inadequate for a tool that likely interacts with a debugger, leaving key behavioral traits unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words, making it front-loaded and easy to parse. However, it's slightly under-specified given the tool's complexity, as it could benefit from more detail without sacrificing conciseness.

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 the tool's complexity (likely involving debug sessions and expression evaluation), no annotations, and no output schema, the description is incomplete. It fails to explain the evaluation behavior, return values, or how it fits into the debugging workflow, leaving significant gaps for an AI agent.

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, clearly documenting both 'sessionId' and 'expr' parameters. The description adds no additional meaning beyond what the schema provides, such as examples or constraints, so it meets the baseline score of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Evaluate an expression in current scope' states a clear verb ('evaluate') and resource ('expression'), but it's vague about what 'current scope' means and doesn't distinguish this tool from potential siblings like 'exec' or 'debug'. It provides a basic purpose but lacks specificity about the debugging context.

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 offers no guidance on when to use this tool versus alternatives like 'exec' or 'debug' from the sibling list. It implies usage in a debugging session due to the 'sessionId' parameter, but there's no explicit context, exclusions, or prerequisites mentioned.

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