Skip to main content
Glama

Calculate a percentage

calculate_percentage
Read-onlyIdempotent

Calculate percent of a value, what percent one number is of another, percent change, the reverse, an increase or decrease, and margin versus markup.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "a": "<a>",
      "b": "<b>"
    },
    "name": "calculate_percentage"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYesFirst value. For of and increase, this is the percent.
bYesSecond value. For of and increase, this is the amount.
modeNoof, is, change, reverse, increase, decrease, or margin.of

Output Schema

NameRequiredDescriptionDefault
unitYes
partsYes
resultYes
formulaYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A3.6/5.0
Behavior3/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 and the description owes less. The description adds nothing about precision/rounding, how negative values or division-by-zero are handled, or how the 'reverse' mode differs from 'is'. It is consistent with the annotations (a pure calculation), just not informative beyond them.

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?

A single front-loaded sentence with no filler, listing the supported operations in a compact series. Nothing would be lost by keeping it as is and nothing extraneous is present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple three-parameter calculator with full schema coverage, an existing output schema and safety annotations, the description covers the essential operation set. The gaps are rounding/precision conventions and the ambiguous 'markup' wording, but neither prevents a reasonable invocation.

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%, so the schema already explains a and b, including the 'for of and increase, a is the percent' mapping, and the mode enum. The description's only additive content is the phrase 'margin versus markup', which is slightly hazardous because the enum contains 'margin' but no 'markup' value, so an agent could attempt an invalid mode. That nets out to baseline rather than above it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 enumerates the concrete sub-operations: percent-of, percent-is, percent change, reverse, increase/decrease, and margin. An agent immediately knows this is a general arithmetic helper, clearly distinct from siblings like calculate_emi or calculate_cidr. It stops short of 5 only because it doesn't explicitly frame the tool's scope boundary against any other calculator.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the mode list suggests which operation to pick for a given question, but nothing tells the agent when to choose 'change' over 'reverse', or when margin applies versus a simple percentage. There are no worked examples mapping a real question to a mode value, and no exclusions. Adequate but leaves the mode-selection reasoning entirely to the caller.

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.