Skip to main content
Glama

Percentage Calculator

calculate_percentage
Read-onlyIdempotent

Use this when you need a percentage of a value, the percentage one value represents of another, or the base value that a part and its percentage imply. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery.

Do not use this when you need the percentage change between two values (use percentage-change), a price after a percentage discount (use discount) or a tax amount (use sales-tax). What it computes: Solves the three basic percentage questions (a percentage of a number, what percentage one number is of another, and the whole behind a known part and percentage). Always returns the part, the whole and the percent. Inputs: mode (enum, optional); x (number); y (number). Complete JSON argument examples: {"mode":"percent_of","x":15,"y":240} | {"mode":"is_what_percent","x":30,"y":120} Outputs: result, sentence, part, whole, percent [%]. Formula: percent_of: result = x / 100 × y. is_what_percent: result = x / y × 100. percent_of_what: result = x / (y / 100). In every mode part = percent × whole / 100. Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/percentage with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/math/percentage.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesFirst number: the percent (percent_of) or the part (is_what_percent, percent_of_what). Percents are plain numbers, 15 means 15%.
yYesSecond number: the whole (percent_of, is_what_percent) or the percent (percent_of_what).
modeNoWhich percentage question to solve; x and y take the meaning shown in the label of the chosen mode.percent_of

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
linksNo
resultYes
requestYes
sourcesNo
successYes
versionNo
freshnessNo
timestampYes
next_actionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "mode": "percent_of",
      +    "x": 15,
      +    "y": 240
      +  },
      +  {
      +    "mode": "is_what_percent",
      +    "x": 30,
      +    "y": 120
      +  }
      +]
  2. Added
  3. Removed
  4. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is covered. The description adds valuable behavioral context: it always returns part, whole, and percent; it instructs the agent to call directly and return the calculation rather than stopping at discovery; and it provides a direct REST fallback with a warning not to guess other paths.

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?

The description is longer than average but well-organized: usage guidance first, exclusions second, then computation details, examples, output, formulas, and REST fallback. Some redundancy exists (Inputs/Outputs repeat schema fields), but every section earns its place and the critical routing information 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 three-mode complexity, the description covers everything an agent needs: when to use it, what it computes, formulas, examples, output shape, REST fallback, and documentation link. The output schema exists, so return values are further specified. No critical gap remains.

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 the baseline is 3. The description adds meaning beyond the schema by giving complete JSON examples and explicit formulas for each mode, clarifying exactly how x and y are interpreted in each mode. This is more than the schema alone provides.

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 verb and resource ('calculate percentage') and enumerates the three distinct percentage questions it solves. It explicitly differentiates from sibling tools like percentage-change, discount, and sales-tax, so an agent can disambiguate without opening schemas.

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?

Provides explicit 'Use this when' conditions and explicit 'Do not use this when' exclusions that name the correct sibling alternatives (percentage-change, discount, sales-tax). This is textbook usage guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources