Skip to main content
Glama

Upsert offer calculation

upsert_offer_calculation
Idempotent

Create or update the OFFER calculation of a procedure — the positions, rates and surcharges a bid is priced from. This is the layer that did not exist: tenders.estimated_value and hourly_rate_min/max are what the CONTRACTING AUTHORITY says, and the project budget tables only come into being after the award. One calculation per procedure, on purpose: two calculations on one bid are two truths, and after the award nobody can say which one was submitted. unit decides whether quantities are person-days or person-months — the BASt counts days, Horizon Europe counts months, and carrying the unit in one's head is how 366 days become 366 months. The surcharges are kept apart because they answer different questions and get moved separately in a conversation: overhead is calculated, risk is estimated, margin is intended.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "upsert_offer_calculation"
  }
}

Input Schema

NameRequiredDescriptionDefault
unitNo
notesNo
titleNo
vat_pctNoDefault 19.
currencyNo
grant_idNo
risk_pctNoApplied to the full prime cost.
tender_idNo
margin_pctNoThe TARGET margin. It is compared against what the offer prices actually achieve, never added on top — the price follows from the rates someone decided, and the margin falls out of it.
overhead_pctNoGemeinkosten, in percent, applied to PERSONNEL cost only.
price_ceilingNoThe authority's ceiling, where the documents name one. Deliberately not read from estimated_value: an estimated contract value is an announcement, a ceiling is an exclusion threshold.
air_kwh_per_m3NoSpecific energy of compressed-air generation, kWh per m3 (normal). Converts the parts' air consumption into electricity; needed as soon as one part uses air.
calculation_idNoUpdate this one instead of the procedure's.
expected_startNoDate, only for display.
duration_monthsNo
energy_price_per_kwhNoNet electricity price per kWh in the calculation currency, for the annual energy cost.
operating_hours_per_yearNoBasis of the purchased parts' annual energy, e.g. 3 shifts x 250 days.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover safety (readOnly=false, destructive=false, idempotent=true), and the description adds genuine behavioral context beyond them: the one-per-procedure uniqueness invariant, the differential treatment of surcharges, and that margin is a target compared against achieved prices rather than an adder to price. It does not say whether an update with partial fields overwrites or merges existing values, which is the main behavioral gap for an upsert.

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?

Purpose and the one-per-procedure rule are front-loaded, but much of the text is rhetorical ('two calculations on one bid are two truths', 'how 366 days become 366 months'). The aphoristic closing about overhead/risk/margin is memorable yet duplicates schema text, so words that could have documented uncovered parameters are spent on style.

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 17-parameter mutation with no output schema, the definition conveys the conceptual model well but leaves substantial gaps: behavior on partial updates, how omitted optional fields are treated, and the meaning of the many uncovered parameters. Annotations carry the safety profile, so the omission is not critical, but the description does not fully equip an agent to call this correctly.

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 59%, and the description adds real meaning for `unit` (person-days for BASt, person-months for Horizon Europe) which the bare enum does not convey. But its account of overhead/risk/margin largely restates what the schema descriptions already say, and roughly 40% of the 17 parameters (currency, grant_id, tender_id, duration_months, expected_start, notes, title) get no treatment anywhere.

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 pair and resource ('Create or update the OFFER calculation of a procedure') and immediately defines the resource as 'the positions, rates and surcharges a bid is priced from'. It further disambiguates the data layer against `tenders.estimated_value` and the post-award project budget tables, so an agent knows this is neither the authority's estimate nor the awarded budget.

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

Usage Guidelines3/5

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

Provides a strong usage constraint ('One calculation per procedure, on purpose') that tells the agent not to create duplicates, and implies when the layer applies versus contract-value fields. However, it never routes between siblings — it does not say when to call `get_offer_calculation` instead, nor when to pass `calculation_id` versus creating a new one for the procedure.

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