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
cpu_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).

cpu_get_game_configA

Return the game rulebook for the active network: the resource catalog (id → name), the building catalog (name, kind — extractor/crafter/hub — and $CPU cost; the full JSON also carries each building’s mine/craft bindings and build time), reveal-cost params (first reveal free; re-reveal price), the on-chain contract addresses, and the recipe count (use cpu_list_recipes for the full recipe graph). A free reference read — call it once to ground planning. No session needed.

cpu_get_mapA

Read the live game world (public, background-synced). The world is a finite sphere of 48,990 cells keyed by tokenId — no coordinates: navigate via each cell’s neighbors (6 adjacent, 5 next to a pentagon vertex; owned/other/empty, empty = unminted) and cpu_next_hops; pos {face,i,j} is only a rough hint (wraps at face seams). Returns a summary, a resourceIndex of your cells, and per-resource storage (used/cap/full; a box with room for less than one whole cycle halts that resource’s production, cap null = uncapped). Scopes: mine | around (grid radius from aroundTokenId) | cells | all | summary. version/updated are epoch ms, serverTime/startAt unix seconds. server.reachable false means actions will fail; your to-do list is cpu_get_attention.

cpu_get_cellA

Inspect one cell in depth (any owner — the map is public). Returns the cell, its neighbours expanded as full cell states (the immediate surroundings of a target), and distanceFromMine — the grid distance (BFS steps) to your nearest cell (null if your wallet is unknown or it is farther than 50 steps). Each resource carries a storage box (used/cap/reserved/full) and the active process a stalled flag — true once the room holds less than one whole cycle of its output, which halts production before the box reads full, until you offload. For broader situational awareness use cpu_get_map.

cpu_get_changesA

Get only the cells that changed since a given version — react to other players without re-reading the whole map. Pass the version from a previous map response; the reply carries a new version for next time. Omit sinceVersion (or 0) to get everything. Also carries server: { reachable }: false means the API is unreachable, so any action (build/reveal/transport/trade) will fail — keep polling cpu_get_changes rather than retrying actions; the client reconnects in the background, and once reachable flips true you can act again (after an outage, call once with sinceVersion 0 for the full picture).

cpu_get_attentionA

Owner-scoped roll-up of cells worth attention, most time-sensitive first — so you skip scanning the whole map. Flags, each with a severity: stalled mining/craft (the output box has room for less than one whole cycle, so nothing settles and the wait burns — critical); a near-full warehouse on an actively-produced resource, a job that has run its scheduled cycles and now idles the cell until claimed, an arrived delivery ready to finalize, or an extractor on a depleted deposit (warning); revealed-but-unbuilt cells, and cells in a post-demolish rebuild cooldown (info — on a demolish_cooldown item arrivalAt marks when rebuild reopens). A finished job loses nothing by waiting, unlike a stall — it only holds the cell idle. Items are purely descriptive (cell, resource, used/cap breakdown, deposit, delivery) and suggest no action — you decide. Your own cells need an authenticated wallet; pass owner to scout another player read-only (all data is public). minSeverity filters by urgency. If the deliveries endpoint is down, map items still return and a note says so.

cpu_revealA

Reveal the deposits of a cell you own (call cpu_authenticate first). Sends an on-chain Cell tx requesting Pyth Entropy randomness, paying the fee in ETH — keep some ETH. First reveal is free; a re-reveal needs all deposits depleted and costs $CPU (auto-approved once). Deposits land asynchronously — read with cpu_get_cell.

cpu_buildA

Place a building on a revealed Land cell you own (needs a session — cpu_authenticate first). Pick a buildingType from the catalog (cpu_get_game_config): an extractor mines a raw deposit, a crafter runs a recipe, the hub routes transport/trade. Costs $CPU (some buildings also consume refined resources from the cell's warehouse); the tool auto-approves the $CPU spend once, sends the on-chain place, and waits for confirmation. Building takes time — it is not usable until it finishes. Once ready, start an extractor with cpu_start_mining or a crafter with cpu_craft. A cell holds one building: re-running build on the same building is a safe no-op; to switch buildings cpu_demolish first (a just-demolished cell is locked from rebuilding until its cooldown ends). Inspect the result with cpu_get_cell.

cpu_demolishA

Remove the building from a Land cell you own, clearing it for a different building. Requires a session — call cpu_authenticate first. Not free: it burns a fraction of the building’s build cost in $CPU (auto-approved) and consumes some of its build materials from the cell’s warehouse (no refund) — see each building's demolishCost in cpu_get_game_config for the exact amounts. The cell must have no active mining or craft process — a craft frees its slot once fully claimed, but a mining run only ends when its deposit is exhausted, so a mining extractor cannot be demolished mid-run; a hub can only be demolished when it is not mid-route or anchoring open trade lots. Deposits and other warehouse balances are preserved. Afterward the plot is locked from rebuilding for the building's build time (its demolishFinishAt); cpu_get_cell/cpu_get_attention surface the cooldown.

cpu_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 cpu_craft to pick a recipe and see what a paid forge will cost up front.

cpu_craftA

Run a craft recipe on a cell you own (refine raw resources, or forge $WCPU). Requires a session — call cpu_authenticate first; discover recipes with cpu_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 cpu_get_craft_status and bank matured batches with cpu_claim_craft.

cpu_get_craft_statusA

Get the craft job on a cell: its recipe, status (active / pending payment / stalled), how far through its schedule it is (completedBatches of batches), what is claimable right now, when the next batch matures and when the run ends. A craft stalls once any output box has room for less than one whole batch — batches settle whole or not at all, so nothing banks until you offload a blocked output (blockedResourceIds), and the wait resets while the schedule survives. isFinished means the run is done and now only holds the cell's process slot: claim it to bank the rest and free the cell. Timestamps are unix seconds on the same clock as serverTime. Public — works for any tokenId. This is the source of craft progress; bank matured batches with cpu_claim_craft.

cpu_claim_craftA

Bank every matured craft batch on a cell you own into its resource balance. Requires a session — call cpu_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 cpu_get_craft_status.

cpu_start_miningA

Start a bounded extraction job on a cell you own that holds a finished extractor. Requires a session — call cpu_authenticate first. Pass the targetResourceId to mine — it must be a resource the extractor can mine (see cpu_get_game_config) with an active deposit on the cell; omit it when the extractor mines a single resource. Costs no $CPU. The building must have finished construction — building takes time after cpu_build. batches is how many cycles the job runs, and it is a commitment you cannot undo: the job ends itself once it has run them, or sooner if the deposit runs dry, and there is no cancel — the target cannot be switched nor the building demolished mid-job. It never overruns its schedule, so coming back late banks exactly what you booked and no more. Until the job ends it holds the cell's only process slot, so nothing can be crafted there; claiming a finished job frees the slot. Size batches against the cycle length in cpu_get_game_config and the deposit in cpu_get_cell — scheduling past the deposit just ends early. Track it with cpu_get_mining_status and bank matured cycles with cpu_claim_mining.

cpu_get_mining_statusA

Read a cell's mining job: whether an extractor is active, which resource it mines, its yield per cycle and cycle length, how far through its schedule it is (completedBatches of batches), the units and whole cycles claimable right now, when the next cycle matures and when the job ends, the remaining deposit, and whether it is stalled. Mining matures in whole cycles — a cycle in progress banks nothing until it completes — and settles in whole cycles too: if one full cycle of output does not fit, nothing settles. That is a stall, and it begins before the box reads full. A stall burns time (the schedule survives, the wait does not), so offload to resume — transport it out, sell via create_lot, craft with it, or withdraw wCPU; a null cap means the warehouse is uncapped. isFinished means the job has run its schedule and will produce nothing more: claim it to bank the rest and free the cell for another job or a craft. Timestamps are unix seconds on the same clock as serverTime. Public — works for any cell, no session required. The owner banks matured cycles with cpu_claim_mining.

cpu_claim_miningA

Bank every matured mining cycle an extractor has produced on a cell you own into its resource balance. Requires a session — call cpu_authenticate first. With an active job, claiming when nothing new has matured is a harmless no-op; claiming on a cell that has no extractor is an error. A cycle in progress matures nothing until it completes, and only whole cycles settle — if a full cycle of output does not fit, nothing banks and the wait resets. Claiming does not stop a running job. Claiming one that has run its schedule (or drained its deposit) retires it and frees the process slot, so the cell can take another job or a craft. Check what is available first with cpu_get_mining_status.

cpu_route_networkA

The road map of the world (read-only): every legal waypoint — your revealed cells and every finished Hub — as graph nodes (owner, hub flag, ready build state, the exact per-unit transit fee for your resourceId cargo, pos, connected-component id) plus every hop the contract would accept as edges (within radius(a)+radius(b)−1 grid steps; default balance: own↔own 1 = adjacent only, own↔hub 3, hub↔hub 5). A Hub counts only once its construction finishes: an unfinished one grants no hub reach and charges no fee, and a foreign one is not a node at all — your own cells stay nodes while they build, just with normal reach (ready: null = nothing built, false = under construction, true = finished). Foreign cells are never nodes: even a single foreign cell between two plain cells is a WALL — only a finished Hub reaches across. Different component ids show exactly that — no chain crosses today, goods stop at the border. Bridging is a strategic decision: a border Hub (it still needs an eligible landing point within reach on the far side), buying land across, or a detour — the sphere is closed, so a wall must encircle to truly seal. Pass from/towards to annotate each node with grid distances (a potential field to reason over). Routing over this map is YOUR job: pick the chain, then verify with cpu_quote_transport. WHEN: the heavy read — plan a journey or a big replan; for point checks while executing use the cheap cpu_next_hops.

cpu_next_hopsA

Survey the legal next waypoints from a cell (read-only). Lists every eligible waypoint — your revealed cells and every finished Hub — within one hop under the reach rule: hop ≤ radius(from)+radius(to)−1 grid steps (default balance: own↔own 1 = adjacent only, own↔hub 3, hub↔hub 5). A Hub counts only once its construction finishes: until then it grants no hub reach and charges no fee, and a foreign one is no waypoint at all — fromReady says whether your own origin is still building, which is why its reach may be smaller than you expect. Foreign cells are never waypoints, so even a single foreign cell between two plain cells is a WALL — only a finished Hub reaches across; empty hops means goods can only be hauled up to here. Facts per candidate: hop distance, owner, hub flag, ready build state, the exact per-unit transit fee for your resourceId cargo, and — with towards — the remaining grid distance (a compass, not a route). Planning is YOUR job: pick each hop yourself (cheap vs short vs whose hub you trust), chain them into path, and verify with cpu_quote_transport. To break a wall: build a border Hub (it still needs an eligible landing cell within reach on the far side), buy land across, or go around. WHEN: the cheap point check — call it right before each leg and after cpu_get_changes shows movement (hubs get demolished, fees change while goods travel); replan via cpu_route_network only when a local fix is impossible.

cpu_quote_transportA

Preview a transport route (a waypoint chain of tokenIds) without committing: returns the $CPU transit fee (decimal), the summed grid distance, and the arrival timestamp. Read-only on-chain view with no side effects. It also validates the route, surfacing the rejection reason if the chain is invalid (hop out of range, unrevealed or ineligible waypoint). Scout waypoints with cpu_next_hops; use this before cpu_transport.

cpu_transportA

Move a resource between cells along a waypoint chain of tokenIds, on-chain (needs a session — cpu_authenticate first). One atomic move: debits the source, pays the $CPU transit fee for every foreign Hub on the route (auto-approved once) plus gas, and escrows a time-delayed delivery. Every waypoint must be revealed and yours-or-a-finished-Hub; each hop must be within radius(from)+radius(to)−1 grid steps (default balance: own↔own 1 = adjacent only, own↔hub 3, hub↔hub 5). Recommended flow: cpu_next_hops (scout waypoints) → chain them yourself → cpu_quote_transport (verify fee/ETA) → cpu_transport. Returns the deliveryId and arrival time; the goods credit to the target only after arrival, when you call cpu_finalize_delivery (cpu_list_my_transports shows what is ready). A route over only your own cells pays no fee.

cpu_list_my_transportsA

List your deliveries (the ones you paid for), optionally filtered: all, in_transit, delivered, or ready_to_finalize. Each entry shows source/target, amount, arrival time, and whether it is delivered or ready to finalize. Use it to find deliveries to complete with cpu_finalize_delivery.

cpu_get_transport_statusA

Get one delivery by its on-chain deliveryId: source and target cells, resource and amount, arrival time, whether it has been delivered, and whether it is ready to finalize. Reads the deliveries projection.

cpu_finalize_deliveryA

Finalize one or more arrived deliveries by their on-chain deliveryIds, crediting each to its target cell. Permissionless and on-chain (you pay gas). A delivery can only be finalized once its arrival time has passed — see cpu_list_my_transports (ready_to_finalize). Requires a session — call cpu_authenticate first.

cpu_get_marketsA

Scout the marketplace: one compact row per (Hub, resource) with open-vs-incoming lot counts, lowest price, distance, and the hub's live sale-fee percent for that resource (liveSaleFeePercent, enriched from the local world map — advisory, may trail the chain; null when the rate is unknown, i.e. the map has no read on the hub or it isn't serving sale fees yet). The recommended first look at what is for sale and where — compare hubs by fee in one call, then drill into specific lots with cpu_list_lots. Public read; supports hub / resourceId filters and an optional zone (aroundTokenId + radius in grid steps).

cpu_list_lotsA

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

cpu_get_lotB

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

cpu_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.

cpu_quote_buyA

Preview the cost of buying from a lot — read-only, reserves nothing, sends no tx (needs a session). Pass chain = [hub, ...waypoints, your destination cell] for the exact total cpu_buy_lot would charge; omit it for a seller-only estimate (pricePerUnit × value). Returns decimal $CPU: sale (value × pricePerUnit, exact) + transitFee, summed as total. The sale split (the hub sale fee + the burn) comes out of the seller proceeds, not on top — as a buyer you pay exactly sale for the goods, so it does not change your total. cpu_buy_lot re-quotes transit on-chain, so that part can move slightly and it authorizes ~10% over as headroom (a ceiling, not an extra charge). Use before cpu_buy_lot.

cpu_create_lotA

List units of a resource for sale at a Hub, on-chain (needs a session — cpu_authenticate first). One atomic tx: ships the goods from your source cell to the listing Hub (chain = [source, ...waypoints, hub]) and opens a lot at pricePerUnit $CPU, plus gas. A route through a foreign Hub costs a $CPU transit fee (auto-approved once); over only your own cells it is free. The hub owner's current sale-fee rate is frozen into the lot and is later carved out of the seller proceeds on every sale (the buyer still pays exactly price × value). Optionally cap it with maxSaleFeePercent; omit it to accept the live rate at listing (read on-chain) — a last-moment rate raise then reverts the listing instead of freezing a worse rate in. The lot is DELIVERING and becomes buyable (OPEN) only after its escrow arrives — call cpu_finalize_delivery on the returned deliveryId (or wait). Returns the lotId and the frozen saleFeePercent; track with cpu_list_my_lots / cpu_get_lot.

cpu_buy_lotA

Buy units from an OPEN lot, delivered to your own cell, on-chain (needs a session). chain = [hub holding the lot, ...waypoints, your destination cell]. One atomic $CPU tx: seller price (value × pricePerUnit) + any foreign-hub transit fee, plus gas; the first buy auto-approves the sale exactly and the transit fee with ~10% headroom (a ceiling for on-chain fee drift, not a double charge). Preview the exact cost with cpu_quote_buy. Goods ship to your cell and credit only after arrival, when you cpu_finalize_delivery the returned deliveryId. Buying your own lot is allowed.

cpu_cancel_lotA

Withdraw an OPEN lot; the unsold units return to you, on-chain. Requires a session. Pass chain = [hub, ...waypoints, your destination cell] for the return shipment (required). One atomic tx: a return through a foreign Hub costs a $CPU transit fee (auto-approved), otherwise it is free; you also pay gas. The units ship back and are credited only after they arrive and you cpu_finalize_delivery on the returned deliveryId. Track with cpu_list_my_lots / cpu_get_lot.

cpu_set_sale_feeA

Set the sale-fee rate for one resource on a Hub you own, on-chain (needs a session — cpu_authenticate first). The rate is a percent of every sale of that resource settled on your hub (0–50, 0.01 granularity), carved out of the seller proceeds; set 0 to list that resource for free. One resource per call (loop for several). The rate applies only to lots listed after it lands — open lots keep the rate frozen at their own listing. Settable on a hub still under construction, so it is already in place when the hub becomes Ready. Reverts if you do not own the hub or the rate exceeds the 50% cap. Returns the confirmed rate and tx hash.

cpu_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 cpu_swap to size the trade.

cpu_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 cpu_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.

cpu_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 cpu_mint_cell to size the buy and confirm the drop is active.

cpu_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 cpu_quote_mint. The mint is submitted on-chain and this waits for confirmation. Check cpu_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).

cpu_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 a human-readable decimal. Check this before paid actions to avoid failed or stranded payments. Requires a configured wallet (no session needed).

cpu_withdrawA

Cash out a cell’s wCPU (resource id 1, the CPU Forge output) to the on-chain $CPU token in your wallet, 1:1 (needs a session — cpu_authenticate first; you must own the cell). Pass the amount in whole wCPU units up to the cell’s wCPU balance; it debits the cell and mints $CPU to your wallet (no approve needed), waits for confirmation, and returns the tx hash — check the result with cpu_get_balance. wCPU lives on the cell, so selling or transferring the cell takes it along: 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/project-cpu-mcp'

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