# Convert Ore

> A Claude skill from uptopia-team/legend-of-base-agent-skills.

- **Type:** Skill
- **Install:** `agentstack add skill-uptopia-team-legend-of-base-agent-skills-convert-ore`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [uptopia-team](https://agentstack.voostack.com/s/uptopia-team)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [uptopia-team](https://github.com/uptopia-team)
- **Source:** https://github.com/uptopia-team/legend-of-base-agent-skills/tree/main/skills/convert-ore
- **Website:** https://legend.uptopia.xyz

## Install

```sh
agentstack add skill-uptopia-team-legend-of-base-agent-skills-convert-ore
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# convert-ore

Convert mined ores into gems for the agent's wallet.

## Proxy API

- **Method:** `POST`
- **URL:** `https://agent-public-api.uptopia.xyz/apps/{appId}/agent/inventory/ore/convert`
- **Auth:** JWT (Bearer token)
- **Payment (x402):** No

## Parameters

| Name      | Type   | Required | Source       | Description                              |
|-----------|--------|----------|--------------|------------------------------------------|
| `appId`   | string | yes      | agent config | Application ID                           |
| `jwt`     | string | yes      | agent config | Authorization header                     |
| `userId`  | string | yes      | `.env`       | Game user ID (`USER_ID`) — see Usage Notes |
| `rewards` | object | yes      | user input   | Map of rarity → ore count to convert    |

## Headers

```
Authorization: Bearer 
Content-Type: application/json
```

## Request Body

```json
{
  "userId": "",
  "rewards": {
    "0": 5,
    "3": 2
  }
}
```

`rewards` keys are rarity levels (`"0"`–`"4"`), values are positive integers (ore count to convert).
Only include rarities with ore to convert — omit zeros.

## Wallet Binding

The wallet is bound from the JWT. Do not send `wallet` in the request body; the body contains only `userId` and `rewards`.

## Example Response (200 OK)

```json
{
  "success": true,
  "gems": 1650
}
```

`gems` is the total gems credited from this conversion.

## Error Handling

| HTTP Status | Error Code                   | Cause                                                              |
|-------------|------------------------------|--------------------------------------------------------------------|
| `200`       | —                            | Conversion successful                                              |
| `400`       | `ERROR_INVALID_REQUEST_BODY` | Body empty or not valid JSON                                       |
| `400`       | `ERROR_USER_ID_REQUIRED`     | `userId` missing or empty                                          |
| `400`       | `ERROR_REWARDS_REQUIRED`     | `rewards` missing, empty, rarity out of `0`–`4`, or amount ≤ 0   |
| `401`       | `ERROR_UNAUTHORIZED`         | JWT invalid or expired — re-run `auth-login`                      |
| `5xx`       | —                            | Server error — retry after a short delay                          |

## Usage Notes

- Requires JWT authentication — wallet is derived from the token, not the request body.
- `userId` must be set in `.env` as `USER_ID`; read it from there, never hard-code.
- **How to get `USER_ID`:** open the game → log in with your game account → open **avatar / profile** → use the **copy** button for user id. Format looks like `did:privy:exampleuser000000000000`.
- Call `get-ore-rate` first to preview the gem yield before converting.
- Call `get-inventory` to know available ore counts per rarity.
- The proxy validates all rarity keys before forwarding — any invalid rarity rejects the entire request.
- Key `"reward"` (no `s`) is accepted as an alias for `"rewards"`.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [uptopia-team](https://github.com/uptopia-team)
- **Source:** [uptopia-team/legend-of-base-agent-skills](https://github.com/uptopia-team/legend-of-base-agent-skills)
- **License:** MIT
- **Homepage:** https://legend.uptopia.xyz

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-uptopia-team-legend-of-base-agent-skills-convert-ore
- Seller: https://agentstack.voostack.com/s/uptopia-team
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
