Skip to main content
Glama

Percent Change

percent_change
Read-onlyIdempotent

Compute the exact percent change from a starting to an ending value, returning decimal, direction, and multiplier while correctly handling negative bases.

Instructions

Exact percent change from FROM_VALUE to TO_VALUE. Use percentage, not this, for PART / TOTAL rather than a before/after change.

(to_value - from_value) / abs(from_value) * 100 — the conventional finance definition, relative to the MAGNITUDE of the base so a negative from_value does not flip the sign (see note when it applies). Refuses from_value=0 (undefined) rather than returning infinity — report the absolute change instead. Returns percent_exact (exact rational), percent_decimal (rounded), absolute_change, direction ("increase"/"decrease"/"unchanged"), and multiplier (to_value / from_value, exact).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
to_valueYesEnding value: a number or exact rational (e.g. '3/4', '1e3'), not an expression like '2*3'; no '_' digit separators
from_valueYesStarting value: a number or exact rational (e.g. '3/4', '1e3'), not an expression like '2*3'; no '_' digit separators; must not be zero

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.13.0

TDQS

A4.7/5.0
Behavior4/5

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

Beyond the annotations (readOnly, idempotent, non-destructive), the description reveals important behaviors: the sign-handling convention for negative bases, refusal on zero base, and exact/rational return semantics. The only minor gap is the dangling reference to a `note` field whose content isn't explained.

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 dense but every sentence earns its place: primary purpose, sibling disambiguation, formula, edge-case handling, and return fields. The critical usage constraint is front-loaded.

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 tool's moderate complexity, the description fully covers the formula, edge cases, return values, and the key alternative tool. An output schema exists for return details, and the input schema already documents parameter formats, so nothing essential is missing.

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 coverage is 100%, so the baseline is 3. The description adds genuine value by clarifying the directional roles—`from_value` is the base in the denominator, `to_value` is the comparison target—and by giving the exact formula that determines how the two parameters interact.

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 states a specific operation—computing exact percent change between two values—and immediately distinguishes it from the sibling `percentage` tool. The explicit formula and output field list leave no ambiguity about what the tool does.

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?

It explicitly says to use `percentage` instead for PART/TOTAL situations, providing a clear decision rule. It also specifies what to do when `from_value=0`: refuse and report absolute change, rather than returning infinity.

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