Skip to main content
Glama

Percentage calculator

calc_percentage
Read-onlyIdempotent

Calculate percentage answers—X% of Y, what percent, percent change, increase/decrease, reverse original value, and profit margin vs markup—with the number, display string, and worked formula.

Instructions

Every percentage question the website answers: "X% of Y" (percent_of: percent, value), "X is what % of Y" (what_percent: part, whole), percent change from A to B (change: from, to), increase/decrease a value by X% (increase/decrease: value, percent), find the original before a X% increase/decrease (reverse_increase/reverse_decrease: value, percent), and profit margin vs markup (margin_markup: cost, price). Returns the number, a display string and the worked formula. Web version: https://s3eidat.github.io/percentage-calc/

Input Schema

NameRequiredDescriptionDefault
toNochange: the new value.
costNomargin_markup: cost price.
fromNochange: the old value.
modeYesWhich question to answer (see the description for the fields each one uses).
partNowhat_percent: the part X in "X is what % of Y".
priceNomargin_markup: selling price.
valueNoThe value Y (percent_of: Y in "X% of Y"; increase/decrease: the starting value; reverse_*: the final value).
wholeNowhat_percent: the whole Y.
percentNoThe percentage X (percent_of, increase, decrease, reverse_*).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, so the safety profile is covered. The description adds the otherwise-undocumented return contract (number, display string, worked formula) and a reference URL, which is real value since no output schema exists, though it says nothing about error handling for missing per-mode fields.

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?

A single dense sentence front-loads the scope and then walks the modes in order; almost every clause earns its place. The trailing web URL is mildly incidental and the sentence is long, but nothing is padded or repetitive.

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?

For a 9-parameter, mode-driven calculator with no output schema, the description supplies the complete mode→field matrix plus the return shape. An agent has everything needed to construct a valid call for any mode.

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 description coverage is 100% and every property already states which mode it belongs to, so the description's per-mode field mapping largely restates structured data. Baseline 3 applies; it adds readability but no semantics absent from 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?

The description opens with a specific verb+resource ("Every percentage question the website answers") and then enumerates all eight calculation modes. An agent can tell instantly that this is a pure arithmetic helper, distinct from calc_expression or calc_discount, without opening the schema.

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 gives explicit routing rules: each mode is quoted with its natural-language question form and the exact field combination it consumes ("X% of Y" → percent_of: percent, value). Choosing the right mode and inputs is fully determined by the description text.

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

Deploy Server

Other Tools