Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
RPC_URLNoA custom RPC endpoint for sending on-chain transactions (e.g. `reveal`).chain's public RPC
PRIVATE_KEYYesYour wallet private key — 0x followed by 64 hex chars (32 bytes).

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
authenticateA

Create a blockchain session. Call this tool when other tools fail with authentication or session errors (e.g. "not authenticated", "session expired"). In EVM mode this signs in via SIWE locally and stores the token. In AGW mode it returns a URL the user must open in their browser to approve. Once authenticated, subsequent wallet-dependent tools will work automatically. Pass force=true to discard the cached session and authenticate from scratch (e.g. after the game server was reset and the stored token references a stale user).

get_game_configA

Return the game rulebook for the active network: the resource catalog (id → name), building costs (extractor / hub), reveal-cost params (first reveal free; re-reveal price), the on-chain contract addresses, and the recipe count (use list_recipes for the full recipe graph). A free reference read — call it once to ground planning. No session needed.

get_mapA

Read the live game world. The map is loaded at startup and kept current in the background; this returns a snapshot of it on demand (you only see updates when you call a tool). The map is public — you can see every player. Resources live on cells. Always returns a "summary" (counts + freshness) and, when your wallet is known, a "resourceIndex" (resourceId → your cells holding it, with location). Cells come back as a graph: each carries axial x/y and "neighbors" (the 6 adjacent hexes, each owned/other/empty). Scopes: "mine" (your cells), "around" (cells within a hex radius — scout a region), "cells" (specific tokenIds), "all" (everything), "summary" (no cells). Default: "mine", else "summary". Note units: version/updated are epoch ms, serverTime/startAt are unix seconds, amounts are decimal strings. Also carries "server": { reachable } — false means the game server is unreachable right now and actions will fail; retry once it is true again.

get_cellA

Inspect a single cell in depth (any owner — the map is public). Returns the cell, its neighbours expanded as full cell states (not just refs, so you see the immediate surroundings of a target), and the hex distance to your nearest cell (null if your wallet is unknown). Use this to study a specific target; use get_map for broader situational awareness.

get_changesA

Get only the cells that changed since a given version — react to other players without re-reading the whole map. Workflow: take "version" from a previous map response, remember it, and pass it back here next time; the response carries a new "version" to use on the following call. Omit sinceVersion (or pass 0) to get everything. The response also carries "server": { reachable }. reachable=false means the game server is unreachable right now (the last HTTP call to the API failed or returned non-JSON), so any action (build/reveal/transport/trade) will fail too — do not hammer it with retries. Keep polling get_changes instead: the client keeps probing and reconnecting in the background, and once "server".reachable flips back to true the server is up and you can act again (after an outage, call once with sinceVersion 0 to be sure you have the full current picture).

revealA

Reveal the resource deposits of a Land cell you own. Requires a session — call authenticate first. The first reveal of a cell is free. A re-reveal is allowed only once every deposit on the cell is fully depleted (claimed to zero) — if any deposit remains the API rejects it — and costs $CPU, which this tool auto-approves once (a one-time unbounded allowance) before revealing. It submits an on-chain transaction and waits for its confirmation, then reports the transaction hash. The revealed resources are applied a few seconds later by the indexer — read them with get_cell once settled.

buildA

Place a building on a revealed Land cell you own. Requires a session — call authenticate first. Two types: extractor (mines a resource deposit — pass the targetResourceId of a resource that has an active deposit on the cell) and hub (trade — pass targetResourceId: null). Build always costs $CPU, which this tool auto-approves once (a one-time unbounded allowance) before submitting the on-chain payment and waiting for its confirmation. The building is applied by the indexer a few seconds later; an extractor then starts mining automatically — track it with get_mining_status. Inspect the cell with get_cell. A cell holds one building. An extractor may be rebuilt only on a cell whose target resource is fully depleted (claimed to zero): the new extractor — which must target a resource that still has an active deposit — replaces the old one. Otherwise the build is rejected (the existing building isn’t replaceable). A hub can only go on a cell that was never built on. A build already awaiting payment on the cell blocks a different one — pay or let it lapse first (an identical re-request just resumes it).

list_recipesA

List the craft recipes available in the game: each recipe’s inputs, outputs, duration per batch and $CPU cost. Public — no session needed. Use it before craft to pick a recipe and see what a paid forge will cost up front.

craftA

Run a craft recipe on a cell you own (refine raw resources, or forge $WCPU). Requires a session — call authenticate first; discover recipes with list_recipes. Inputs are debited upfront for all batches. Most recipes are free and start their timer immediately; forge_wcpu costs $CPU, which this tool auto-approves once (a one-time unbounded allowance) before submitting the on-chain payment and waiting for its confirmation — its timer then starts once the indexer settles the payment a few seconds later. Track progress with get_craft_status and bank matured batches with claim_craft.

get_craft_statusA

Get the craft processes on a cell: each one’s recipe, status (active / pending payment), batches done, what is claimable right now, and when the next batch matures. Public — works for any tokenId. This is the source of craft progress; bank matured batches with claim_craft.

claim_craftA

Bank every matured craft batch on a cell you own into its resource balance. Requires a session — call authenticate first. With at least one craft process on the cell, claiming nothing matured is a no-op success; claiming on a cell that has no craft processes is an error. A fully-claimed process frees its slot. Check what is claimable first with get_craft_status.

get_mining_statusA

Read a cell's mining status: whether an extractor is active, which resource it mines, the accrued-but-unclaimed amount, and the remaining deposit. Public — works for any cell, no session required. The owner banks the accrued amount with claim_mining.

claim_miningA

Bank the resources an extractor has accrued on a cell you own into the cell balance. Requires a session — call authenticate first. Off-chain and free (no transaction). With an active extractor, claiming nothing accrued is a harmless no-op; claiming on a cell that has no extractor is an error. Check what is available first with get_mining_status.

quote_transportA

Preview a transport route without committing: returns whether it is free or paid, the hop distance and travel time, and (for a paid route through a foreign Hub) the exact $CPU fee, burn, and per-hub payouts. It has no side effects — it does not escrow resources. It also validates the route, surfacing the rejection reason and hop index if the path is invalid. Use it before transport to decide.

transportA

Move a resource between cells along a waypoint chain. Requires a session — call authenticate first. A route over only your own cells is free and starts immediately; a route through a foreign Hub costs $CPU — this tool then auto-approves the $CPU spend once (a one-time unbounded allowance) and submits the on-chain payment, waiting for its confirmation. Preview the cost first with quote_transport. Returns the transport jobId — track the shipment with get_transport_status <jobId>. If the on-chain payment fails, the source resource stays escrowed and the action is resumable with resume_transport <jobId>. While that paid shipment is still pending, starting another transport of the same resource from the same cell is rejected — finish it with resume_transport, or wait for a lapsed one to be refunded automatically.

list_my_transportsA

List your own transports (newest first), optionally filtered by status (in_transit, delivered, awaiting_payment, cancelled, reverted). Each entry includes live progress. Use this to monitor your shipments, or to recover a transport jobId you no longer have — the map does not carry jobIds.

get_transport_statusA

Get the live status of one transport by its jobId: lifecycle status, interpolated position, hops traveled, and ETA / arrival. Public — works for any jobId. This is the only source of a shipment live progress; the world map never carries shipments. As a secondary signal, a delivered shipment also bumps the target cell resource balance (visible via get_cell / get_changes).

get_pending_transportsA

List your paid transports awaiting on-chain payment — actions whose source resource is already escrowed and whose signature is still held server-side. Each entry shows the $CPU cost, deadline, and whether it is still resumable. Finish paying a resumable one with resume_transport <jobId>. An expired one is refunded automatically within about a minute of its deadline — just wait for it to clear; starting the same route again while it is still pending is rejected.

resume_transportA

Finish paying a pending paid transport (from get_pending_transports) by its jobId: it re-submits the already-issued signature on-chain (auto-approving $CPU first), without creating a new transport or re-escrowing. Safe to retry — it checks the signature deadline and the on-chain replay guard, and reports if the action is already paid or has expired.

get_marketsA

Scout the marketplace: one compact row per (Hub, resource) with open-vs-incoming lot counts, lowest price, and distance. The recommended first look at what is for sale and where — then drill into specific lots with list_lots. Public read; supports hub / resourceId filters and an optional zone (aroundTokenId or centerX/centerY + radius).

list_lotsA

Browse marketplace lots with filters (hub, resourceId, seller, minPrice/maxPrice), sort (price_asc | recent | nearest), pagination (limit ≤ 200, offset), and an optional zone (aroundTokenId or centerX/centerY + radius in hex steps). availability defaults to open (buyable now); use incoming for en-route lots or all. Public read — start with get_markets for a compact overview, then drill in here.

get_lotA

Inspect a single lot by id — resource, remaining/listed units, price per unit, Hub location, seller, and lifecycle state. Public read.

list_my_lotsA

List the lots you have created, across all lifecycle states (optionally filtered by state). Requires a session. Use this to find your lotIds and track create / cancel progress.

quote_buyA

Preview the cost of buying from a lot — non-destructive, reserves nothing. Requires a session. Pass chain = [hub, ...waypoints, your destination cell] for the exact total buy_lot would charge (seller price + transit fees + burn); omit it for a seller-only estimate (price × value). Use this before buy_lot, which reserves units immediately.

create_lotA

List units of a resource for sale at a Hub. Requires a session — call authenticate first. Transports the goods from your source cell to the listing Hub (chain = [source, ...waypoints, hub]) and opens a lot at pricePerUnit $CPU. A route over only your own cells is free and starts immediately; a route through a foreign Hub costs $CPU — this tool then auto-approves the $CPU spend once and submits the on-chain payment. Returns the lotId — track it with list_my_lots / get_lot. While a prior paid listing of the same resource from the same cell is still awaiting payment, a new one is rejected — finish or let the pending one lapse (a lapsed escrow is auto-refunded within ~a minute).

buy_lotA

Buy units from an OPEN lot, delivered to your own cell. Requires a session. chain = [hub, ...waypoints, your destination cell] (the Hub holding the lot → your revealed cell). Always paid in $CPU (seller price + any foreign-hub transit fees) — auto-approves the spend once and submits the on-chain payment. NOTE: this reserves the units immediately (no dry-run) — preview the exact cost first with quote_buy. Track delivery with list_my_transports / get_lot. If you already have a pending buy on this lot awaiting payment, a new one is rejected — retry once it settles or lapses (a lapsed one is auto-refunded within ~a minute).

cancel_lotA

Withdraw an OPEN lot; unsold units return to you. Requires a session. Pass chain = [hub, ...waypoints, your destination cell] (the return shipment). A return through a foreign Hub costs $CPU — auto-approved and paid on-chain — otherwise it is free. Track with list_my_lots / get_lot. A DRAFT lot (one still en route to its Hub, never opened) cannot be cancelled manually — it auto-reverts once its signature lapses; just wait for it to clear.

quote_swapA

Preview an ETH↔$CPU swap without committing: returns the expected output from the Uniswap v4 Quoter (already net of the pool fee) and the minimum you would receive after slippage (a percent, e.g. 0.5 = 0.5%). It has no side effects — no approval, no transaction. Use it before swap to size the trade.

swapA

Swap between native ETH and $CPU on the game token pool (Uniswap v4), in either direction: sell: "ETH" buys $CPU, sell: "CPU" sells it for ETH. amount is how much of the sold token to spend. Preview the result first with quote_swap. The swap is exact-input: you spend amount and receive at least the quoted output minus slippage (a percent, e.g. 0.5 = 0.5%). Selling $CPU auto-approves it (via Permit2) once before the first swap; the trade is submitted on-chain and this waits for confirmation. A 1% pool fee applies.

quote_mintA

Preview a primary-market land mint without committing: reads the live OpenSea SeaDrop public drop and returns the per-cell ETH price and the total for quantity cells, plus the drop window and per-wallet limit. It has no side effects — no transaction. Use it before mint_cell to size the buy and confirm the drop is active.

mint_cellA

Mint new land cells on the primary market, straight from the collection’s OpenSea SeaDrop public drop — paid in native ETH, no $CPU involved. quantity cells are minted to your connected wallet at the on-chain drop price; preview the exact ETH cost first with quote_mint. The mint is submitted on-chain and this waits for confirmation. Check get_balance for enough ETH (mint price × quantity, plus gas) before calling. For existing cells on the secondary market, use OpenSea listings instead (see the land contract link in the server instructions).

get_balanceA

Show the wallet's spendable funds: $CPU (the game currency — paid for reveal, build, craft, transport, and trade) and the native gas balance, each human-readable and in wei. Check this before paid actions to avoid failed or stranded payments. Requires a configured wallet (no session needed).

withdrawA

Cash out a cell’s wCPU (resource id 1, the Tier-5 CPU Forge output) into the on-chain $CPU token in your wallet, 1:1. Requires a session — call authenticate first. Pass the amount in whole wCPU units (e.g. "100"), at most 1,000,000 per withdraw. This debits the wCPU from the cell and mints $CPU straight to your wallet, so no $CPU approve is needed; it submits the on-chain transaction and waits for its confirmation, then reports the tx hash — check the credited $CPU with get_balance. You can have only one withdraw in flight at a time. If the on-chain step is interrupted, re-run withdraw with the same tokenId and amount to finish it — your wCPU is held until then. wCPU lives on the cell, not your wallet: selling or transferring the cell takes its wCPU with it, so withdraw before you sell.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sodiqit/cpu-game-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server