Skip to main content
Glama
laszlopere

mcp-abacus

analyze

Trace any calculation step by step. See each sub-expression's value, precision, and rounding to pinpoint why a result is unexpected.

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. For just the final value use calculate; to find the variable value(s) that drive an expression to a root or extremum, use solver.

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). A fixed-point node that ROUNDED its result also carries a final · rounding <residual> ≈ <approx> fragment: the exact signed residual stored − true (a fraction, bounded by half a unit in the last place) and its decimal approximation. It is named rounding, NOT error, on purpose — the reply's top-level error field is the failure channel, so a rounding label keeps "this node rounded" from being misread as "this node failed". 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 · rounding -1/2 ≈ -0.5
      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 (its rounding -1/2 is the exact half discarded), so the product is 3, not 4.5, and every node above it inherits the inexactness. Those ancestors show no rounding fragment: they introduced no rounding of their own, only carried the leaf's. (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
modeNoNumeric type to evaluate in: 'fixed-point' (default), 'floating-point', or 'rational' — as in `calculate`.fixed-point
expressionYesThe expression or newline-separated program to parse and evaluate; same grammar as `calculate`.
min_fixed_point_precisionNoFloor on fixed-point fractional digits (non-negative integer); fixed-point mode only, null for no floor — as in `calculate`.
Behavior5/5

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

No annotations are provided, so the description bears full burden. It thoroughly describes the output format (tree, each node with opcode, value, type, exactness, rounding details), error handling (null tree with error message on failure), and the naming choice 'rounding' to avoid confusion with the error field. This is highly transparent.

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 long but well-structured: it starts with a clear purpose, then explains output format with an example, and ends with error handling. Every sentence adds necessary information for a complex tool, with no redundancy.

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?

Given the high complexity (AST output, multiple modes, rounding details) and absence of output schema or annotations, the description is remarkably complete. It covers output format, error cases, example, and ties to sibling tools, leaving no significant gaps.

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

Parameters4/5

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

Schema description coverage is 100%, so baseline is 3. The description adds value by explaining that 'mode' and 'min_fixed_point_precision' behave identically to 'calculate', providing context beyond the schema's parameter descriptions.

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 the tool evaluates an expression and returns its AST as an indented tree of sub-results. It distinguishes from siblings 'calculate' and 'solver' by specifying that this tool is for understanding where surprising answers come from, not just final values.

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 contrasts with 'calculate' (for final value) and 'solver' (for variable values driving to root/extremum). Also notes same arguments and evaluation as 'calculate', providing clear guidance on when to use this tool versus 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