Skip to main content
Glama

Calculate cost per active gram

calculate_active_cost
Read-onlyIdempotent

Compare assay-based ingredient costs. Price is per kg; assay is percent (0 < assay <= 100); targetActiveMg is desired active mass per serving. This is formulation arithmetic, not dosage advice.

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": {
      "pricePerKg": "<pricePerKg>",
      "assayPercent": "<assayPercent>",
      "targetActiveMg": "<targetActiveMg>"
    },
    "name": "calculate_active_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
currencyNoUSD
pricePerKgYes
assayPercentYes
targetActiveMgYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world behavior, so the safety profile is fully covered. The description adds useful unit conventions (price per kg, assay as percent) and a scope disclaimer, but omits what the result represents and how currency conversion is handled.

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?

Three compact sentences with no filler, and the core domain statement is front-loaded. It is terse rather than padded; the only weakness is that brevity leaves the computed output unstated.

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

Completeness3/5

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

For a four-parameter calculation tool with no output schema, the description should state the units and meaning of the result; it does not. Parameter units are well covered, but the missing result semantics and the undocumented currency parameter leave real gaps.

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?

Schema description coverage is 0%, so the description must carry the parameter burden; it defines units and valid ranges for pricePerKg, assayPercent, and targetActiveMg, including the 0 < assay <= 100 constraint that mirrors the schema. Only the optional currency parameter (default USD, ISO-4217 pattern) goes unmentioned.

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

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Compare assay-based ingredient costs" implies a calculation over price and assay, but the description never states what is actually computed (cost per active gram vs. total cost for the target mass). The title carries that information, not the description, and no sibling such as calculate_landed_cost is named to sharpen the distinction.

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 closing line "This is formulation arithmetic, not dosage advice" sets a scope exclusion but gives no positive when-to-use guidance and no comparison to the closely related calculate_landed_cost sibling. An agent must infer the choice from the sibling's name alone.

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.