Skip to main content
Glama

Calculate freight margin

calculate_margin
Read-onlyIdempotent

Margin on a load from the buy rate (carrier cost) and sell rate (what the shipper pays): margin in dollars and percent of sell, the per-mile spread when miles are given, and the sell price needed to hit a target margin. Pure arithmetic; does not count toward the allowance.

Input Schema

NameRequiredDescriptionDefault
buyYesCarrier cost (buy rate) for the load, all-in, in dollars.
sellYesShipper price (sell rate) for the load, all-in, in dollars.
milesYesLoaded miles, or null.
target_margin_pctYesTarget margin as a percent of sell, e.g. 15, or null.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations declare readOnly/idempotent/non-destructive, and the description adds that it is pure arithmetic with no side effects and does not consume an allowance, which is genuinely useful beyond the annotations (the allowance detail is not in structured fields). Return values are described for a tool with no output schema.

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 tight sentence covering inputs, all outputs, and the non-billable note. Front-loaded with the core calculation and no wasted phrasing.

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?

With annotations covering the safety profile, full schema coverage, and the description covering return values and cost implications despite no output schema, an agent has everything needed to call it correctly. The allowance note is a meaningful bonus.

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% and each parameter is documented in the schema, so the schema already carries the semantics. The description maps buy to carrier cost and sell to shipper price, reinforcing the schema, but adds no format or edge-case detail beyond it.

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?

States a specific verb (calculate) and resource (freight margin) with full precision on inputs (buy rate, sell rate) and outputs (margin dollars/percent, per-mile spread, target sell price). No sibling tool name overlaps, so the domain distinction is unambiguous.

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

Usage Guidelines4/5

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

The description frames the calculation context clearly and notes it is pure arithmetic that does not count toward the allowance, which signals when it is cheap to call. It doesn't name an alternative sibling like estimate_truckload_rate, but the input/output contract is specific enough that selection is clear.

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