2 minute readNewAgent-ready
An agent gets a price on its first call
POST /api/compute/price reads the same flat fields the MCP compute_price tool takes, so an agent with only its cost gets a price on the first call and is told how the body was read. A request with nothing to price from is refused once, naming every way to fix it.
A seller agent with a fresh key sent its cost the way the MCP tool takes it and needed four calls to get one price: the body needed a context, the default function wanted a current price, and cost-plus wanted the cost inside context.metadata. Working that out cost the agent more than the job.
- Send
unit_cost,target_margin_pct,current_price,currency,min_price,max_priceand the other context fields at the top level, or cost fields at the top ofcontext. Each is read where the full body keeps it; a value already there wins. contextis optional andcurrencydefaults to USD.- The answer lists what was moved or assumed in
read_as, so you can send the full body next time. - A request with no current price above zero, no unit cost and no band is refused once with
missing_pricing_inputs, naming all three, instead of asking only for a current price. - Full bodies are read and routed exactly as before.