Skip to main content
Glama

x402_infer

Run one inference paid PER CALL in Bitcoin BSV via x402, no prepaid channel. Non-custodial, two steps: (1) call without payment to get the 402 quote (status payment_required, accepts[]); nothing is spent. (2) Build and sign a BSV payment for that quote in your own wallet (for example fetchWithX402 / buildPayment in @bsvkey/x402-bsv-client) and call again with the same prompt, model, maxTokens and webSearch plus payment = the base64 X-PAYMENT value. Returns the completion plus the on-chain settlement txid. This server never takes a private key: a wif argument is refused. On failure returns isError "error: (): ". Codes: key_refused (a private key was sent; it was not used or forwarded); payment_failed (402: the payment did not settle; nothing is spent); invalid_request (400: unknown model or bad input; nothing is spent); upstream_failed (502: the payment SETTLED but the model provider then failed; the text includes the settlement txid. There is no automatic refund: contact embryospace@gmail.com with that txid).

Input Schema

NameRequiredDescriptionDefault
modelNoModel id or policy: auto|cheapest|best, claude-*, grok-*.grok-4.3
promptYesThe user prompt.
systemNoOptional system prompt.
paymentNoThe base64 X-PAYMENT header value your wallet signed for the quote from step 1. Omit to get the quote.
maxTokensNoMax output tokens.
webSearchNoLet the model search the live web (adds a per-search fee to the quote).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it declares non-custodial behavior, that a `wif` argument is refused, that step 1 spends nothing, and enumerates failure codes with their spend consequences (payment_failed spends nothing, upstream_failed settled and has no automatic refund, with a contact path). This is exactly the behavioral context an agent cannot infer elsewhere.

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 purpose and billing model, then the two steps, then the error taxonomy — the ordering is deliberate and every sentence carries operational content. It is dense and long, but nearly all of the length is load-bearing given the payment protocol.

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?

No annotations and no output schema, yet the description covers return values (completion plus on-chain settlement txid) and the full error surface with spend implications. Nothing an agent needs to call this safely 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 real meaning: it explains that `payment` is the base64 X-PAYMENT value signed for the step-1 quote and must be paired with the identical prompt/model/maxTokens/webSearch, which is call-sequence semantics the schema cannot express.

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 opening sentence states a specific verb and resource ('Run one inference') plus the billing model ('paid PER CALL in Bitcoin BSV via x402, no prepaid channel'), which immediately separates it from the sibling `infer` and the channel-based tools (`channel_balance`, `open_channel`). An agent can select it without opening the schema.

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 spells out the exact two-step call sequence (quote first, then pay and re-call) and implicitly contrasts with a prepaid channel. It does not explicitly name which sibling to use instead when a channel already exists, so usage is clear but not fully routed.

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