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
service_versionYesDeployed Calcgrid implementation version used for the result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / service_version
      Added value: +{
      +  "description": "Deployed Calcgrid implementation version used for the result.",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "success",
      -  "request",
      -  "result",
      -  "timestamp"
      -]New value: +[
      +  "success",
      +  "service_version",
      +  "request",
      +  "result",
      +  "timestamp"
      +]
  2. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "mode": "percent_of",
      +    "x": 15,
      +    "y": 240
      +  },
      +  {
      +    "mode": "is_what_percent",
      +    "x": 30,
      +    "y": 120
      +  }
      +]
  3. Added
  4. Removed
  5. First observed

TDQS

A5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the description's additional detail is genuinely additive. It discloses that the tool always returns part, whole, and percent, provides the exact formulas per mode, and gives a REST fallback path, going well beyond what annotations convey.

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 longer than average but every section earns its place: usage conditions, exclusions, computation summary, inputs, examples, outputs, formulas, REST fallback, and docs. It is front-loaded with the use case and uses clear section labels, making it easy for an agent to scan.

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 three-mode calculator with an output schema, the description is complete: it covers all modes, parameter semantics, formulas, example payloads, and even a fallback REST endpoint. An agent has everything needed to invoke it correctly without external inference.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds substantial meaning: it maps each mode to a formula, explains how x and y change roles per mode, and provides complete JSON examples. This clarifies parameter semantics far beyond the schema's property 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 names a specific verb ('calculate') and resource (percentage) and enumerates the three exact question types it solves. It also explicitly distinguishes itself from sibling tools like percentage-change, discount, and sales-tax, so an agent can select it without ambiguity.

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 'Use this when' conditions and an explicit 'Do not use this when' section naming the correct alternatives for percentage change, discounts, and tax. This is model guidance for when to invoke the tool versus a sibling.

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