Skip to main content
Glama

Cost Estimate

cost_estimate
Read-only

Calculates per-unit manufacturing cost from volume, material, process, quantity, and optional machine-time or tolerance inputs, separating material, process, and tooling costs.

Instructions

Per-unit cost rollup (Design for Cost). material_cost = volume·density·price ·(1+scrap) from the Materials DB (process: cnc | fdm | casting | injection). process_cost = amortized setup + per-process machine time; tooling amortized over quantity, so unit_cost falls as quantity rises. The machine-time table is order-of-magnitude (fidelity='correlation', band_pct=100) — trust the ratios between processes/quantities, not the absolute dollars; material_cost alone is exact given its inputs.

material may be any Materials-DB card name (material_list / material_get), or anything at all if you price it yourself: price_usd_kg and density_kg_m3 override the DB lookup and are flagged in breakdown.price_basis / density_basis as 'explicit' instead of 'material'. A generic word like 'aluminum' is a CATEGORY, not a card — it carries a density but no price, so it needs price_usd_kg or a real card name (AL6061-T6, …); the error says which.

Two optional inputs sharpen it. tolerance_class ('IT7', '9', …) scales the TABLE machine time by the tolerance-cost curve (see tolerance_cost_check): holding tighter than the process's natural capability roughly doubles cost every 1.5 IT grades. machine_time_hr REPLACES the table with a time a real model computed (cnc_time_estimate) and drops band_pct from 100 to that model's band (50 by default, or machine_time_band_pct); the tolerance factor is then not applied again, because cnc_time_estimate already applied the same curve. Both default to None, reproducing the pre-existing behaviour exactly.

Returns {material_cost, process_cost, tooling_amortized, unit_cost, mass_kg, fidelity, band_pct, breakdown:{…, density_kg_m3, price_usd_kg, density_basis, price_basis, machine_time_hr, machine_time_basis, base_machine_time_hr, tolerance_class, tolerance_factor, tolerance_applied, tolerance_basis}}. Errors on a material with no usable density/price and no override, an unknown process/tolerance class, or a non-positive volume/quantity/machine time.

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": {
      "volume_mm3": "<volume_mm3>",
      "material": "<material>"
    },
    "name": "cost_estimate"
  }
}

Input Schema

NameRequiredDescriptionDefault
processNocnc
materialYes
quantityNo
setup_minNo
workspaceNoRun this call in this named workspace
volume_mm3Yes
tooling_usdNo
price_usd_kgNo
density_kg_m3No
scrap_fractionNo
machine_time_hrNo
tolerance_classNo
machine_rate_usd_hrNo
machine_time_band_pctNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.7
    • addedInput schema / properties / workspace
      Added value: +{
      +  "default": "",
      +  "description": "Run this call in this named workspace",
      +  "title": "Workspace",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only say readOnlyHint=true/openWorldHint=false, and the description goes far beyond: it discloses that machine-time is order-of-magnitude (fidelity='correlation', band_pct=100), that material_cost alone is exact, that ratios are trustworthy but absolute dollars are not, and enumerates the exact error conditions (no usable density/price, unknown process/tolerance class, non-positive volume/quantity/time).

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?

Front-loaded with the core behavior and formula, then moves to overrides, then optional sharpening inputs, then the return shape — a logical order. It is long and notation-dense, but nearly every sentence carries unique decision-relevant information; the returns enumeration is the only mildly redundant part.

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?

For a 14-parameter estimator with no output schema, the description is unusually complete: it spells out the return keys and breakdown fields, the fidelity/band semantics, and all failure modes. The residual gap is the two unmentioned cost knobs (setup_min, machine_rate_usd_hr) and the workspace scoping parameter.

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 7%, so the description carries nearly the whole burden and does so for most parameters: material resolution rules, price/density overrides and their 'explicit' vs 'material' basis flags, process enum, scrap in the (1+scrap) formula, tooling amortization, tolerance_class semantics, and machine_time_hr/band_pct interplay. Only setup_min and machine_rate_usd_hr are left unexplained despite being non-trivial cost inputs.

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?

Opens with a specific verb+resource: 'Per-unit cost rollup (Design for Cost)', then gives the actual formulas for material_cost and process_cost. It is clearly distinguished from siblings by naming the tools that feed it (material_list/material_get, cnc_time_estimate, tolerance_cost_check) and the roles they play.

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 states when to override the DB (price_usd_kg / density_kg_m3), when a name like 'aluminum' fails and what to do instead, and when to prefer machine_time_hr over the internal table (i.e. when a real model already computed the time). It even explains that the tolerance factor is not re-applied in that case — exactly the kind of when/when-not routing an agent needs.

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

Deploy Server

Other Tools