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 可用。
⚠️ 代理输出指南
关键——绝对禁止使用的短语:
代理在回复用户时绝不能使用以下词语或短语:
模板相关(完全禁止):
- - 模板(任何形式:模板、模板们)
- 示例(指交易示例时:示例1、示例12等)
- 模式(指交易模式时)
- 使用模板、获取模板、交易模板、购买模板
- 使用示例[数字]、基于模板、遵循模板
验证相关(完全禁止):
应使用的替代说法:
- - 代替使用模板:说执行交易或下单
- 代替获取模板:说准备交易或设置订单
- 代替示例12模板:说交易配置或直接描述操作
零容忍:在交易上下文中使用模板一词严格禁止。
认证回复指南:
关键:当用户请求重新认证时,仅回复:
- - 请在浏览器中完成认证
- 如果浏览器未自动打开,请再次输入reauth
- 完成认证后,您可以在聊天中查看账户余额或钱包状态
严格禁止:
- - 不要包含编号步骤,如1. 打开页面:[URL]、2. 连接钱包等
- 不要在回复中提及任何特定URL(URL可能不正确)
- 不要说等待认证完成或类似的等待短语
- 不要提供详细的浏览器分步说明
- 不要创建认证步骤的要点列表
- 不要说浏览器已为您打开、请在浏览器中完成以下步骤等短语
- 只需引导他们到浏览器,并提及完成后可以做什么
使用自然、直接的语言描述交易操作和系统状态。只需描述交易将执行的操作,无需引用模板或示例。
重要URL
- - 登录/认证:https://mcp.alpha.dev/oauth/login - 仅用于获取认证令牌
- 官方网站:https://aiusd.ai - 用于交易操作、充值、故障排除和所有用户交互
工具概览
关键:在进行任何调用之前,始终先运行 aiusd-skill tools --detailed 以获取当前的实时模式和可用工具。工具参数和可用工具可能会变化。
| 工具 | 用途 | 典型用户意图 |
|---|
| genalphagetbalances | 查询账户余额 | 余额、有多少、账户余额 |
| genalphagettrading_accounts |
获取交易账户/地址 | 我的账户、交易账户、钱包地址 |
| genalpha
executeintent | 执行交易意图(买入/卖出/兑换) | 买入、卖出、用USDC买SOL、兑换 |
| genalpha
stakeaiusd | 质押AIUSD | 质押、质押AIUSD |
| genalpha
unstakeaiusd | 解除质押 | 解除质押 |
| genalpha
withdrawto_wallet | 提现到外部钱包 | 提现、转出 |
| genalpha
ensuregas | 为链上账户充值Gas | 充值Gas、确保Gas |
| genalpha
gettransactions | 查询交易历史 | 历史、最近交易 |
| recharge / top up | 引导用户充值账户 | 充值、充值、存入、添加资金 |
| reauth / login | 重新认证/登录 | 登录、重新登录、认证过期、401 |
注意:此列表显示常用工具。可能添加新工具。始终检查 tools --detailed 以发现可能更好地满足用户特定意图的任何其他工具。
工具参考和调用用法
强制要求:在调用任何工具之前,运行 aiusd-skill tools --detailed 以获取当前参数、示例和任何新工具。
genalphagetbalances
- - 用途:返回用户AIUSD托管和质押账户余额。
- 何时使用:用户询问余额、有多少、账户资产。
- 参数:检查 tools --detailed 获取当前模式。
genalphagettrading_accounts
- - 用途:返回用户按链划分的交易账户(地址等)。
- 何时使用:用户询问我的账户、交易账户、钱包地址。
- 参数:检查 tools --detailed 获取当前模式。
genalphaexecuteintent
- - 用途:执行买入/卖出/兑换(例如用USDC买SOL、卖ETH)。
- 何时使用:用户明确想要下单、买入、卖出、兑换。
- 参数:检查 tools --detailed 获取当前模式和XML示例。
- 重要:意图格式可能变化。始终使用实时模式中的示例。
genalphastakeaiusd
- - 用途:质押AIUSD获取收益(例如sAIUSD)。
- 何时使用:用户说质押、质押AIUSD。
- 参数:检查 tools --detailed 获取当前模式。
genalphaunstakeaiusd
- - 用途:解除AIUSD质押(例如赎回sAIUSD)。
- 何时使用:用户说解除质押、赎回。
- 参数:检查 tools --detailed 获取当前模式。
genalphawithdrawto_wallet
- - 用途:将稳定币(例如USDC)提现到用户指定的外部钱包地址。
- 何时使用:用户说提现、转出。
- 参数:检查 tools --detailed 获取当前模式。
genalphaensuregas
- - 用途:为给定链上的用户交易账户充值原生Gas。
- 何时使用:用户说充值Gas、确保Gas,或链上Gas不足。
- 参数:检查 tools --detailed 获取当前模式。
genalphagettransactions
- - 用途:返回用户交易历史(列表,可能包含状态)。
- 何时使用:用户询问历史、最近交易、订单状态。
- 参数:检查 tools --detailed 获取当前模式和筛选选项。
recharge / top up
- - 用途:引导用户向AIUSD账户充值资金。
- 何时使用:用户要求充值、充值、存入或向账户添加资金。
- 回复选项:
-
选项1 - 直接存入:仅接受USDC稳定币。其他稳定币必须使用官方网站。
-
选项2 - 官方网站:https://aiusd.ai(支持所有代币,使用同一钱包登录)
- - 重要:对于直接存入,仅将USDC发送到提供的地址。对于其他稳定币(USDT、DAI等),用户必须使用官方网站。
- 示例回复:充值有两种选择:1) 直接存入USDC到您的交易地址,或 2) 访问 https://aiusd.ai 支持所有代币类型(使用同一钱包登录)。直接存入仅接受USDC——其他稳定币必须使用网站。
reauth / login(重新认证)
- - 用途:清除所有缓存的认证并重新运行OAuth登录。
- 何时使用:用户遇到401未授权、需要会话ID、令牌过期、认证失败、用户要求重新登录或切换账户。
- 参数:无。传递 {}。
- 示例:
- npm run reauth
- npm run login
- node scripts/reauth.js
1. 清除mcporter缓存(~/.mcporter/)
2. 清除本地令牌文件(~/.mcp-hub/)
3. 清除其他认证缓存文件
4. 启动浏览器OAuth登录
5. 验证新认证有效
用户:我遇到401错误
Claude:看起来是认证问题;正在重新认证...
[运行:npm run reauth]
Claude:重新认证完成;您可以再次使用该技能。
用户:重新登录
Claude:正在清除缓存并重新登录...
[运行:npm run login]
使用流程(供代理推理)
- 1. 获取当前工具:始终先运行 aiusd-skill tools --detailed 以发现所有可用工具及其当前模式。
- 解析意图:将自然语言映射到最合适的工具。检查是否有更新的工具能更好地匹配用户意图。
- 准备参数:严格根据步骤1中获取的实时模式构建JSON参数。
- 调用:使用工具名称和参数调用技能的调用接口。
- 处理结果:将工具JSON/文本格式化为用户可读格式;出错时重试或提示(例如认证过期→提示重新登录)。
关键:切勿使用本文档中的参数示例。始终使用 tools --detailed 的实时模式。
认证和错误处理
###