Skip to main content
Glama

Price cells for an x402 payment

prepare_x402_order
Read-only

Price cells and return a ready-to-send x402 request (URL, method, headers, JSON body, exact amount). Nothing is reserved or charged. Send it with an x402 client (x402-fetch, x402-axios, @x402/fetch); it pays and creates the order in one request. Raise the client's max amount if the price is above its default cap (x402-fetch 0.10 USDC, @x402/fetch 1 USDC). Cells that already have an owner can be bought over at the overwrite price (get_wall_info prices.rule: the multiplier times the last price while the cell is inside its reset window, otherwise the empty-cell price); total_usd here, and the 402 of the returned request, state the exact amount. Areas map to the HTTP body as [y*1000+x, 0xRRGGBB] pairs.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "areas": "<areas>",
      "accepted_terms": "<accepted_terms>"
    },
    "name": "prepare_x402_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
areasYesOne to 20 non-overlapping areas, each a rect + color and/or a list of cells with colours.
ownerNoPublic display name shown on the cells (max 40 characters). Default "anonymous".
accepted_termsYesMust be true: you accept the terms (https://cellionaire.com/terms).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • changedInput schema / properties / areas / items / properties / cells / description
      Previous value: -"Individual cells, each with its own colour (instead of or in addition to rect + color)."New value: +"Individual cells, each with its own colour (instead of or in addition to rect + color): {x, y, color: \"#RRGGBB\"}, or the HTTP API form [idx, color] with idx = y*1000+x and color = 0xRRGGBB as an integer (e.g. [500100, 2254506] = {x: 100, y: 500, color: \"#2266AA\"})."
    • removedInput schema / properties / areas / items / properties / cells / items / additionalProperties
      Removed value: -false
    • addedInput schema / properties / areas / items / properties / cells / items / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "color": {
      +        "$ref": "#/properties/areas/items/properties/color"
      +      },
      +      "x": {
      +        "$ref": "#/properties/areas/items/properties/rect/properties/x"
      +      },
      +      "y": {
      +        "$ref": "#/properties/areas/items/properties/rect/properties/y"
      +      }
      +    },
      +    "required": [
      +      "x",
      +      "y",
      +      "color"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "items": [
      +      {
      +        "maximum": 999999,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      {
      +        "anyOf": [
      +          {
      +            "maximum": 16777215,
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          {
      +            "$ref": "#/properties/areas/items/properties/color"
      +          }
      +        ]
      +      }
      +    ],
      +    "maxItems": 2,
      +    "minItems": 2,
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / areas / items / properties / cells / items / properties
      Removed value: -{
      -  "color": {
      -    "$ref": "#/properties/areas/items/properties/color"
      -  },
      -  "x": {
      -    "$ref": "#/properties/areas/items/properties/rect/properties/x"
      -  },
      -  "y": {
      -    "$ref": "#/properties/areas/items/properties/rect/properties/y"
      -  }
      -}
    • removedInput schema / properties / areas / items / properties / cells / items / required
      Removed value: -[
      -  "x",
      -  "y",
      -  "color"
      -]
    • removedInput schema / properties / areas / items / properties / cells / items / type
      Removed value: -"object"
  2. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, and the description reinforces this with 'Nothing is reserved or charged', then adds behavior the annotations cannot carry: side effects happen only at send time, client-side spending caps (0.10 / 1 USDC defaults) can block payment, and the returned total_usd and 402 body carry the authoritative amount. That is genuinely useful operational context beyond the annotation set.

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?

It is a single dense paragraph, but it is front-loaded with the purpose and return value, then proceeds to caveats. Sentences are information-bearing, though the pricing-rule sentence is long and slightly tangled enough to require a re-read.

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

Completeness4/5

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

For a pricing/preparation tool with no output schema, it covers the return payload shape, the overwrite-price edge case, client cap pitfalls, and the amount field. What is missing is the lifetime/expiry of a prepared request — whether the quoted price and the 402 amount remain valid after some delay — which matters for a two-step price-then-send flow.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so all three parameters are already documented in the schema. The description clarifies how areas serialize into the HTTP body as [y*1000+x, 0xRRGGBB] pairs, but that encoding is also stated in the schema, and owner/accepted_terms get no mention. Baseline 3 is appropriate when the schema does the explaining.

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-and-resource pair ('Price cells') and names the exact artifact returned (URL, method, headers, JSON body, exact amount), which tells an agent precisely what it gets back. The clause 'Nothing is reserved or charged' distinguishes it from the write-side siblings such as create_order without needing to name them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives real use-time instructions: send the result through a named x402 client, and the request itself creates the order, so no separate create_order call is needed. It also routes the agent to get_wall_info when the overwrite pricing rule matters. It stops short of explicitly saying when NOT to use it (e.g., when cells are unavailable, use check_cells_available), so it is a 4 rather than a 5.

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.

Resources