Skip to main content
Glama

Price one machine (the x402 offer)

compute_quote
Read-onlyIdempotent

Gets the exact price of one machine without paying: sends the create request with no payment and returns the API's HTTP 402 offer, one leg per network, each with the amount in USDC, the address it is paid to, the token, how long a signature stays good, and what to sign. The API checks the plan, the hours and the setup first, so a refusal costs nothing. Pass machine_id and hours instead to price a renewal of a running machine (any wallet may pay one). Where the API sells quarter-hours (compute_plans shows minutePrices), send minutes (15, 30 or 45) in place of hours. For a plan that lists regions (compute_plans shows them), send region. Send ai_usd (1, 5, 25 or 100) to buy that AI balance in the same payment: the paying wallet gets it, and a key on it arrives in the machine's sealed env as AGENTGATES_API_KEY. To buy, sign one leg with your own wallet and send the same request with an X-PAYMENT header (compute_docs has the whole contract).

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": "compute_quote"
  }
}

Input Schema

NameRequiredDescriptionDefault
planNoA plan id from compute_plans. Not with machine_id.
portNoWith image: the container port behind 8080 (default 80).
hoursNoPrepaid hours (within the plan's range), or hours to add on a renewal. Or send minutes.
imageNoOne container image, served on host port 8080, e.g. nginx:alpine. Or send compose.
ai_usdNoA new machine only: dollars of AI bought in the same payment, for the paying wallet; a key on that balance arrives in the machine's sealed env as AGENTGATES_API_KEY. Paid over x402 only.
regionNoFor a plan that lists regions (compute_plans shows them): the region to run in, by its id. Absent, the plan's first.
composeNoA docker-compose.yml as a string. It must publish a port. Or send image.
minutesNoIn place of hours, where the API sells quarter-hours (compute_plans shows minutePrices): 15, 30 or 45 minutes, on every plan but GPU. A quarter-hour costs more per hour than an hour.
machine_idNoPrice a renewal of this machine instead of a new one (with hours or minutes only).

Output Schema

NameRequiredDescriptionDefault
okYes
codeNo
kindNo
legsNo
nextNo
errorNo
statusNo
requestNo
resourceNo
descriptionNo
x402VersionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / ai_usd
      Added value: +{
      +  "description": "A new machine only: dollars of AI bought in the same payment, for the paying wallet; a key on that balance arrives in the machine's sealed env as AGENTGATES_API_KEY. Paid over x402 only.",
      +  "enum": [
      +    1,
      +    5,
      +    25,
      +    100
      +  ],
      +  "type": "integer"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / region
      Added value: +{
      +  "description": "For a plan that lists regions (compute_plans shows them): the region to run in, by its id. Absent, the plan's first.",
      +  "type": "string"
      +}
  3. Changed4 schema fields changed
    • changedInput schema / properties / hours / description
      Previous value: -"Prepaid hours (within the plan's range), or hours to add on a renewal."New value: +"Prepaid hours (within the plan's range), or hours to add on a renewal. Or send minutes."
    • changedInput schema / properties / machine_id / description
      Previous value: -"Price a renewal of this machine instead of a new one (with hours only)."New value: +"Price a renewal of this machine instead of a new one (with hours or minutes only)."
    • addedInput schema / properties / minutes
      Added value: +{
      +  "description": "In place of hours, where the API sells quarter-hours (compute_plans shows minutePrices): 15, 30 or 45 minutes, on every plan but GPU. A quarter-hour costs more per hour than an hour.",
      +  "enum": [
      +    15,
      +    30,
      +    45
      +  ],
      +  "type": "integer"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "hours"
      -]
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only say readOnly/idempotent/non-destructive; the description adds the important behavioral fact that this sends a create request with no payment and surfaces the API's 402 offer, and that plan/hours/setup validation happens first so 'a refusal costs nothing'. It also discloses the offer's contents (one leg per network, USDC amount, pay-to address, token, signature lifetime) and the side effect of ai_usd (key injected into the machine's sealed env as AGENTGATES_API_KEY).

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?

Long but front-loaded and dense — the core behavior leads, then conditional branches, then the purchase pointer. Some restatement of schema-level detail (ai_usd denominations, region sourcing from compute_plans) repeats what the parameter descriptions already say, which costs a little economy.

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?

With nine optional parameters, an output schema, and a read-only annotation, the description still supplies everything an agent needs for a correct call: the two modes, the three field substitutions, the AI-balance side effect, and the handoff to compute_docs for the actual payment step. No material gap remains for a pricing 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 baseline is 3, but the description adds cross-parameter meaning the schema only implies: plan vs. machine_id are alternatives, minutes substitutes for hours only on quarter-hour plans (never GPU), and ai_usd is charged to the paying wallet and materializes as a named env var. It does not explain port's interaction with compose/image beyond what the schema already states.

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 and resource — 'Gets the exact price of one machine without paying' — and immediately explains the mechanism (sends the create request with no payment, returns the HTTP 402 offer). It also distinguishes two modes (new machine vs. renewal) and names compute_plans and compute_docs as the related siblings, so an agent can place it without opening a schema.

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?

Explicit conditional routing: pass machine_id and hours to price a renewal, send minutes instead of hours where the API sells quarter-hours, send region for plans that list regions, send ai_usd to bundle AI balance. It also states the boundary of the tool — 'To buy, sign one leg ... and send the same request with an X-PAYMENT header' — pointing to compute_docs for the contract, so price-vs-buy is unambiguous.

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.