Skip to main content
Glama

calculate_margin

Gross margin AND markup for the same deal, plus reverse pricing from a target margin or markup and the real margin cost of a discount.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
costYesUnit cost (what you paid)
priceNoSelling price — omit if you are solving from a target
marginPctNoTarget gross margin % — solve for price
markupPctNoTarget markup % — solve for price
discountPctNoDiscount to test against the resulting price

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It fails to state that the operation is read-only (a pure calculation), describe the output format (e.g., whether it returns both margin and markup in a single object), or address edge cases like conflicting inputs (e.g., both price and marginPct provided). The description only lists capabilities, not behavioral constraints or side effects.

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 a single sentence that is reasonably concise but slightly run-on, listing three related capabilities without clear separation. It front-loads the core function (gross margin and markup) but could be structured with bullet points or semicolons for readability. It does not waste words, so it earns a 4.

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

Completeness2/5

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

With no output schema and no annotations, the description must explain what the tool returns and how to use its modes. It fails to specify the output structure (e.g., a result object containing margin, markup, and discount impact), nor does it clarify which parameters to provide for direct versus reverse calculations. The schema hints at these patterns but the description does not synthesize them, leaving an agent without a complete picture.

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 coverage is 100% with clear per-parameter descriptions (e.g., 'omit if you are solving from a target'). The tool description does not add semantic detail beyond what the schema already provides; it only summarizes the overall purpose. Per the rubric, a baseline of 3 is appropriate when the schema fully documents parameters, and the description adds no extra value here.

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 clearly states the tool's function: it computes gross margin and markup, supports reverse pricing from a target, and evaluates discount impact. It explicitly names the resource ('the same deal') and distinguishes itself from the many sibling calculators by focusing on margin/markup rather than taxes, loans, or break-even. No ambiguity about what it does.

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

Usage Guidelines2/5

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

The description offers no guidance on when to use this tool versus alternatives. It does not mention any prerequisites, exclusions, or conditions that would steer an agent to choose it over, say, calculate_break_even or calculate_freelancer_pricing. The phrase 'for the same deal' is too vague to constitute usage direction.

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