OKX MCP Server
Provides tools for interacting with OKX cryptocurrency exchange, enabling account management (balance, positions, configuration), trading operations (placing and canceling orders, order history, position liquidation), and market data retrieval.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OKX MCP Servershow me my current account balance"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🆗 OKX MCP Server
📲 Install
Method 1: uvx
{
"mcpServers": {
"mcp-okx": {
"command": "uvx",
"args": ["mcp-okx"],
"env": {
"OKX_API_KEY": "your-okx-api-key",
"OKX_API_SECRET": "api-secret-key",
"OKX_PASSPHRASE": "api-passphrase",
"OKX_TRADE_FLAG": "1", # 0: Production trading, 1: Demo trading
"OKX_BASE_URL": "https://www.okx.com", # Optional
"MCP_AUTH_TOKEN": "your-custom-token" # Default same as OKX_API_KEY
}
}
}
}Method 2: Docker
mkdir /opt/mcp-okx
cd /opt/mcp-okx
wget https://raw.githubusercontent.com/aahl/mcp-okx/refs/heads/main/docker-compose.yml
docker-compose up -d{
"mcpServers": {
"mcp-okx": {
"url": "http://0.0.0.0:8811/mcp", # Streamable HTTP
"headers": {
"Authorization": "Bearer your-okx-api-key-or-custom-token"
}
}
}
}⚙️ Environment variables
OKX_API_KEY: API key of your OKX account. Please refer to my api page regarding API Key creation.OKX_API_SECRET: API secret key of your OKX account.OKX_PASSPHRASE: API passphrase of your OKX account.OKX_TRADE_FLAG: 0: Production trading, 1: Demo tradingOKX_BASE_URL: Base URL of OKX. Default:https://www.okx.comMCP_AUTH_TOKEN: Custom token for authentication. Default same asOKX_API_KEY
Related MCP server: okx-trade-mcp
🛠️ Available Tools
account_config- Get account configurationaccount_balance- Get account balanceaccount_positions- Get account positionsaccount_position_risk- Get account position risk
place_order- Place a new ordercancel_order- Cancel an incomplete orderget_trade_order- Get order detailsget_order_list- Get incomplete order listget_orders_history- Get Order Historyclose_positions- Liquidate all positions
market_tickers- Get cryptocurrency rankings
Available Tools
11 toolsaccount_balanceGet account balanceA
Retrieve a list of assets (with non-zero balance), remaining balance, and available amount in the OKX trading account
| Name | Required | Description | Default |
|---|---|---|---|
| ccy | No | Single currency or multiple currencies (no more than 20) separated with comma, e.g. BTC or BTC,ETH.Optional, all by default if not passed |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden. It discloses that the tool retrieves non-zero balance assets and includes remaining/available amounts, which is useful behavioral context. However, it doesn't mention rate limits, authentication requirements, error conditions, or response format details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured sentence that efficiently conveys the tool's purpose without unnecessary words. It's appropriately sized and front-loaded with the core functionality.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only tool with one well-documented parameter but no output schema, the description provides adequate context about what data is retrieved. However, it lacks details about response structure, pagination, or error handling that would be helpful for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents the single parameter. The description doesn't add any parameter-specific information beyond what's in the schema, maintaining the baseline score for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Retrieve'), resource ('assets', 'balance', 'available amount'), and scope ('in the OKX trading account'). It distinguishes from siblings by focusing on balance retrieval rather than positions, orders, or configuration.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for checking account balances but doesn't explicitly state when to use this tool versus alternatives like account_positions or account_position_risk. No guidance is provided about prerequisites, timing, or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
account_configGet account configurationA
Retrieve current OKX account configuration. It is recommended to use this tool to obtain account configuration information before using all other tools
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It indicates this is a retrieval operation ('Retrieve'), implying it's likely read-only and non-destructive, but doesn't explicitly state permissions, rate limits, or error conditions. The description adds some context about its role in workflow sequencing.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences with zero waste: the first states the purpose, and the second provides usage guidance. It's front-loaded and appropriately sized for its function.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but has gaps. It explains the purpose and usage, but lacks details on behavioral traits like authentication needs or response format, which could be important for a configuration tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate, earning a baseline score above 3 due to the lack of parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Retrieve') and resource ('current OKX account configuration'), making the purpose explicit. However, it doesn't differentiate this tool from potential siblings that might also retrieve account information (like account_balance or account_positions), so it doesn't reach the highest score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use this tool: 'before using all other tools.' This gives clear context for its usage relative to alternatives, though it doesn't specify when not to use it or name specific alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
account_position_riskGet account position riskC
Obtain the overall holding risk of the OKX account
| Name | Required | Description | Default |
|---|---|---|---|
| instType | No | Instrument type: `MARGIN`: 币币杠杆/`SWAP`: 永续合约/`FUTURES`: 交割合约/`OPTION`: 期权. Optional, all by default if not passed |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'obtains' risk data, implying a read-only operation, but doesn't clarify permissions, rate limits, or what 'overall holding risk' entails (e.g., metrics, format, or scope). This leaves significant gaps for a tool that likely involves financial data.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and efficiently conveys the essential information, making it highly concise and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of financial risk data and the lack of annotations and output schema, the description is insufficient. It doesn't explain what 'overall holding risk' includes (e.g., risk metrics, calculations, or output format), leaving the agent without enough context to use the tool effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, documenting the single optional parameter 'instType' with its types and default behavior. The description adds no parameter-specific information beyond what's in the schema, so it meets the baseline for adequate but not enhanced coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Obtain') and target resource ('overall holding risk of the OKX account'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'account_positions' or 'account_balance', which might also provide risk-related information, so it doesn't reach the highest score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context, or compare it to siblings such as 'account_positions' or 'account_balance', leaving the agent with no usage instructions beyond the basic purpose.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
account_positionsGet account positionsA
Retrieve information on your OKX positions. When the account is in net mode, net positions will be displayed, and when the account is in long/short mode, long or short positions will be displayed. Return in reverse chronological order using ctime.
| Name | Required | Description | Default |
|---|---|---|---|
| instType | No | Instrument type: `SPOT`: 币币现货/`MARGIN`: 币币杠杆/`SWAP`: 永续合约/`FUTURES`: 交割合约/`OPTION`: 期权.`instId` will be checked against `instType` when both parameters are passed. Optional, all by default if not passed | |
| instId | No | Instrument ID, e.g. `BTC-USDT-SWAP`. Single instrument ID or multiple instrument IDs (no more than 10) separated with comma. Optional, all by default if not passed | |
| posId | No | Single position ID or multiple position IDs (no more than 20) separated with comma. There is attribute expiration, the posId and position information will be cleared if it is more than 30 days after the last full close position. Optional, all by default if not passed |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses behavioral traits: it returns positions based on account mode (net or long/short) and orders them in reverse chronological order by ctime. However, it doesn't cover critical aspects like authentication needs, rate limits, error conditions, or response format, which are significant gaps for a tool with no annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded: the first sentence states the core purpose, followed by clarifying details about account modes and ordering. Every sentence earns its place by adding context without redundancy, making it efficient and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations and no output schema, the description provides basic purpose and behavioral context (account modes, ordering) but lacks completeness. It doesn't explain the return values, error handling, or security requirements, which are important for a tool that retrieves financial data. The schema covers parameters well, but overall context is minimal for a tool with potential complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents the three optional parameters (instType, instId, posId) with their types, defaults, and descriptions. The description adds no parameter-specific information beyond what's in the schema, such as how filtering works or interactions between parameters. Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('retrieve') and resource ('account positions'), specifying it's for OKX positions. It distinguishes from siblings like account_balance (which retrieves balance, not positions) and account_position_risk (which likely focuses on risk metrics). However, it doesn't explicitly differentiate from close_positions or other position-related tools beyond the retrieval action.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by mentioning net vs. long/short mode contexts, but doesn't explicitly state when to use this tool versus alternatives like account_position_risk or close_positions. No exclusions or prerequisites are provided, leaving the agent to infer based on the retrieval purpose versus mutation/analysis tools in the sibling list.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
cancel_orderCancel an incomplete orderC
Cancel an incomplete order on OKX
| Name | Required | Description | Default |
|---|---|---|---|
| instId | Yes | Instrument ID, e.g. BTC-USDT | |
| ordId | No | Order ID. Either ordId or clOrdId is required. If both are passed, ordId will be used | |
| clOrdId | No | Client Order ID as assigned by the client |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a cancellation operation (implying mutation/destructive action) but doesn't mention permissions required, whether cancellations are reversible, rate limits, or what happens to partially filled orders. This leaves significant behavioral gaps for a financial trading tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized for a tool with good schema documentation and gets straight to the point.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a financial trading cancellation tool with no annotations and no output schema, the description is insufficient. It doesn't address critical context like authentication requirements, error conditions, what 'incomplete' means, or what the tool returns. The combination of mutation operation with minimal description creates significant gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema, meeting the baseline for high schema coverage but not providing additional semantic context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Cancel') and target resource ('an incomplete order on OKX'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'close_positions' or 'get_order_list', but the verb 'cancel' is specific enough to distinguish it from most siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'close_positions' or 'get_order_list'. It mentions 'incomplete order' but doesn't explain what qualifies as incomplete or when cancellation is appropriate versus other order management actions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
close_positionsClose positionsA
Liquidate all positions in the designated trading product at market price on OKX
| Name | Required | Description | Default |
|---|---|---|---|
| instId | Yes | Instrument ID, e.g. BTC-USDT | |
| mgnMode | Yes | Margin mode: `cross`/`isolated` | |
| posSide | No | Position side. This parameter can be omitted in `net` mode, and the default value is `net`. You can only fill with `net`. This parameter must be filled in under the `long/short` mode. Fill in `long` for close-long and `short` for close-short. | |
| ccy | No | Margin currency, required in the case of closing `cross` `MARGIN` position for `Futures mode` | |
| autoCxl | No | Whether any pending orders for closing out needs to be automatically canceled when close position via a market order.`false` or `true`, the default is `false` | |
| clOrdId | No | Client-supplied ID. A combination of case-sensitive alphanumerics, all numbers, or all letters of up to 32 characters. | |
| tag | No | Order tag. A combination of case-sensitive alphanumerics, all numbers, or all letters of up to 16 characters |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions 'liquidate at market price' (implying immediate execution), it doesn't address critical aspects like whether this is irreversible, what permissions are required, potential rate limits, confirmation requirements, or what happens if the market is illiquid. For a high-stakes financial operation, this is insufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that immediately conveys the core functionality without any wasted words. It's perfectly front-loaded with the essential information about what the tool does.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a high-risk financial operation with no annotations and no output schema, the description is inadequate. It doesn't explain what happens after liquidation (confirmation? balance updates?), error conditions, or the irreversible nature of the action. The agent lacks critical context about this destructive operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. The baseline of 3 is appropriate when the schema does all the parameter documentation work.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('liquidate all positions'), target resource ('designated trading product'), method ('at market price'), and platform ('on OKX'). It uses precise terminology that distinguishes it from other trading tools like place_order or cancel_order.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies this tool should be used when wanting to exit all positions in a specific instrument, but it doesn't explicitly state when NOT to use it or mention alternatives like partial position closing. It provides clear context but lacks explicit exclusion guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_order_listGet incomplete order listC
Retrieve all incomplete orders under the current OKX account. For a detailed schema of the output object, please read the resource at: schema://trade/order
| Name | Required | Description | Default |
|---|---|---|---|
| instType | No | Instrument type: `SPOT/MARGIN/SWAP/FUTURES/OPTION` | |
| instFamily | No | Instrument family. Applicable to `FUTURES/SWAP/OPTION` | |
| instId | No | Instrument ID, e.g. BTC-USD-200927 | |
| state | No | State: `live`/`partially_filled` | |
| ordType | No | Order type. `market`: Market order `limit`: Limit order `post_only`: Post-only order `fok`: Fill-or-kill order `ioc`: Immediate-or-cancel order `optimal_limit_ioc`: Market order with immediate-or-cancel order `mmp`: Market Maker Protection (only applicable to Option in Portfolio Margin mode) `mmp_and_post_only`: Market Maker Protection and Post-only order(only applicable to Option in Portfolio Margin mode) `op_fok`: Simple options (fok) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves data (implying read-only), but doesn't mention authentication needs, rate limits, pagination, or what happens if no incomplete orders exist. This leaves significant gaps for a tool that likely interacts with account data.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences with zero waste: the first states the purpose, and the second directs to external schema details. It's appropriately sized and front-loaded, though the external reference slightly reduces self-containment.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (5 parameters, account data access) and lack of annotations/output schema, the description is minimally adequate. It clarifies the scope ('incomplete orders') and points to schema details, but doesn't address behavioral aspects like error handling or data freshness, leaving room for improvement.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, thoroughly documenting all 5 parameters with defaults and examples. The description adds no parameter semantics beyond implying filtering for 'incomplete orders', which aligns with the 'state' parameter but doesn't provide additional context. This meets the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Retrieve') and resource ('incomplete orders under the current OKX account'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_orders_history' or 'get_trade_order', which likely retrieve different order types or historical data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives such as 'get_orders_history' or 'get_trade_order'. It mentions retrieving 'incomplete orders' but doesn't clarify if this includes partially filled orders or only live ones, leaving usage context implied rather than explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_orders_historyGet Order HistoryB
Get completed orders on OKX which are placed in the last 7 days, including those placed 7 days ago but completed in the last 7 days.The incomplete orders that have been canceled are only reserved for 2 hours. For a detailed schema of the output object, please read the resource at: schema://trade/order
| Name | Required | Description | Default |
|---|---|---|---|
| instType | Yes | Instrument type: `SPOT/MARGIN/SWAP/FUTURES/OPTION` | |
| instFamily | No | Instrument family. Applicable to `FUTURES/SWAP/OPTION` | |
| instId | No | Instrument ID, e.g. BTC-USDT | |
| state | No | State: `canceled`/`filled`/`mmp_canceled`: Order canceled automatically due to Market Maker Protection | |
| category | No | Category: `twap/adl/full_liquidation/partial_liquidation/delivery`/`ddh`: Delta dynamic hedge | |
| ordType | No | Order type. `market`: Market order `limit`: Limit order `post_only`: Post-only order `fok`: Fill-or-kill order `ioc`: Immediate-or-cancel order `optimal_limit_ioc`: Market order with immediate-or-cancel order `mmp`: Market Maker Protection (only applicable to Option in Portfolio Margin mode) `mmp_and_post_only`: Market Maker Protection and Post-only order(only applicable to Option in Portfolio Margin mode) `op_fok`: Simple options (fok) | |
| limit | No | Number of results per request. [1-100]. Default: 20 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses key behavioral traits: the 7-day time constraint for completed orders and the 2-hour retention for canceled incomplete orders, which are crucial for understanding data availability. However, it doesn't cover other aspects like authentication needs, rate limits, pagination, or error handling, leaving gaps for a tool with 7 parameters.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core purpose in the first sentence, and the second sentence adds important behavioral context (2-hour retention for canceled orders). The third sentence efficiently directs to an external resource for output details. It's appropriately sized with minimal waste, though it could be slightly more structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (7 parameters, no annotations, no output schema), the description is moderately complete. It covers the time window and order state constraints but lacks details on authentication, rate limits, pagination (beyond the 'limit' parameter in schema), and error scenarios. The reference to an external schema helps, but the description itself doesn't fully compensate for the missing output schema and annotations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly with descriptions and defaults. The description doesn't add any parameter-specific details beyond what's in the schema, such as explaining how parameters interact (e.g., combining instType with instFamily). Baseline 3 is appropriate as the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves completed orders from OKX placed within the last 7 days, with a specific verb ('Get') and resource ('completed orders'). It distinguishes from siblings like 'get_order_list' by focusing on historical completed orders rather than current orders, though it doesn't explicitly name alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by specifying the time window (last 7 days) and order states (completed), and mentions canceled orders are only reserved for 2 hours, which provides some context. However, it doesn't explicitly state when to use this tool versus alternatives like 'get_order_list' or 'get_trade_order', leaving the agent to infer based on the historical focus.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_trade_orderGet order detailsC
Retrieve order details on OKX. For a detailed schema of the output object, please read the resource at: schema://trade/order
| Name | Required | Description | Default |
|---|---|---|---|
| instId | Yes | Instrument ID, e.g. BTC-USDT | |
| ordId | No | Order ID. Either ordId or clOrdId is required. If both are passed, ordId will be used | |
| clOrdId | No | Client Order ID as assigned by the client |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It only states it 'retrieves' details, implying a read-only operation, but doesn't address authentication requirements, rate limits, error conditions, or what happens if parameters are invalid. The reference to an external schema suggests output behavior is documented elsewhere, but the description itself lacks essential operational context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is brief and front-loaded with the core purpose in the first sentence. The second sentence directs to external documentation efficiently. However, the reference to an external schema might be considered slightly indirect for immediate understanding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of a financial trading tool with no annotations and no output schema, the description is incomplete. It lacks information about authentication, error handling, rate limits, and doesn't explain the relationship to sibling tools. The external schema reference partially compensates but doesn't cover operational aspects.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the input schema already documents all three parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema, maintaining the baseline score of 3 where the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Retrieve order details') and target resource ('on OKX'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from sibling tools like 'get_order_list' or 'get_orders_history', which appear to serve related purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'get_order_list' or 'get_orders_history'. It mentions reading a schema for output details but offers no context about appropriate use cases, prerequisites, or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
market_tickersGet market tickersC
Retrieve the latest price snapshot, best bid/ask price, and trading volume in the last 24 hours.Get the ranking of coins with the highest increase or the largest trading volume.
| Name | Required | Description | Default |
|---|---|---|---|
| instType | No | Instrument type: [SPOT/SWAP/FUTURES/OPTION] | SPOT |
| instFamily | No | Instrument family。 Applicable to FUTURES/SWAP/OPTION | |
| sortBy | No | Sorting method: [change24h/changeMax/last/vol24h/...] | change24h |
| limit | No | Number of results. Default: 30 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It describes what data is retrieved but doesn't mention rate limits, authentication requirements, data freshness, error conditions, or whether this is a read-only operation. For a market data tool with zero annotation coverage, this leaves significant behavioral gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is efficiently structured in two sentences that directly state the tool's purpose. The first sentence covers core functionality, the second adds ranking capability. No wasted words, though it could be slightly more front-loaded by mentioning ranking earlier.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a market data tool with 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the output looks like, how results are formatted, whether pagination exists, or any error scenarios. The agent would need to guess about return values and behavioral characteristics.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all 4 parameters with their types, defaults, and brief descriptions. The description mentions 'ranking of coins' which aligns with the sortBy parameter's purpose, but doesn't add meaningful semantic context beyond what the schema provides. Baseline 3 is appropriate when schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves market data including price snapshot, bid/ask prices, and 24-hour trading volume, with specific mention of ranking coins by increase or volume. It uses specific verbs like 'retrieve' and 'get' with clear resources. However, it doesn't explicitly differentiate from sibling tools like account_balance or get_order_list, which focus on account/order data rather than market data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for market analysis, or how it differs from sibling tools like get_trade_order or place_order. There's no explicit when/when-not usage information, leaving the agent to infer based on tool names alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
place_orderPlace a new orderC
Place a new order on OKX for trading
| Name | Required | Description | Default |
|---|---|---|---|
| instId | Yes | Instrument ID, e.g. BTC-USDT | |
| tdMode | Yes | Trade Mode, when placing an order, you need to specify the trade mode. Spot mode: `cash`(SPOT and OPTION buyer; 币币和期权买方) Futures mode: - `cash`(SPOT; 币币) - `cross`(Cross MARGIN/FUTURES/SWAP/OPTION; 全仓杠杆/交割/永续/期权) - `isolated`(Isolated MARGIN/FUTURES/SWAP/OPTION; 逐仓杠杆/交割/永续/期权) Multi-currency margin mode: `cross`(Cross SPOT/FUTURES/SWAP/OPTION; 全仓币币/交割/永续/期权) Portfolio margin: `cross`(Cross SPOT/FUTURES/SWAP/OPTION; 全仓币币/交割/永续/期权) | |
| side | Yes | Order side, `buy`/`sell` | |
| ordType | Yes | Order type. When creating a new order, you must specify the order type. The order type you specify will affect: 1) what order parameters are required, and 2) how the matching system executes your order. The following are valid order types: `limit`: Limit order, which requires specified sz and px. `market`: Market order. For SPOT and MARGIN, market order will be filled with market price (by swiping opposite order book). For Expiry Futures and Perpetual Futures, market order will be placed to order book with most aggressive price allowed by Price Limit Mechanism. For OPTION, market order is not supported yet. As the filled price for market orders cannot be determined in advance, OKX reserves/freezes your quote currency by an additional 5% for risk check. `post_only`: Post-only order, which the order can only provide liquidity to the market and be a maker. If the order would have executed on placement, it will be canceled instead. `fok`: Fill or kill order. If the order cannot be fully filled, the order will be canceled. The order would not be partially filled. `ioc`: Immediate or cancel order. Immediately execute the transaction at the order price, cancel the remaining unfilled quantity of the order, and the order quantity will not be displayed in the order book. `optimal_limit_ioc`: Market order with ioc (immediate or cancel). Immediately execute the transaction of this market order, cancel the remaining unfilled quantity of the order, and the order quantity will not be displayed in the order book. Only applicable to Expiry Futures and Perpetual Futures. | |
| sz | Yes | Quantity to buy or sell. For SPOT/MARGIN Buy and Sell Limit Orders, it refers to the quantity in base currency. For MARGIN Buy Market Orders, it refers to the quantity in quote currency. For MARGIN Sell Market Orders, it refers to the quantity in base currency. For SPOT Market Orders, it is set by tgtCcy. For FUTURES/SWAP/OPTION orders, it refers to the number of contracts. | |
| ccy | No | Margin currency. Applicable to all `isolated` `MARGIN` orders and `cross` `MARGIN` orders in `Futures mode` | |
| clOrdId | No | Client Order ID as assigned by the client.A combination of case-sensitive alphanumerics, all numbers, or all letters of up to 32 characters.Only applicable to general order. It will not be posted to algoId when placing TP/SL order after the general order is filled completely. | |
| tag | No | Order tag. A combination of case-sensitive alphanumerics, all numbers, or all letters of up to 16 characters | |
| posSide | No | Position side. The default is `net` in the net mode. It is required in the `long/short` mode, and can only be `long` or `short`. Only applicable to `FUTURES`/`SWAP`. Position side, this parameter is not mandatory in net mode. If you pass it through, the only valid value is net. In long/short mode, it is mandatory. Valid values are long or short. In long/short mode, side and posSide need to be specified in the combinations below: Open long: buy and open long (side: fill in buy; posSide: fill in long) Open short: sell and open short (side: fill in sell; posSide: fill in short) Close long: sell and close long (side: fill in sell; posSide: fill in long) Close short: buy and close short (side: fill in buy; posSide: fill in short) Portfolio margin mode: Expiry Futures and Perpetual Futures only support net mode | |
| px | No | Order price. Only applicable to `limit`,`post_only`,`fok`,`ioc`,`mmp`,`mmp_and_post_only` order. When placing an option order, one of px/pxUsd/pxVol must be filled in, and only one can be filled in. The value for px must be a multiple of tickSz for OPTION orders. If not, the system will apply the rounding rules below. Using tickSz 0.0005 as an example: The px will be rounded up to the nearest 0.0005 when the remainder of px to 0.0005 is more than 0.00025 or `px` is less than 0.0005. The px will be rounded down to the nearest 0.0005 when the remainder of px to 0.0005 is less than 0.00025 and `px` is more than 0.0005. | |
| tgtCcy | No | Whether the target currency uses the quote or base currency. This parameter is used to specify the order quantity in the order request is denominated in the quantity of base or quote currency. This is applicable to SPOT Market Orders only. Base currency: `base_ccy`; Quote currency: `quote_ccy` If you use the Base Currency quantity for buy market orders or the Quote Currency for sell market orders, please note: 1. If the quantity you enter is greater than what you can buy or sell, the system will execute the order according to your maximum buyable or sellable quantity. If you want to trade according to the specified quantity, you should use Limit orders. 2. When the market price is too volatile, the locked balance may not be sufficient to buy the Base Currency quantity or sell to receive the Quote Currency that you specified. We will change the quantity of the order to execute the order based on best effort principle based on your account balance. In addition, we will try to over lock a fraction of your balance to avoid changing the order quantity. 2.1 Example of base currency buy market order: Taking the market order to buy 10 LTCs as an example, and the user can buy 11 LTC. At this time, if 10 < 11, the order is accepted. When the LTC-USDT market price is 200, and the locked balance of the user is 3,000 USDT, as 200*10 < 3,000, the market order of 10 LTC is fully executed; If the market is too volatile and the LTC-USDT market price becomes 400, 400*10 > 3,000, the user's locked balance is not sufficient to buy using the specified amount of base currency, the user's maximum locked balance of 3,000 USDT will be used to settle the trade. Final transaction quantity becomes 3,000/400 = 7.5 LTC. 2.2 Example of quote currency sell market order: Taking the market order to sell 1,000 USDT as an example, and the user can sell 1,200 USDT, 1,000 < 1,200, the order is accepted. When the LTC-USDT market price is 200, and the locked balance of the user is 6 LTC, as 1,000/200 < 6, the market order of 1,000 USDT is fully executed; If the market is too volatile and the LTC-USDT market price becomes 100, 100*6 < 1,000, the user's locked balance is not sufficient to sell using the specified amount of quote currency, the user's maximum locked balance of 6 LTC will be used to settle the trade. Final transaction quantity becomes 6 * 100 = 600 USDT. 在现货交易中,参数`tgtCcy`决定了数量参数`sz`的单位,它可以是交易对的基础货币或计价货币。例如,在交易对BTC-USDT中,基础货币是BTC,计价货币是USDT。默认情况下,`tgtCcy`=quote_ccy(计价货币)用于买单,这意味着您指定的`sz`是以计价货币为单位的。而对于卖单`tgtCcy`的默认值为`base_ccy`,这意味着您指定的`sz`是以基础货币为单位的。 | |
| reduceOnly | No | Whether orders can only reduce in position size. Valid options: `true` or `false`. The default value is `false`. Only applicable to `MARGIN` orders, and `FUTURES`/`SWAP` orders in net mode. Only applicable to `Futures mode` and `Multi-currency margin`. | |
| stpMode | No | Self trade prevention mode: `cancel_maker`,`cancel_taker`,`cancel_both`. Cancel both does not support FOK. The account-level acctStpMode will be used to place orders by default. The default value of this field is `cancel_maker`. Users can log in to the webpage through the master account to modify this configuration. Users can also utilize the stpMode request parameter of the placing order endpoint to determine the stpMode of a certain order. | |
| pxUsd | No | Place options orders in `USD`. Only applicable to options. When placing an option order, one of px/pxUsd/pxVol must be filled in, and only one can be filled in | |
| pxVol | No | Place options orders based on implied volatility, where 1 represents 100%. Only applicable to options. When placing an option order, one of px/pxUsd/pxVol must be filled in, and only one can be filled in | |
| banAmend | No | Whether to disallow the system from amending the size of the SPOT Market Order. Valid options: `true` or `false`. The default value is `false`. If `true`, system will not amend and reject the market order if user does not have sufficient funds. Only applicable to SPOT Market Orders | |
| attachAlgoOrds | No | TP/SL information attached when placing order.1. TP/SL algo order will be generated only when this order is filled fully, or there is no TP/SL algo order generated.2. Attaching TP/SL is neither supported for market buy with `tgtCcy` is `base_ccy` or market sell with `tgtCcy` is `quote_ccy`3. If `tpOrdKind` is `limit`, and there is only one conditional TP order, `attachAlgoClOrdId` can be used as `clOrdId` for retrieving on `get_trade_order` tool.4. For 'split TPs', including condition TP order and limit TP order.* TP/SL orders in Split TPs only support one-way TP/SL. You can't use slTriggerPx&slOrdPx and tpTriggerPx&tpOrdPx at the same time, or error code 51076 will be thrown.* Take-profit trigger price types (tpTriggerPxType) must be the same in an order with Split TPs attached, or error code 51080 will be thrown.* Take-profit trigger prices (tpTriggerPx) cannot be the same in an order with Split TPs attached, or error code 51081 will be thrown.* The size of the TP order among split TPs attached cannot be empty, or error code 51089 will be thrown.* The total size of TP orders with Split TPs attached in a same order should equal the size of this order, or error code 51083 will be thrown.* The number of TP orders with Split TPs attached in a same order cannot exceed 10, or error code 51079 will be thrown.* Setting multiple TP and cost-price SL orders isn’t supported for spot and margin trading, or error code 51077 will be thrown.* The number of SL orders with Split TPs attached in a same order cannot exceed 1, or error code 51084 will be thrown.* The number of TP orders cannot be less than 2 when cost-price SL is enabled (amendPxOnTriggerType set as 1) for Split TPs, or error code 51085 will be thrown.* All TP orders in one order must be of the same type, or error code 51091 will be thrown.* TP order prices (tpOrdPx) in one order must be different, or error code 51092 will be thrown.* TP limit order prices (tpOrdPx) in one order can't be –1 (market price), or error code 51093 will be thrown.* You can't place TP limit orders in spot, margin, or options trading. Otherwise, error code 51094 will be thrown. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure but fails completely. It doesn't mention that this is a destructive/mutative operation that executes trades, doesn't discuss authentication requirements, rate limits, error conditions, or what happens after order placement. For a complex trading tool with 17 parameters, this is critically inadequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise at just one sentence with no wasted words. It's front-loaded with the core purpose, though that purpose is inadequately specified. From a pure conciseness perspective, it's maximally efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the high complexity (17 parameters, trading operation), lack of annotations, and no output schema, the description is completely inadequate. It doesn't explain what the tool returns, error conditions, behavioral constraints, or usage context. For a financial trading tool with significant implications, this minimal description is dangerously incomplete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, so the schema already documents all 17 parameters thoroughly. The description adds zero parameter information beyond what's in the schema. According to scoring rules, with high schema coverage (>80%), the baseline is 3 even with no param info in the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Place a new order on OKX for trading' is a tautology that essentially restates the tool name and title. It provides no specific information about what the tool actually does beyond the obvious, and fails to distinguish this tool from sibling trading tools like cancel_order or close_positions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides absolutely no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, appropriate contexts, or when other tools like cancel_order or get_order_list would be more suitable. There's no usage context provided at all.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
11 tool updates
- First observed
account_balance - First observed
account_config - First observed
account_position_risk - First observed
account_positions - First observed
cancel_order - First observed
close_positions - First observed
get_order_list - First observed
get_orders_history - First observed
get_trade_order - First observed
market_tickers - First observed
place_order
TDQS
Most tools have distinct purposes, such as account_balance for balances, place_order for trading, and market_tickers for market data. However, get_order_list, get_orders_history, and get_trade_order could cause confusion as they all retrieve order information with overlapping scopes, though descriptions clarify differences like incomplete vs. completed orders.
Tool names consistently follow a verb_noun or noun_verb pattern with snake_case throughout, such as account_balance, cancel_order, and market_tickers. This uniformity makes the set predictable and easy to navigate for an agent.
With 11 tools, the server is well-scoped for an OKX trading platform, covering account management, order handling, and market data. Each tool serves a clear purpose without being overly sparse or bloated, fitting typical expectations for such a domain.
The tool set provides comprehensive coverage for core trading operations, including account info, order placement, cancellation, and market data. A minor gap exists in lacking tools for modifying existing orders or positions beyond cancellation and liquidation, but agents can work around this with the available tools.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Trade 16 crypto exchanges + MetaTrader 5 from your AI assistant via one MCP connection.
Remote MCP for KOYN FX: account, markets, and TradeLocker tools over OAuth.
Autonomous xRocket CEX trading inside operator-set limits, plus live market data over MCP
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceConnects AI assistants to OKX cryptocurrency exchange for trading, market data, account management, and more via the Model Context Protocol.30MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with OKX cryptocurrency exchange, providing tools for market data, trading, account management, and more through the Model Context Protocol.98MIT
- AlicenseDqualityCmaintenanceEnables AI agents to access the full OKX exchange API for trading, market data, account management, and more through 300+ MCP tools.100101MIT
- AlicenseNot gradedqualityFmaintenanceProvides Claude with access to blockchain data and market prices via the OKX API, enabling operations like retrieving asset prices, transaction history, and executing swaps.3MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/aahl/mcp-okx'
If you have feedback or need assistance with the MCP directory API, please join our Discord server