Skip to main content
Glama
laszlopere

mcp-abacus

analyze

Evaluate an expression and display its full parse tree with each sub-result's value, pinpointing where rounding or precision loss occurs.

Instructions

Evaluate an expression and return its AST as an indented tree of sub-results.

Same arguments and evaluation as calculatemode (fixed-point default, floating-point, rational) and min_fixed_point_precision behave identically — but instead of one final value this returns the WHOLE parse tree, each node annotated with the Value it computed in that mode. Reach for it to see WHERE a surprising answer comes from: which sub-expression rounded, overflowed, or lost precision, rather than only the rounded result.

tree is a multi-line string, one node per line, indented by depth (root last- applied operator at the top, literals at the leaves). Each line is <OPCODE/LITERAL "lexeme"> Value = <value> (<type>[<scale>], <exact|inexact>) followed by ·-separated per-mode details: the value in hex (fixed-point as M@D with whole-byte digits, @<scale> dropped at scale 0; float as raw IEEE-754 bits), or a rational's decimal approximation. The <scale> is the fixed-point decimal scale (omitted for modes without one). For example (1 + 1/2) * 3 in fixed-point:

BINARY_MUL Value = 3 (fixed-point[0], inexact) · hex 0x03
  BINARY_ADD Value = 1 (fixed-point[0], inexact) · hex 0x01
    LITERAL "1" Value = 1 (fixed-point[0], exact) · hex 0x01
    BINARY_DIV Value = 0 (fixed-point[0], inexact) · hex 0x00
      LITERAL "1" Value = 1 (fixed-point[0], exact) · hex 0x01
      LITERAL "2" Value = 2 (fixed-point[0], exact) · hex 0x02
  LITERAL "3" Value = 3 (fixed-point[0], exact) · hex 0x03

— the 1/2 = 0 leaf (inexact, scale 0) makes plain that fixed-point rounded the half away, so the product is 3, not 4.5, and every node above it inherits the inexactness. (Raise min_fixed_point_precision, or use a different mode, to keep those digits.)

On success tree is the rendering and error is null; on a bad mode, an invalid min_fixed_point_precision, or a malformed/erroring expression, tree is null and error carries the message (the same messages calculate returns).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes
modeNofixed-point
min_fixed_point_precisionNo
Behavior5/5

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

With no annotations, the description provides full behavioral details: output format with example, error conditions, parameter behavior identical to calculate, and mode effects.

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?

Well-structured, front-loaded, and every sentence adds value. Includes example and error handling without unnecessary fluff.

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

Completeness5/5

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

Complete for a tool with 3 parameters and no output schema: covers output format, error handling, parameter details, and usage context with a concrete example.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema description coverage, the description explains all three parameters (expression, mode, min_fixed_point_precision) with defaults and behavior, compensating fully.

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?

The description clearly states it evaluates an expression and returns its AST as an indented tree, distinguishing it from the sibling tool 'calculate' which returns a single value.

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

Usage Guidelines5/5

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

Explicitly says 'Reach for it to see WHERE a surprising answer comes from' and compares with calculate, telling when to use this tool over alternatives.

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/laszlopere/mcp-abacus'

If you have feedback or need assistance with the MCP directory API, please join our Discord server