Skip to main content
Glama

terse_eval

Evaluate Terse source code with a tree-walking interpreter to get JSON-safe results and captured print output, expanding session aliases before execution.

Instructions

Evaluate Terse source with the tree-walking interpreter. Returns the result value (JSON-safe) and captured print output lines. Session $aliases (see terse_alias_define) are expanded before evaluation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gasNoEvaluation gas limit (default 100000).
sourceYesTerse source code to evaluate.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses the return shape (JSON-safe result plus captured print output) and that session $aliases are expanded before evaluation, but it is silent on what happens when the gas limit is exhausted, whether evaluation is isolated/side-effect free, and how errors surface. That is meaningful disclosure but incomplete for an execution tool.

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?

Three tight sentences, front-loaded with the core action, then return shape, then the alias caveat. No filler and each sentence adds distinct information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description correctly compensates by describing the return value and print output lines. With no annotations, it partially covers behavior via alias expansion, but omits gas-exhaustion and error semantics. Complete enough for a simple eval tool, though not fully self-sufficient.

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 coverage is 100% and the schema already documents both 'source' and the 'gas' limit with its default and minimum, so the baseline is 3. The note that session $aliases are expanded before evaluation adds a genuine behavioral nuance about how 'source' is interpreted, but it is the only addition and gas behavior is left entirely to the schema.

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

Purpose5/5

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

States a specific verb and resource ('Evaluate Terse source') and names the mechanism ('tree-walking interpreter'), which distinguishes it from sibling tools like terse_parse, terse_transpile, and terse_tokens that operate on source without executing it. An agent can tell this is the execution tool without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the verb 'evaluate' and reinforced by the reference to terse_alias_define for alias behavior, which tells the agent this tool consumes aliases set up elsewhere. However, there is no explicit when-to-use guidance against terse_parse/terse_transpile or any statement of prerequisites, so the agent must infer the selection logic.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.