Skip to main content
Glama

Purchase Player Value Offer

horizon_purchase_player_value_offer
DestructiveIdempotent

Purchases a server-configured player offer with atomic cost and reward application, using a stable operation ID so retries replay safely after confirmation.

Instructions

Purchases one configured offer with atomic costs and value/item rewards, retaining only a minimal public duplicate guard. Use when: a player confirms an offer returned by horizon_get_player_value_offers. Not for: choosing arbitrary costs or rewards; only the server's configured offer is accepted. Requires: userId and the player's session: sign in with horizon_signin_email or horizon_signin_anonymous and pass its accessToken as sessionToken. Persist operationId before the first request. Side effects: Debits and credits together once. Same ID and body replay without another debit; no automatic retries or new IDs. Returns: Current state with operation:{operationId,replayed,alreadyApplied,applied,items}. Fresh success contains committed deltas and new item references; replay has empty applied/items. Never add an old reward delta locally. Errors: 409 STATE_CONFLICT: refresh state and retry the SAME operation ID and payload. OPERATION_CONFLICT: do not reuse an ID for a different action. OPERATION_EXPIRED: reconcile state/history; never silently generate another ID. INSUFFICIENT_BALANCE, MAX_BALANCE_REACHED or DAILY_LIMIT_REACHED leaves the whole operation unapplied. 401 means the session is missing or expired: sign in again and retry with the new accessToken. 403 for a session means the token belongs to another user: pass the userId that signed in. Needs HORIZON_API_KEY. Every failure returns an error result (isError) with the HTTP status and body: a 401 that horizon_test_connection also returns means HORIZON_API_KEY is wrong, 429 means the account's per-minute rate limit was reached (wait a minute, then retry).

Input Schema

NameRequiredDescriptionDefault
userIdYesPlayer UUID belonging to the selected project and player session
offerKeyYesConfigured value or offer key, 1 to 24 lowercase letters, digits, '.', '_' or '-'
operationIdYesStable operation ID: server-aligned Unix milliseconds + ':' + UUID. Persist before sending; reuse unchanged on timeout or retry
sessionTokenYesPlayer accessToken from sign-in, sent only in the Authorization Bearer header

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.9.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructive=true and idempotent=true, but the description goes well beyond them: atomic debit+credit, replay-by-same-ID semantics with no automatic retry, distinct fresh-vs-replay return shapes, and a specific error taxonomy (409/OPERATION_CONFLICT/OPERATION_EXPIRED/INSUFFICIENT_BALANCE/401/403/429) with recovery instructions. Nothing here contradicts the annotations; the destructive and idempotent hints are actively explained.

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?

Well front-loaded and clearly segmented into Use when / Not for / Requires / Side effects / Returns / Errors. It is long, but for a destructive monetary operation with no output schema most sentences carry operational weight; the only mild redundancy is the repeated warning about not generating a new operation ID ('no automatic retries or new IDs' vs. 'never silently generate another ID').

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 four required parameters, no output schema, and destructive+idempotent semantics, the description covers everything an agent needs: auth acquisition path, API key requirement, idempotency contract, return shape including the operation object, and failure handling for each documented status. Nothing material is left to inference.

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; the description still adds real value by stating where each value comes from (offerKey from horizon_get_player_value_offers, sessionToken from horizon_signin_email/anonymous) and by emphasizing the operationId lifecycle ('persist before the first request', never mint a new ID on conflict/expiry). That is meaningful guidance beyond the schema's field-level text, though the schema already documents operationId formatting and reuse fairly well.

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 ('Purchases one configured offer') and immediately scopes it ('atomic costs and value/item rewards, retaining only a minimal public duplicate guard'). It also names the sibling that produces the input (horizon_get_player_value_offers), so the agent can distinguish this from the read-side offer tool without opening either 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 'Use when' and 'Not for' clauses: only after a player confirms an offer returned by horizon_get_player_value_offers, and never for arbitrary cost/reward selection. This is exactly the when/when-not/alternative structure that routes an agent correctly among 100+ siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools