Skip to main content
Glama

Buy one result from the results shelf (output or recipe)

shelf_buy

Buys one shelf item's OUTPUT (the result files) or its RECIPE (the full recipe: model ids, harness code, settings, prompt, inputs) and returns every file in full with its sha256, a receipt and a signed proof. The price is a fraction of the measured original cost; items with an UNKNOWN cost are not for sale. Use it when shelf_search found the item you want and its offer is on sale. Use shelf_search instead to find an item, its price and a preview first. Cost: the item's offer price_usd from shelf_search (now $0.0121 to $0.01212), charged once per purchase and debited from your balance; an item with an UNKNOWN cost is not sold. Auth: Authorization: Bearer (POST https://api.gaents.com/v1/accounts, $0.10 free credit); with no key the call returns a signed 402 quote payable in BSV or USDC via x402. Errors (isError, error.code): 404 unknown_item, 409 not_for_sale (cost UNKNOWN or type not priced), 401 bad_api_key, 402 low balance, 503 item_unavailable (a file failed its hash check; refunded).

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": {
      "id": "<id>"
    },
    "name": "shelf_buy"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe shelf item id from shelf_search (items[].id).
typeNoWhich offer to buy: output (the result files) or recipe (the full recipe and harness).output

Output Schema

NameRequiredDescriptionDefault
itemYes
typeYes
filesYes
titleNo
verifyNohow to re-check the hashes
repeat_buyNo
charged_usdYes
bundle_sha256Yes
recipe_sha256No
receipt_quote_idNo
original_cost_usdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "bundle_sha256": {
      +      "type": "string"
      +    },
      +    "charged_usd": {
      +      "type": "number"
      +    },
      +    "files": {
      +      "items": {
      +        "properties": {
      +          "bytes": {
      +            "type": "integer"
      +          },
      +          "content": {
      +            "type": "string"
      +          },
      +          "encoding": {
      +            "enum": [
      +              "utf-8",
      +              "base64"
      +            ],
      +            "type": "string"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "sha256": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "item": {
      +      "type": "string"
      +    },
      +    "original_cost_usd": {},
      +    "receipt_quote_id": {
      +      "type": "string"
      +    },
      +    "recipe_sha256": {},
      +    "repeat_buy": {
      +      "type": "boolean"
      +    },
      +    "title": {},
      +    "type": {
      +      "type": "string"
      +    },
      +    "verify": {
      +      "description": "how to re-check the hashes"
      +    }
      +  },
      +  "required": [
      +    "item",
      +    "type",
      +    "files",
      +    "bundle_sha256",
      +    "charged_usd"
      +  ],
      +  "type": "object"
      +}
  2. Added

TDQS

A4.4/5.0
Behavior3/5

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

Annotations only give the generic safety profile (readOnly=false, destructive=false, idempotent=false); the description adds substantive behavior well beyond that: per-purchase charge debited from balance, UNKNOWN-cost items unsellable, signed 402 quote without a key, refund on 503 hash-check failure, and enumerated error codes with meanings. However, the disclosed price range ('$0.0121 to $0.01212') is oddly narrow and reads as stale/boilerplate, and idempotency semantics (what happens if the same id is bought twice, and whether a duplicate is re-charged) are never addressed despite idempotentHint=false.

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 purpose before the pricing, auth, and error detail, and almost every clause carries decision-relevant information. It is a single dense paragraph, though, with cost information repeated twice ('The price is a fraction...' and 'Cost: ...'), which could be tightened without losing anything.

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 paid, authenticated, non-idempotent purchase call this is unusually complete: cost source, auth header and signup path, unpaid 402 fallback, and a full error-code map. An output schema exists, and the description still summarizes the return payload (every file with sha256, a receipt, a signed proof) without duplicating field-level detail.

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 real meaning: it tells the agent the id must come from shelf_search's items[].id, and it explains that 'type' selects between the result files and the full recipe/harness rather than merely naming two enum values. It stops short of noting any constraints on id format beyond what the schema pattern already encodes.

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?

Opens with a specific verb and resource ('Buys one shelf item's OUTPUT ... or its RECIPE') and immediately defines what each of the two purchase modes contains (result files vs. model ids, harness code, settings, prompt, inputs). This distinguishes it cleanly from shelf_search, which only finds and previews items.

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?

Explicitly states when to use it ('when shelf_search found the item you want and its offer is on sale') and when not to ('Use shelf_search instead to find an item, its price and a preview first'). The prerequisite ordering 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.

Resources