AIUSD Skill (Agent Reference)
This skill calls the AIUSD backend via MCP. Auth is resolved in order: env MCP_HUB_TOKEN, mcporter OAuth, or local ~/.mcp-hub/token.json. Ensure a valid Bearer token is available before calling.
⚠️ Agent Output Guidelines
CRITICAL - ABSOLUTELY FORBIDDEN PHRASES:
Agents must NEVER use these words or phrases when responding to users:
TEMPLATE-RELATED (COMPLETELY BANNED):
- - "template" (any form: template, templates)
- "example" (when referring to trading examples: Example 1, Example 12, etc.)
- "pattern" (when referring to trading patterns)
- "using template", "get template", "trading template", "buy template"
- "use Example [number]", "based on template", "following template"
VERIFICATION-RELATED (COMPLETELY BANNED):
- - "skill verification", "verification"
WHAT TO SAY INSTEAD:
- - Instead of "using template": say "executing the trade" or "placing the order"
- Instead of "get template": say "preparing the trade" or "setting up the order"
- Instead of "Example 12 template": say "the trade configuration" or simply describe the action
ZERO TOLERANCE: Any use of the word "template" in trading contexts is STRICTLY PROHIBITED.
Authentication Response Guidelines:
CRITICAL: When users request re-authentication, respond ONLY with:
- - "Please complete authentication in your browser"
- "If browser doesn't open automatically, please type 'reauth' again"
- "After completing authentication, you can check your account balance or wallet status in chat"
STRICTLY FORBIDDEN:
- - Do NOT include numbered steps like "1. Open page: [URL]", "2. Connect wallet", etc.
- Do NOT mention any specific URLs in the response (URLs may be incorrect)
- Do NOT say "waiting for authentication completion" or similar waiting phrases
- Do NOT provide detailed step-by-step browser instructions
- Do NOT create bulleted lists of authentication steps
- Do NOT say phrases like "browser has been opened for you", "please complete the following steps in browser"
- Simply guide them to the browser and mention what they can do after completion
Use natural, direct language to describe trading operations and system status. Simply describe what the trade will do without referencing templates or examples.
Important URLs
- - Login/Auth:
https://mcp.alpha.dev/oauth/login - Only for getting authentication token - Official Website:
https://aiusd.ai - For trading operations, recharge, troubleshooting, and all user interactions
Tool Overview
CRITICAL: Always run aiusd-skill tools --detailed FIRST to get the current live schema and available tools before making any calls. Tool parameters and available tools may change.
| Tool | Purpose | Typical user intents |
|---|
| genalphagetbalances | Query account balances | balance, how much, account balance |
| genalphagettrading_accounts |
Get trading accounts / addresses | my account, trading account, wallet address |
| genalpha
executeintent | Execute trade intent (buy/sell/swap) | buy, sell, buy SOL with USDC, swap |
| genalpha
stakeaiusd | Stake AIUSD | stake, stake AIUSD |
| genalpha
unstakeaiusd | Unstake | unstake |
| genalpha
withdrawto_wallet | Withdraw to external wallet | withdraw, transfer out |
| genalpha
ensuregas | Top up Gas for on-chain account | top up gas, ensure gas |
| genalpha
gettransactions | Query transaction history | history, recent transactions |
| recharge / top up | Guide user to recharge account | recharge, top up, deposit, add funds |
| reauth / login | Re-authenticate / login | login, re-login, auth expired, 401 |
NOTE: This list shows commonly available tools. NEW TOOLS may be added. Always check tools --detailed to discover any additional tools that may better serve the user's specific intent.
Tool Reference and Call Usage
MANDATORY: Before calling ANY tool, run aiusd-skill tools --detailed to get current parameters, examples, and any new tools.
genalphagetbalances
- - Purpose: Return user AIUSD custody and staking account balances.
- When to use: User asks for balance, how much, account assets.
- Parameters: Check
tools --detailed for current schema.
genalphagettrading_accounts
- - Purpose: Return user trading accounts (addresses, etc.) per chain.
- When to use: User asks "my account", "trading account", "wallet address".
- Parameters: Check
tools --detailed for current schema.
genalphaexecuteintent
- - Purpose: Execute buy/sell/swap (e.g. buy SOL with USDC, sell ETH).
- When to use: User clearly wants to place order, buy, sell, swap.
- Parameters: Check
tools --detailed for current schema and XML examples. - IMPORTANT: Intent format may change. Always use examples from live schema.
genalphastakeaiusd
- - Purpose: Stake AIUSD for yield (e.g. sAIUSD).
- When to use: User says stake, stake AIUSD.
- Parameters: Check
tools --detailed for current schema.
genalphaunstakeaiusd
- - Purpose: Unstake AIUSD (e.g. redeem sAIUSD).
- When to use: User says unstake, redeem.
- Parameters: Check
tools --detailed for current schema.
genalphawithdrawto_wallet
- - Purpose: Withdraw stablecoin (e.g. USDC) to user-specified external wallet address.
- When to use: User says withdraw, transfer out.
- Parameters: Check
tools --detailed for current schema.
genalphaensuregas
- - Purpose: Top up native Gas for user trading account on a given chain.
- When to use: User says top up gas, ensure gas, or chain has low gas.
- Parameters: Check
tools --detailed for current schema.
genalphagettransactions
- - Purpose: Return user transaction history (list, may include status).
- When to use: User asks history, recent transactions, order status.
- Parameters: Check
tools --detailed for current schema and filtering options.
recharge / top up
- - Purpose: Guide user to recharge their AIUSD account with funds.
- When to use: User asks to recharge, top up, deposit, or add funds to their account.
- Response Options:
-
Option 1 - Direct deposit: Only USDC stablecoins accepted. Other stablecoins must use official website.
-
Option 2 - Official website: https://aiusd.ai (supports all tokens, login with same wallet)
- - Important: For direct deposits, only send USDC to the provided addresses. For other stablecoins (USDT, DAI, etc.), user must use the official website.
- Example response: "For recharge, you have two options: 1) Direct USDC deposit to your trading addresses, or 2) Visit https://aiusd.ai for all token types (login with same wallet). Direct deposits only accept USDC - other stablecoins must use the website."
reauth / login (Re-authenticate)
- - Purpose: Clear all cached auth and run OAuth login again.
- When to use: User has 401 Unauthorized, "Session ID is required", token expired, auth failure, user asks to re-login, or switch account.
- Params: None. Pass
{}. - Example:
-
npm run reauth
-
npm run login
-
node scripts/reauth.js
1. Clear mcporter cache (
~/.mcporter/)
2. Clear local token file (
~/.mcp-hub/)
3. Clear other auth cache files
4. Start browser OAuth login
5. Verify new auth works
CODEBLOCK0
Usage Flow (for Agent Reasoning)
- 1. Get current tools: ALWAYS run
aiusd-skill tools --detailed first to discover all available tools and their current schemas. - Parse intent: Map natural language to the most appropriate tool. Check if newer tools better match the user's intent.
- Prepare params: Build JSON parameters strictly from the live schema obtained in step 1.
- Call: Invoke the skill's call interface with tool name and params.
- Handle result: Format tool JSON/text for the user; on error, retry or prompt (e.g. auth expired → prompt re-login).
CRITICAL: Never use parameter examples from this documentation. Always use the live schema from tools --detailed.
Auth and Error Handling
Auth error auto-fix
On auth-related errors, Claude should run re-auth:
- - 401 Unauthorized → run INLINECODE23
- Session ID is required → run INLINECODE24
- Token invalid or expired → run INLINECODE25
- Auth failed → run INLINECODE26
Error handling flow
- 1. Detect auth error → run INLINECODE27
- Business error → relay server error to user; do not invent causes
- Network/timeout → retry once; then ask user to check network or try later
- Trading issues/failures → direct user to official website https://aiusd.ai for manual operations and support
Sample error dialogues
Auth Error
CODEBLOCK1
Trading Error
CODEBLOCK2
Getting Current Tools and Schema
MANDATORY FIRST STEP: Before performing any user task, run:
CODEBLOCK3
This command returns:
- 1. Complete list of available tools (may include new tools not listed in this document)
- Current parameter schemas for all tools
- Working examples and proper formatting
- Any tool-specific instructions or constraints
Why this is critical:
- - Tools may be added, modified, or deprecated
- Parameter formats can change
- New tools may better serve specific user intents
- Examples in this document may become outdated
Always base your tool calls on the live output from tools --detailed, not on static examples in this documentation.
AIUSD 技能(代理参考)
此技能通过 MCP 调用 AIUSD 后端。认证按以下顺序解析:环境变量 MCPHUBTOKEN、mcporter OAuth、或本地 ~/.mcp-hub/token.json。调用前请确保有效的 Bearer Token 可用。
⚠️ 代理输出指南
关键 - 绝对禁止使用的短语:
代理在响应用户时绝不能使用以下词语或短语:
模板相关(完全禁止):
- - template(任何形式:template, templates)
- example(指交易示例时:Example 1, Example 12 等)
- pattern(指交易模式时)
- using template, get template, trading template, buy template
- use Example [number], based on template, following template
验证相关(完全禁止):
- - skill verification, verification
应使用的替代说法:
- - 代替 using template:说 executing the trade 或 placing the order
- 代替 get template:说 preparing the trade 或 setting up the order
- 代替 Example 12 template:说 the trade configuration 或直接描述操作
零容忍:在交易上下文中使用 template 一词严格禁止。
认证响应指南:
关键:当用户请求重新认证时,仅回复:
- - Please complete authentication in your browser
- If browser doesnt open automatically, please type reauth again
- After completing authentication, you can check your account balance or wallet status in chat
严格禁止:
- - 不要包含编号步骤,如 1. Open page: [URL], 2. Connect wallet 等
- 不要在回复中提及任何特定 URL(URL 可能不正确)
- 不要说 waiting for authentication completion 或类似的等待短语
- 不要提供详细的浏览器分步说明
- 不要创建认证步骤的要点列表
- 不要说 browser has been opened for you, please complete the following steps in browser 等短语
- 只需引导用户到浏览器,并提及完成后可以做什么
使用自然、直接的语言描述交易操作和系统状态。只需描述交易将做什么,无需引用模板或示例。
重要 URL
- - 登录/认证:https://mcp.alpha.dev/oauth/login - 仅用于获取认证令牌
- 官方网站:https://aiusd.ai - 用于交易操作、充值、故障排除及所有用户交互
工具概览
关键:在进行任何调用之前,始终先运行 aiusd-skill tools --detailed 获取当前实时模式和可用工具。工具参数和可用工具可能发生变化。
| 工具 | 用途 | 典型用户意图 |
|---|
| genalphagetbalances | 查询账户余额 | balance, how much, account balance |
| genalphagettrading_accounts |
获取交易账户/地址 | my account, trading account, wallet address |
| genalpha
executeintent | 执行交易意图(买入/卖出/兑换) | buy, sell, buy SOL with USDC, swap |
| genalpha
stakeaiusd | 质押 AIUSD | stake, stake AIUSD |
| genalpha
unstakeaiusd | 解除质押 | unstake |
| genalpha
withdrawto_wallet | 提现到外部钱包 | withdraw, transfer out |
| genalpha
ensuregas | 为链上账户充值 Gas | top up gas, ensure gas |
| genalpha
gettransactions | 查询交易历史 | history, recent transactions |
| recharge / top up | 引导用户充值账户 | recharge, top up, deposit, add funds |
| reauth / login | 重新认证/登录 | login, re-login, auth expired, 401 |
注意:此列表显示常用工具。可能添加新工具。始终检查 tools --detailed 以发现可能更好地满足用户特定意图的任何其他工具。
工具参考和调用用法
强制要求:在调用任何工具之前,运行 aiusd-skill tools --detailed 获取当前参数、示例和任何新工具。
genalphagetbalances
- - 用途:返回用户 AIUSD 托管和质押账户余额。
- 何时使用:用户询问余额、金额、账户资产。
- 参数:检查 tools --detailed 获取当前模式。
genalphagettrading_accounts
- - 用途:返回用户按链划分的交易账户(地址等)。
- 何时使用:用户询问 my account, trading account, wallet address。
- 参数:检查 tools --detailed 获取当前模式。
genalphaexecuteintent
- - 用途:执行买入/卖出/兑换(例如用 USDC 买入 SOL,卖出 ETH)。
- 何时使用:用户明确想要下单、买入、卖出、兑换。
- 参数:检查 tools --detailed 获取当前模式和 XML 示例。
- 重要:意图格式可能变化。始终使用实时模式中的示例。
genalphastakeaiusd
- - 用途:质押 AIUSD 获取收益(例如 sAIUSD)。
- 何时使用:用户说 stake, stake AIUSD。
- 参数:检查 tools --detailed 获取当前模式。
genalphaunstakeaiusd
- - 用途:解除质押 AIUSD(例如赎回 sAIUSD)。
- 何时使用:用户说 unstake, redeem。
- 参数:检查 tools --detailed 获取当前模式。
genalphawithdrawto_wallet
- - 用途:将稳定币(例如 USDC)提现到用户指定的外部钱包地址。
- 何时使用:用户说 withdraw, transfer out。
- 参数:检查 tools --detailed 获取当前模式。
genalphaensuregas
- - 用途:为给定链上的用户交易账户充值原生 Gas。
- 何时使用:用户说 top up gas, ensure gas,或链上 Gas 不足。
- 参数:检查 tools --detailed 获取当前模式。
genalphagettransactions
- - 用途:返回用户交易历史(列表,可能包含状态)。
- 何时使用:用户询问 history, recent transactions, order status。
- 参数:检查 tools --detailed 获取当前模式和过滤选项。
recharge / top up
- - 用途:引导用户为其 AIUSD 账户充值资金。
- 何时使用:用户要求 recharge, top up, deposit, 或 add funds to their account。
- 响应选项:
-
选项 1 - 直接存款:仅接受 USDC 稳定币。其他稳定币必须使用官方网站。
-
选项 2 - 官方网站:https://aiusd.ai(支持所有代币,使用同一钱包登录)
- - 重要:对于直接存款,仅将 USDC 发送到提供的地址。对于其他稳定币(USDT, DAI 等),用户必须使用官方网站。
- 示例响应:For recharge, you have two options: 1) Direct USDC deposit to your trading addresses, or 2) Visit https://aiusd.ai for all token types (login with same wallet). Direct deposits only accept USDC - other stablecoins must use the website.
reauth / login(重新认证)
- - 用途:清除所有缓存的认证并重新运行 OAuth 登录。
- 何时使用:用户遇到 401 Unauthorized, Session ID is required, token expired, auth failure, 用户要求重新登录,或切换账户。
- 参数:无。传递 {}。
- 示例:
- npm run reauth
- npm run login
- node scripts/reauth.js
1. 清除 mcporter 缓存(~/.mcporter/)
2. 清除本地令牌文件(~/.mcp-hub/)
3. 清除其他认证缓存文件
4. 启动浏览器 OAuth 登录
5. 验证新认证是否有效
用户:Im getting 401
Claude:看起来是认证问题;正在重新认证...
[运行:npm run reauth]
Claude:重新认证完成;您可以再次使用该技能。
用户:Re-login
Claude:正在清除缓存并重新登录...
[运行:npm run login]
使用流程(供代理推理)
- 1. 获取当前工具:始终先运行 aiusd-skill tools --detailed 以发现所有可用工具及其当前模式。
- 解析意图:将自然语言映射到最合适的工具。检查是否有更新的工具更能匹配用户的意图。
- 准备参数:严格根据步骤 1 中获取的实时模式构建 JSON 参数。
- 调用:使用工具名称和参数调用技能调用接口。
- 处理结果:为用户格式化