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).
countNoA new purchase only: 2 to 10 in one payment.
hoursNoPrepaid hours (within the plan's range), or hours to add on a renewal. Or send minutes.
imageNoWhat it runs. A plan whose card in compute_plans lists images takes one of those (none: its default). Any other plan: one 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.
api_keyNoWith open_with naming apiKey: the public half (base58) of one of the paying wallet's signing API keys. Never its ags_ secret.
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. A plan whose card in compute_plans carries minMinutes takes any whole minutes from it.
open_ruleNoWith open_with: any (default), one of them opens it; all, every one on each call.
open_withNoOn a plan whose card in compute_plans lists opensWith: what opens it at its own address, one, two or all three. Default: the paying wallet, the signing API key that signed the purchase, and the password when access_key_hash is sent. A compute key (agc_) never opens it.
machine_idNoPrice a renewal of this machine instead of a new one (with hours or minutes only).
access_key_hashNoWith open_with naming password: the sha256 of the password you keep, 64 lowercase hex. The password itself is never sent here.

Output Schema

NameRequiredDescriptionDefault
okYes
codeNo
kindNo
legsNo
nextNo
errorNo
statusNo
noticesNoThe API's notices on its answer, when it sent any.
requestNo
resourceNo
descriptionNo
x402VersionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / access_key_hash
      Added value: +{
      +  "description": "With open_with naming password: the sha256 of the password you keep, 64 lowercase hex. The password itself is never sent here.",
      +  "type": "string"
      +}
    • addedInput schema / properties / api_key
      Added value: +{
      +  "description": "With open_with naming apiKey: the public half (base58) of one of the paying wallet's signing API keys. Never its ags_ secret.",
      +  "type": "string"
      +}
    • addedInput schema / properties / open_rule
      Added value: +{
      +  "description": "With open_with: any (default), one of them opens it; all, every one on each call.",
      +  "enum": [
      +    "any",
      +    "all"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / open_with
      Added value: +{
      +  "description": "On a plan whose card in compute_plans lists opensWith: what opens it at its own address, one, two or all three. Default: the paying wallet, the signing API key that signed the purchase, and the password when access_key_hash is sent. A compute key (agc_) never opens it.",
      +  "items": {
      +    "enum": [
      +      "wallet",
      +      "apiKey",
      +      "password"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / image / description
      Previous value: -"One container image, served on host port 8080, e.g. nginx:alpine. Or send compose."New value: +"What it runs. A plan whose card in compute_plans lists images takes one of those (none: its default). Any other plan: one container image, served on host port 8080, e.g. nginx:alpine, or send compose."
  3. Changed5 schema fields changed
    • addedInput schema / properties / count
      Added value: +{
      +  "description": "A new purchase only: 2 to 10 in one payment.",
      +  "maximum": 10,
      +  "minimum": 2,
      +  "type": "integer"
      +}
    • changedInput schema / properties / minutes / description
      Previous value: -"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."New value: +"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. A plan whose card in compute_plans carries minMinutes takes any whole minutes from it."
    • removedInput schema / properties / minutes / enum
      Removed value: -[
      -  15,
      -  30,
      -  45
      -]
    • addedInput schema / properties / minutes / minimum
      Added value: +1
    • addedOutput schema / properties / notices
      Added value: +{
      +  "description": "The API's notices on its answer, when it sent any.",
      +  "type": "object"
      +}
  4. 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"
      +}
  5. 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"
      +}
  6. 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"
      -]
  7. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/openWorld, so safety is covered; the description still adds real behavior: no payment is taken, the server validates plan/hours/setup first so a refusal is free, and the response is one offer leg per network carrying amount in USDC, payee address, token, signature validity window, and payload to sign. It does not cover rate limits or pagination, and it explains the return shape even though an output schema exists.

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-loaded with the core action and why it is free, and nearly every clause carries operative information (alternatives, conditional parameters, the buy path). It is a single dense block of roughly 200 words, though, and several clauses echo the schema descriptions, so it could be tightened or broken into a short list of conditional cases.

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?

For a 14-parameter, all-optional tool with an output schema and existing annotations, the definition covers the prerequisites (compute_plans for plan facts), the two pricing modes, the conditional parameters, and the handoff to compute_docs for the payment step. 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, but the description adds cross-parameter meaning the schema states only piecewise: machine_id + hours/minutes means renewal rather than a new machine, minutes substitutes for hours only where a plan sells quarter-hours, and ai_usd binds the AI balance to the paying wallet. Some of this restates schema text (ai_usd, minutes, region), which keeps it from a 5.

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 — get the exact price of one machine without paying by reading back the API's HTTP 402 offer — and immediately splits the two modes (new purchase vs. renewal via machine_id + hours). An agent can distinguish it from compute_plans (plan cards) and compute_docs (payment contract) without opening any 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?

Names explicit conditions and alternatives: price a renewal by passing machine_id, send minutes where the plan sells quarter-hours, send region where the plan lists regions, add ai_usd for an AI balance, and — for an actual purchase — take a leg from here and resend with an X-PAYMENT header per compute_docs. It also says where prerequisite facts live (compute_plans shows minutePrices, regions, opensWith).

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.