Skip to main content
Glama

Margin Calculator

margin_calculator
Read-onlyIdempotent

Calculate cost, selling price, gross profit, margin percentage and markup percentage from two independent values including cost or price.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
costNoCost per item (USD; at most two decimal places)
priceNoSelling price per item (USD; at most two decimal places)
marginPercentNoGross margin as percent of selling price
markupPercentNoMarkup as percent of cost

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds real behavioral context beyond that: it computes a set of derived metrics from any valid pair of inputs, which tells the agent how dynamic the tool is. It does not describe validation/lookup failures, but the schema's oneOf enforces input combinations.

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 that states the action, the outputs, and the input pattern with no filler. Nothing is wasted and the key information comes first.

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?

An output schema exists, so return values needn't be explained, and annotations cover the safety profile. The description is sufficient for an agent to invoke the tool correctly, though it could say a word about which input combinations are valid (the oneOf constraint) rather than leaving that entirely to the schema.

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 each parameter is documented with bounds and units (USD, percent-of-price vs percent-of-cost), so the schema carries the semantic load. The description reinforces the cost/price pairing and the output set but adds no syntax or format detail beyond the schema; baseline 3 is appropriate.

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 outputs (cost, selling price, gross profit, margin %, markup %), and states the input pattern ('from two independent values including cost or price'). It is clearly distinguishable from sibling calculators like discount_calculator or percentage_calculator, though it doesn't name an alternative explicitly.

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?

The phrase 'from two independent values including cost or price' implies the usage pattern (supply any valid pair), but there is no explicit when-to-use or when-not-to-use guidance versus siblings like roi, unit_price, or discount_calculator. Usage is inferable but not stated.

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