Skip to main content
Glama

cpu_withdraw

Cash out a cell's wCPU balance for on-chain $CPU at 1:1. If the emission budget is insufficient, only the available portion executes and the rest remains in the cell.

Instructions

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). If the on-chain $CPU emission budget cannot cover the full amount, only a partial tranche executes — up to what remains — and the rest stays in the cell; the result reports the requested and executed amounts separately. 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesHow much wCPU (resource id 1) to convert to on-chain $CPU, 1:1, in whole units (e.g. "100"). Must be greater than 0 and at most the cell’s wCPU balance. See it with get_cell.
tokenIdYesThe tokenId of a cell you own holding wCPU to cash out.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv0.10.0
    • changedInput schema / properties / tokenId / maximum
      Previous value: -48990New value: +29150
  2. First observedv0.8.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, and it delivers: it reveals that the cell is debited, $CPU is minted, no approve is needed, partial execution can occur if the emission budget is insufficient, it waits for confirmation, and it returns a tx hash. This is exemplary transparency for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense but every sentence earns its place: main action, prerequisite, unit constraint, execution behavior, partial-failure case, return result, and lifecycle warning. It is front-loaded with the core action and then layers in essential edge cases without repetition.

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?

Given there is no output schema, the description appropriately explains the return value (tx hash) and the result's split of requested versus executed amounts. It also covers prerequisite authentication, ownership, approval requirements, and balance-check follow-up. Nothing needed for correct invocation 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 meaningful context beyond the schema: amount is in whole wCPU units, must not exceed the cell's balance, and tokenId refers to a cell the caller owns. It reinforces the 1:1 conversion and partial-execution behavior, making parameter usage clear even without opening the schema.

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 description opens with a specific verb and resource: 'Cash out a cell's wCPU ... to the on-chain $CPU token in your wallet, 1:1.' This clearly separates it from sibling tools like cpu_swap, cpu_mint_cell, and cpu_get_balance. The scope is exact and immediately actionable.

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?

The description gives strong contextual usage guidance: it requires cpu_authenticate first, requires cell ownership, and warns to withdraw before selling the cell. It does not explicitly name alternative tools or state when not to use it, but the use case is unambiguous enough that no exclusion is needed.

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

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/projectcpu/project-cpu-mcp'

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