Gate Exchange Sub-Account Skill
Provide sub-account management capabilities on Gate, including querying sub-account status, listing all sub-accounts, creating new sub-accounts, and locking/unlocking sub-accounts.
Prerequisites
- MCP Dependency: Requires gate-mcp to be installed.
- Authentication: All sub-account operations require API key authentication with main-account privileges.
- Permission: The current user must be a main account holder to manage sub-accounts.
Available MCP Tools
| Tool | Auth | Description |
|---|
| Yes | Get details of a specific sub-account by user ID |
| Yes | List all sub-accounts under the main account |
| Yes | Create a new normal sub-account |
| Yes | Lock a sub-account to disable login and trading |
| Yes | Unlock a previously locked sub-account |
Workflow
Step 1: Identify User Intent
Parse the user's message to determine which sub-account operation they need.
Key data to extract:
- : One of , , , ,
- : Sub-account UID (required for , , )
- : Desired username (for , may need to ask user)
Intent detection rules:
| Signal Keywords | Intent |
|---|
| "status of sub-account", "sub-account UID {id}", "check sub-account" | |
| "all sub-accounts", "list sub-accounts", "my sub-accounts", "which sub-accounts" | |
| "create sub-account", "new sub-account", "add sub-account" | |
| "lock sub-account", "disable sub-account", "freeze sub-account" | |
| "unlock sub-account", "enable sub-account", "unfreeze sub-account" | |
Step 2: Execute by Intent
Case A: Query Sub-Account Status ()
- : The sub-account UID provided by the user
Key data to extract:
- : Sub-account username
- : Sub-account remark/note
- : Account state (normal / locked)
- : Account type (normal / pool)
- : Account creation timestamp
Present the sub-account details in a structured format.
Case B: List All Sub-Accounts ()
- : "0" (normal sub-accounts only)
Key data to extract:
- For each sub-account: , , , ,
Present results as a table with username, UID, remark (if any), and current status.
Case C: Create Sub-Account ()
Pre-check: Call
with
: "0" to get the current list of normal sub-accounts. Check if the user can still create more sub-accounts based on the returned count.
If creation is available:
- Ask the user to provide a login name for the new sub-account
- Optionally collect: email, remark
- Confirm all details with the user before proceeding
- Call with:
- : User-provided login name (required)
- : User-provided email (optional)
- : User-provided remark (optional)
- Present the newly created sub-account details
Key data to extract:
- : Newly created sub-account UID
- : Confirmed username
- : Should be "normal"
Important: Only normal sub-accounts can be created through this skill.
Case D: Lock Sub-Account ()
- Validate that is provided; if not, ask the user
- Call with to verify the sub-account exists and belongs to the main account
- If the sub-account is already locked, inform the user and stop
- Confirm with the user: "Are you sure you want to lock sub-account {user_id} ({login_name})? This will disable login and trading for this sub-account."
- On confirmation, call with:
- Report the result
Key data to extract:
- Lock operation success/failure status
Case E: Unlock Sub-Account ()
- Validate that is provided; if not, ask the user
- Call with to verify the sub-account exists and is currently locked
- If the sub-account is already unlocked/normal, inform the user and stop
- Confirm with the user: "Are you sure you want to unlock sub-account {user_id} ({login_name})?"
- On confirmation, call with:
- Report the result
Key data to extract:
- Unlock operation success/failure status
Step 3: Format and Respond
Present results using the Report Template below. Always include relevant context and next-step suggestions.
Judgment Logic Summary
| Condition | Action |
|---|
| User asks for a specific sub-account status with UID | Route to Case A: |
| User asks to see all sub-accounts | Route to Case B: |
| User wants to create a new sub-account | Route to Case C: |
| User wants to lock a sub-account with UID | Route to Case D: |
| User wants to unlock a sub-account with UID | Route to Case E: |
| UID not provided for operations requiring it | Ask user for the sub-account UID |
| Login name not provided for creation | Ask user for a login name |
| Sub-account already in target state (lock/unlock) | Inform user, no action needed |
| API returns authentication error | Prompt user to log in |
| API returns permission error | Inform user that main account privileges are required |
| Sub-account does not exist or does not belong to user | Inform user the UID is invalid |
Report Template
Query Status Response
Sub-Account Details
---
Username: {login_name}
UID: {user_id}
Status: {state}
Type: {type}
Remark: {remark or "N/A"}
Created: {create_time}
List All Sub-Accounts Response
Your Sub-Accounts
---
| # | Username | UID | Status | Remark |
|---|----------|-----|--------|--------|
| 1 | {login_name} | {user_id} | {state} | {remark or "-"} |
| 2 | ... | ... | ... | ... |
Total: {count} sub-account(s)
Create Sub-Account Response
Sub-Account Created Successfully
---
Username: {login_name}
UID: {user_id}
Status: Normal
Remark: {remark or "N/A"}
Note: Only normal sub-accounts can be created through this interface.
Lock/Unlock Response
Sub-Account {Action} Successfully
---
Username: {login_name}
UID: {user_id}
Previous Status: {previous_state}
Current Status: {new_state}
Domain Knowledge
- A main account on Gate can create multiple sub-accounts for asset isolation, strategy separation, or team management.
- Sub-accounts share the main account's KYC verification but have independent trading and wallet capabilities.
- Locking a sub-account disables both login and trading; the assets remain safe but inaccessible until unlocked.
- There are two types of sub-accounts: normal (type=0) and pool (type=1). This skill only supports creating normal sub-accounts.
- Sub-account creation requires a unique login name. Email and remark are optional.
Safety Rules
- Write operations (, , ): Always require explicit user confirmation before execution. Never auto-execute.
- UID validation: Before lock/unlock, always verify the sub-account exists and belongs to the current main account.
- State check: Before lock/unlock, check current state to avoid redundant operations.
- No sensitive data exposure: Never expose API keys, internal endpoint URLs, or raw error traces.
- Normal sub-accounts only: Creation is restricted to normal sub-accounts (type=0). Do not attempt to create pool sub-accounts.
Error Handling
| Condition | Response |
|---|
| Auth endpoint returns "not login" | "Please log in to your Gate account first." |
| User is not a main account | "Sub-account management requires main account privileges. Please switch to your main account." |
| Sub-account UID not found | "Sub-account with UID {user_id} was not found. Please verify the UID and try again." |
| Sub-account does not belong to user | "This sub-account does not belong to your main account." |
| Sub-account already locked | "Sub-account {user_id} is already locked. No action needed." |
| Sub-account already unlocked | "Sub-account {user_id} is already in normal (unlocked) state. No action needed." |
| Create sub-account fails (limit reached) | "You have reached the maximum number of sub-accounts. Please contact support if you need more." |
| Create sub-account fails (duplicate name) | "The login name '{login_name}' is already taken. Please choose a different name." |
| Unknown error | "An error occurred while processing your request. Please try again later." |
Prompt Examples & Scenarios
See scenarios.md for full prompt examples and expected behaviors.