Skip to main content
Glama
bybit-exchange

Bybit MCP Server

Official

queryAPIKey

Read-only

Retrieve full details of the Bybit API key in use: permissions, expiration, VIP level, KYC status, and master/sub relationship. Check key configuration and account status.

Instructions

Query comprehensive information about an API key. Use master or sub-account's API key.

Important notes (from official Bybit V5 documentation):

  • "Any permission can access this endpoint" - available to both master and sub-user accounts

  • Can only query the API key that is being used to authenticate the request

  • Returns comprehensive metadata including permissions, account status, VIP level, KYC info

  • Secrets are NEVER returned for security

  • IP whitelist is returned in JSON array format

  • Permissions are parsed and returned by category

What information is returned:

  1. ✅ API key basic info (ID, key string, note, creation/expiration time)

  2. ✅ IP binding configuration

  3. ✅ Permissions breakdown by 14 categories

  4. ✅ Read-only status

  5. ✅ Key type (personal or third-party)

  6. ✅ Account identification (master/sub, parent UID)

  7. ✅ Account status (UTA/unified account upgrade status)

  8. ✅ Affiliate/referral information (affiliate ID, inviter ID)

  9. ✅ VIP/market maker level

  10. ✅ KYC verification level and region

Process Flow:

  1. Parse metadata from request context to get member ID and API key

  2. Query API key information from database

  3. Validate API key status (must be VERIFIED)

  4. Validate API key ownership (memberID must match)

  5. Get account tags (UNIFIED_ACCOUNT_STATE, UTA)

  6. Get master/sub relationship information

  7. Get affiliate/referral information

  8. Get VIP level from loyalty program service

  9. Get KYC level and region from KYC service (with 5-minute cache)

  10. Parse and format permissions

Permissions Parsing:

  • Legacy format: "All" → ["Order", "Position"]

  • Legacy format: "Order" or "Position" → single permission

  • New format: JSON string with permission categories and read-only flag

  • 14 categories: ContractTrade, Spot, Wallet, Options, Derivatives, CopyTrading, BlockTrade, Exchange, NFT, Affiliate, Earn, FiatP2P, FiatBitPay, FiatConvertBroker

Account Status Fields:

  • unified: 1 if UNIFIED_ACCOUNT_STATE tag = "SUCCESS", else 0

  • uta: 1 if UTA tag = "SUCCESS", else 0

  • isMaster: true if not a sub-account, false otherwise

Use Cases:

  • Check current API key's permissions and configuration

  • Verify API key expiration time

  • Get account VIP level and KYC status

  • Identify master/sub account relationship

  • Check UTA upgrade status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.11

TDQS

A4.7/5.0
Behavior5/5

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

The description goes well beyond the readOnlyHint by disclosing that secrets are never returned, IP whitelist format, permission parsing behavior, account status fields, validation steps, and a 5-minute KYC cache. This gives the agent a strong behavioral model of the tool.

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

Conciseness4/5

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

The description is long but well-structured with clear sections for notes, returned information, process flow, permission parsing, account status fields, and use cases. There is minor redundancy between the opening notes and the detailed returned-info list, but the organization keeps it scannable.

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?

With no output schema, the description compensates thoroughly by enumerating the 10 categories of returned information, explaining key output fields like unified/uta/isMaster, and describing permission parsing formats. It also covers ownership/status validation and caching behavior, making it nearly complete for an agent to understand the tool's behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the description clearly explains why: it parses metadata from the request context and uses the API key that authenticated the request. This resolves any ambiguity about how the tool knows which API key to query.

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 states a specific verb ('Query') and resource ('API key'), and immediately clarifies it returns comprehensive information about the authenticated API key. It also distinguishes itself by noting the key can only be the one used to authenticate, which prevents confusion with hypothetical key-listing alternatives.

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 provides explicit use cases, such as checking permissions, verifying expiration, getting VIP/KYC status, and identifying master/sub relationships. It does not name alternative sibling tools or state when not to use it, but the usage context is clear enough for an agent to select it.

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

Install Server

Other Tools