Skip to main content
Glama
Bybit MCP Server

Bybit MCP Server

Official

queryAPIKey

Read-only

Retrieve detailed metadata for the authenticated Bybit API key, including permissions by category, IP whitelist, read-only status, expiration, VIP level, KYC region, and master/sub-account relationship.

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 15 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

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

  • This V5 endpoint returns the group as permissions.Compliance: ["ComplianceAppeal"] when granted, or permissions.Compliance: [] when not granted 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

Agent hint: permissions.Compliance is ["ComplianceAppeal"] when granted and [] when not granted. It permits TM Onchain appeal queries and related material submission, and is available only to main-site master accounts with read-write API keys (readOnly=0). It is not granted by default; existing keys are not automatically granted this permission. This tool only inspects the authenticated key and cannot change any permission.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "queryAPIKey"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.11

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, and the description adds genuinely useful behavior: secrets are never returned, IP whitelist comes back as a JSON array, permissions are parsed into 15 named categories, and KYC lookups are cached for 5 minutes. It also exposes the validation chain (key must be VERIFIED, ownership must match). The internal step-by-step process flow is implementation detail rather than agent-facing behavior, which keeps it off a 5.

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

Conciseness3/5

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

Purpose and constraints are front-loaded, but the body is bloated: a 10-step internal process flow that an agent cannot act on, and the Compliance semantics are stated twice in near-identical form (once in the block and again in the trailing agent hint). The numbered return list is the part that earns its space; the rest could be cut roughly in half.

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 input schema and no output schema, the description carries the full burden and does so thoroughly: it enumerates every returned field group, explains the permission parsing formats, and defines the derived account status fields (unified, uta, isMaster). An agent has enough to call it and to interpret the result without further documentation.

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

Parameters4/5

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

The tool takes zero parameters, so the baseline is 4; the description correctly implies no arguments are needed because the key is derived from the request context. It adds no misleading parameter hints, though it never explicitly states that the call is parameterless.

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?

A specific verb and resource, "Query comprehensive information about an API key", plus an explicit scope constraint ("Can only query the API key that is being used to authenticate the request") that instantly separates it from any sibling that reports account or wallet data. The enumerated return categories reinforce the purpose rather than restating the name.

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 "Use Cases" list gives clear conditions for calling it (check permissions, verify expiration, get VIP/KYC, identify master/sub, check UTA status), and the definition states the boundary that it cannot change any permission. What is missing is any named alternative for adjacent needs (e.g., which sibling to call when you want a different key or account-level data), so routing to siblings is left to inference.

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

Deploy Server

Other Tools