Skip to main content
Glama

cpu_quote_buy

Preview CPU lot buy costs and detect reverts: get a read-only quote with sale fees, discounts, transit fees, and total debit before you commit.

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 foreign frozen hub on the route). 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.

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.
Behavior5/5

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

With no annotations provided, the description carries full behavioral burden and does so thoroughly: it discloses read-only behavior, no transaction, reserves nothing, needs a session, fee/burn allocation, the 10% headroom behavior of the follow-up buy, and the failure explanation semantics. This goes far beyond basic summaries.

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?

Although the description is long, it is dense and well-structured: the first sentence gives the core purpose, then details flow logically through input semantics, output fields, fee allocation, caveats, and relationship to the buy tool. Every sentence earns its place and no filler is present.

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 document return values, and it does: `sale`, `saleFeePercent`, `discount`, `salePaid`, `tax`, `ownerNet`, `transitFee`, `transitDiscount`, `arrivalAt`, and `total`. It also covers failure behavior and limitations, making the description complete for a complex financial preflight tool.

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 valuable semantics beyond the schema. It clarifies that `chain` represents the full route and that omitting it invokes `quoteSale`, and it ties parameter behavior to the exact charge from `cpu_buy_lot`. This enriches parameter understanding without repeating schema text.

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 specific verb+resource: 'Preview a buy priced by the Trade contract itself' and clearly contrasts with the execution tool `cpu_buy_lot`. It also differentiates from sibling quote tools like `cpu_quote_mint`, `cpu_quote_swap`, and `cpu_quote_transport` by focusing on the buy-lot sale leg and optional transit routing.

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 explicitly says 'Use before `cpu_buy_lot`' and provides precise when-to-include-chain guidance: full preflight with `chain`, or omit for a seller-only estimate. It also states what the quote does NOT check (pause, balance, allowance), helping the agent avoid relying on it as a complete guarantee.

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

Install Server

Other Tools

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