Skip to main content
Glama

estimate_cost

Read-only

Estimate the cost of an already-sliced G-code print job from filament use and electricity. Prices each filament by material and reports filament source and warnings.

Instructions

Estimate the cost of a print job from a G-code file (already-sliced only).

        For STL/OBJ files, use ``slice_and_estimate`` instead — it slices
        and estimates in one step.

        The slicer's own ``filament used`` totals are the filament
        figures when the file carries them; otherwise Kiln counts the
        extruding moves itself.  ``estimate.filament_source`` says which,
        and a ``warnings`` entry names both numbers when Kiln's count
        sits more than 5% from the slicer's total.

        Each filament is priced as the material the file was sliced
        for; ``estimate.filaments`` lists them and
        ``estimate.material_source`` says where the material came from.
        When Kiln's servers answer, the estimate also
        carries a ``cost_intelligence`` field; what it holds depends on
        the tier.

        Args:
            file_path: Path to the G-code file.
            material: Filament material (PLA, PETG, ABS, TPU, ASA, NYLON,
                PC, …).  Leave empty to use what the file was sliced
                for, PLA when it names nothing; a named material prices
                every filament.
            electricity_rate: Cost per kWh in USD (default 0.12).
            printer_wattage: Printer power consumption in watts (default 200).
            printer_id: Optional registered printer the print is for;
                passed on with the file when kiln-pro is asked.
            plate_number: For a sliced 3MF of several plates, the plate to
                price (1 for the first).  Omit to price every plate
                together; ``covers`` then says "all N plates".
        

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": {
      "file_path": "<file_path>"
    },
    "name": "estimate_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
materialNoFilament material (PLA, PETG, ABS, TPU, ASA, NYLON, PC, …). Leave empty to use what the file was sliced for, PLA when it names nothing; a named material prices every filament. Default: "".
file_pathYesPath to the G-code file.
printer_idNoOptional registered printer the print is for; passed on with the file when kiln-pro is asked. Default: "".
plate_numberNoFor a sliced 3MF of several plates, the plate to price (1 for the first). Omit to price every plate together; ``covers`` then says "all N plates".
printer_wattageNoPrinter power consumption in watts (default 200). Default: 200.0.
electricity_rateNoCost per kWh in USD (default 0.12). Default: 0.12.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.6.0
    • addedInput schema / properties / plate_number
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "For a sliced 3MF of several plates, the plate to price (1 for the first).  Omit to price every plate together; ``covers`` then says \"all N plates\".",
      +  "title": "Plate Number"
      +}
  2. Changed5 schema fields changedv1.5.1
    • changedInput schema / properties / electricity_rate / description
      Previous value: -"Default: 0.12."New value: +"Cost per kWh in USD (default 0.12). Default: 0.12."
    • addedInput schema / properties / file_path / description
      Added value: +"Path to the G-code file."
    • changedInput schema / properties / material / description
      Previous value: -"Default: \"\"."New value: +"Filament material (PLA, PETG, ABS, TPU, ASA, NYLON, PC, …).  Leave empty to use what the file was sliced for, PLA when it names nothing; a named material prices every filament. Default: \"\"."
    • changedInput schema / properties / printer_id / description
      Previous value: -"Default: \"\"."New value: +"Optional registered printer the print is for; passed on with the file when kiln-pro is asked. Default: \"\"."
    • changedInput schema / properties / printer_wattage / description
      Previous value: -"Default: 200.0."New value: +"Printer power consumption in watts (default 200). Default: 200.0."
  3. Changed7 schema fields changedv1.5.0
    • removedInput schema / properties / electricity_rate / default
      Removed value: -0.12
    • addedInput schema / properties / electricity_rate / description
      Added value: +"Default: 0.12."
    • removedInput schema / properties / material / default
      Removed value: -"PLA"
    • addedInput schema / properties / material / description
      Added value: +"Default: \"\"."
    • addedInput schema / properties / printer_id
      Added value: +{
      +  "description": "Default: \"\".",
      +  "title": "Printer Id",
      +  "type": "string"
      +}
    • removedInput schema / properties / printer_wattage / default
      Removed value: -200
    • addedInput schema / properties / printer_wattage / description
      Added value: +"Default: 200.0."
  4. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare read-only, non-destructive, closed-world behavior, yet the description still adds real substance: the slicer-vs-Kiln filament counting fallback, the 5% divergence warning threshold, the tier-dependent cost_intelligence field, and plate aggregation via "covers". The mention of "When Kiln's servers answer" sits in mild tension with openWorldHint=false, but it reads as a graceful-degradation note rather than a claim of open-world interaction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The prose paragraphs are well organized and front-loaded with scope and the alternative tool, but the full Args section duplicates schema text that is already fully documented, spending tokens without adding meaning. Trimming that block would leave a tight, high-signal description.

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?

With no output schema, the description usefully names the return fields an agent will encounter (estimate.filament_source, estimate.filaments, estimate.material_source, cost_intelligence, covers, warnings). It stops short of describing the overall response envelope or the units of the returned cost figure, which would complete the 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%, so the Args block is essentially a verbatim restatement of the parameter descriptions. It adds only modest nuance — the default resolution rules for material and what plate_number omission does to the "covers" field — so the baseline 3 for high schema coverage is appropriate.

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 and resource ("Estimate the cost of a print job from a G-code file") and immediately qualifies the input scope with "already-sliced only". It also names the sibling it is not (slice_and_estimate), so an agent can distinguish the two without opening a schema.

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?

Explicit when-not guidance: STL/OBJ files should go to slice_and_estimate, which slices and estimates in one step. The input-format constraint is front-loaded and the alternative is named, leaving no inference required for the most likely routing mistake.

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