Skip to main content
Glama

Set opening cost

inv_set_opening_cost
Destructive

What one unit was worth when it came in without a cost: stock on hand before these books, or a correction received by hand. Everything after it is derived. Only for stock that came in without a cost. Take the figure from a record the person has: the last supplier invoice, a stock sheet, the accountant's figure. Never estimate it yourself, and never use the selling price. It is the one cost anyone states; every other cost is derived from what was paid on purchase orders. Changing it later re-derives everything after it, so say why. Effects: opening cost stated; average cost, value and cost of goods sold re-derived.

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": {
      "item_id": "<item_id>",
      "unit_cost": "<unit_cost>",
      "reason": "<reason>"
    },
    "name": "inv_set_opening_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
reasonYesWhere the figure comes from: "last Bay Gasket invoice, March".
item_idYesThe item. An existing item id.
unit_costYesWhat one unit was worth. In cents (integer minor units) — 1250 means $12.50.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

The annotations already declare destructive and non-idempotent behavior, but the description adds concrete impact: opening cost is stated and average cost, value, and cost of goods sold are re-derived. It also warns that later changes re-derive everything after it, though it does not discuss permissions or error handling.

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?

The definition is front-loaded with the core concept and constraints, and most sentences carry useful information. Some repetition around derivation makes it slightly longer than necessary, but it remains dense and readable.

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 destructive three-parameter mutation with full schema coverage and no output schema, the description covers purpose, source constraints, and downstream effects well. It omits permission requirements and error behavior, but those gaps are not severe enough to prevent correct invocation.

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 coverage is 100%, so the baseline is 3; the description still adds meaning by requiring unit_cost to come from a real record rather than an estimate or selling price, and by tying reason to why the figure is stated. It does not add formatting details such as cents, but the schema already covers that.

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 the resource clearly: the unit value for stock that arrived without a cost, limited to pre-books stock or a hand correction. The sentence that every other cost is derived from purchase orders distinguishes this from normal PO-based costing, so an agent can identify the tool's role.

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 restricts use to stock that came in without a cost and forbids estimating or using the selling price. It also tells the agent to take the figure from a record the person holds, while implying PO-paid costs are handled through derivation rather than this tool.

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.