Skip to main content
Glama

calculate_margin

Compute margin amount, margin percentage, and break-even ad-spend band using cost, retail price, ad spend, and VAT rate. A pure math utility with no external dependencies.

Instructions

Pure math utility: given cost, retail, ad spend, and VAT rate, return margin amount, margin %, and break-even ad-spend band. Makes zero API calls. Do NOT use when the user wants a real product evaluation (use evaluate_product) or to find products (use search_products). No auth required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
costYesProduct cost in EUR
retail_priceYesRetail price in EUR
ad_spendNoAd spend per unit in EUR
vat_rateNoVAT rate as decimal
Behavior5/5

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

Discloses that the tool makes zero API calls and requires no authentication, beyond the actions already implied by the description. Since no annotations are provided, the description fully covers behavioral expectations.

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?

Two concise sentences with no redundant information. The first sentence explains the tool's purpose and inputs/outputs; the second provides usage guidance. Every word earns its place.

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?

Despite no output schema or annotations, the description fully explains the tool's behavior (pure math, no API calls, no auth), its inputs, outputs (margin amount, %, break-even band), and when to avoid it. Complete for a simple utility.

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?

Input schema has 100% coverage for parameter descriptions. The description adds value by contextualizing the parameters (cost, retail, ad spend, VAT rate) into the margin calculation and previews outputs, though it does not significantly extend beyond the schema.

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?

Clearly states it is a 'Pure math utility' that calculates margin metrics from given inputs, and explicitly distinguishes itself from sibling tools by noting it makes zero API calls and is not for product evaluation or search.

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?

Explicitly says when NOT to use it, providing alternatives (evaluate_product, search_products) and emphasizing it is a pure math utility with no API calls, guiding appropriate usage.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Hertwill/hw-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server