Skip to main content
Glama

Last Price

compute_price

Compute a price for a product/context via the Last Price Pricing Compute Network. Returns the computed price, the function that produced it, token metering/cost, and a trace listing each stage the request passed through (cache, route, execute, fallback, constrain, meter). For a competitor offer, put competitor_price, competitor_currency and competitive_action in metadata, then supply min_price or unit_cost with target_margin_pct. Missing business inputs return an error naming them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geoNoOptional geography hint, e.g. US.
currencyYesThree-letter ISO currency code, e.g. USD.
metadataNoOptional context. For competitive pricing: competitor_price, competitor_currency and competitive_action (match or undercut); undercut requires undercut_pct. Confirm product comparability before calling.
max_priceNoOptional maximum acceptable price.
min_priceNoOptional minimum acceptable price. A competitive offer needs this or a declared unit_cost and target_margin_pct.
unit_costNoWhat the work costs you. It lets lastprice/cost-plus price with no current_price, which is the usual case when pricing a task you are about to run. Routing picks a function that can use it; to require cost-plus, pass its UUID from list_functions as function_id.
product_idNoOptional identifier of what is being priced.
function_idNoOptional explicit pricing function UUID to use.
product_typeNoOptional category. Defaults to "custom".
current_priceNoThe current or reference price. Optional: functions that price relative to an incumbent need it, but lastprice/cost-plus prices from unit_cost instead.
customer_segmentNoOptional segment, e.g. enterprise.
target_margin_pctNoMargin on price for cost-plus, not markup on cost: price = unit_cost / (1 - margin). Defaults to 30.
routing_preferenceNoHow to route across pricing functions. Defaults to "default".
include_explanationNoIf true, ask for an explanation and confidence with the price.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it enumerates the return payload (price, producing function, token metering/cost) and the trace stages (cache, route, execute, fallback, constrain, meter), and states that missing business inputs return a naming error. It omits auth, rate limits, and determinism/idempotency details.

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-loads what it does and returns before usage, and every sentence carries information with little padding. The final two sentences are denser than ideal, mixing metadata workflow with cost-plus conditions, but nothing is wasted.

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?

No output schema exists and the description compensates by describing the return fields and trace stages; no annotations exist and it discloses error behavior. For a 14-parameter tool this is close to complete, though the relationship to verify_price and any auth/limit constraints are unaddressed.

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, but the description adds cross-parameter workflow beyond the schema: the competitive-offer grouping (competitor_* + competitive_action, undercut requiring undercut_pct) and the cost-plus path (unit_cost with target_margin_pct, or forcing it via function_id from list_functions). This is genuine added meaning on top of an already-rich schema.

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

Purpose4/5

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

States a specific verb+resource ("Compute a price for a product/context") and names the backing system, so the agent knows exactly what it does. It cross-references the sibling list_functions for function IDs, but never distinguishes itself from verify_price or browse_catalog, so sibling differentiation is incomplete.

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

Usage Guidelines4/5

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

Gives concrete usage contexts: put competitor_price/currency/action in metadata for a competitive offer, or supply min_price/unit_cost with target_margin_pct, and notes unit_cost is the usual case when pricing a task about to run. No explicit when-not-to-use or routing to verify_price, so it stops short of full selection guidance.

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