Skip to main content
Glama

cpu_quote_buy

Preview the exact cost of buying a lot, including sale price, fees, discounts, and transit fees when routed. Get a breakdown and check why a purchase would revert, before committing to buy.

Instructions

Preview a buy priced by the Trade contract itself — read-only, reserves nothing, sends no tx (needs a session). Pass chain = [hub, ...waypoints, your destination cell] for the full preflight (sale leg + transit) — the exact total cpu_buy_lot would charge; omit it for the sale leg alone via quoteSale. Returns decimal $CPU: sale (nominal value × pricePerUnit), the hub's live saleFeePercent, your clan discount, salePaid (what you actually pay for the goods), the split (tax, ownerNet), plus transitFee/transitDiscount and arrivalAt when routed, with total = the actual full debit. The hub sale fee and burn come out of the seller proceeds, not on top. Because the quote runs the same checks as the buy, a failed quote explains why the purchase would revert (lot closed, amount exceeds remaining, a sale-fee-tolerance freeze, a hub on the route that cannot serve as a live node right now — temporarily unroutable, not frozen). It does NOT check pause, $CPU balance, or allowance — a fill can still revert on those. cpu_buy_lot re-quotes transit on-chain and authorizes ~10% over as headroom (a ceiling, not an extra charge). Use before cpu_buy_lot. It re-reads the lot first and refuses without quoting when it is not open — an evicted lot is the seller's to bring home, not yours to buy.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNoWaypoint tokenIds [hub, ...waypoints, destination] to include transit fees (the exact total buy_lot would charge); omit for a seller-only estimate (price × value).
lotIdYesThe lot id to preview a buy on.
valueYesUnits to buy, as a positive integer string.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv0.10.0
    • changedInput schema / properties / chain / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "maximum": 48990,
      -      "minimum": 1,
      -      "type": "integer"
      -    },
      -    "minItems": 2,
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "maximum": 29150,
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    "minItems": 2,
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. First observedv0.8.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral disclosure burden — and it excels: read-only, reserves nothing, sends no tx, requires a session, returns detailed fields, re-runs buy checks, and explicitly lists what it does NOT check (pause, balance, allowance). It even discloses cpu_buy_lot's ~10% authorization headroom.

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

Conciseness5/5

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

The description is long but information-dense, and every sentence earns its place: behavioral constraints, routing modes, return fields, fee mechanics, failure semantics, limitations, and usage order. The most decision-critical facts ('read-only, reserves nothing, sends no tx') are front-loaded in the first sentence.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description must explain return values — and it does, enumerating sale, saleFeePercent, discount, salePaid, tax, ownerNet, transitFee, transitDiscount, arrivalAt, and total. It also covers prerequisites, failure explanations, exclusions, and the relationship to the follow-on buy. Nothing an agent needs to call it correctly is missing.

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 adds meaning beyond the schema by explaining the chain parameter as the 'full preflight (sale leg + transit)' and tying it to the exact charge cpu_buy_lot would apply, plus clarifying the distinction between quoteSale-only and routed quotes. This goes beyond the schema's parameter descriptions.

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?

The description opens with a precise verb and resource ('Preview a buy priced by the Trade contract itself'), immediately marking it as a read-only preflight distinct from execution. It explicitly contrasts with cpu_buy_lot and details the mode selection ('full preflight' vs 'sale leg alone'), so an agent cannot confuse it with siblings.

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?

It gives an explicit directive: 'Use before cpu_buy_lot.' It also explains when to include chain (full preflight) versus omit it (seller-only estimate), and clarifies what the quote does and does not check. This is strong, actionable guidance with clear alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/projectcpu/project-cpu-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server