Skip to main content
Glama
aahl

MCP Server for stock and crypto

by aahl

获取加密货币主动买卖情况

okx_taker_volume

Fetch OKX cryptocurrency taker buy and sell volume. Supports spot and derivatives markets with configurable symbol and time period.

Instructions

获取OKX加密货币主动买入和卖出的交易量

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolNo币种,格式: BTC 或 ETHBTC
periodNo时间粒度,仅支持: [5m/1H/1D] 注意大小写,仅分钟为小写m1h
instTypeNo产品类型 SPOT:现货 CONTRACTS:衍生品SPOT

Implementation Reference

  • Tool registration via @mcp.tool decorator with title '获取加密货币主动买卖情况' and description about OKX cryptocurrency taker volume
    @mcp.tool(
        title="获取加密货币主动买卖情况",
        description="获取OKX加密货币主动买入和卖出的交易量",
    )
  • Handler function that calls OKX API /api/v5/rubik/stat/taker-volume with symbol, period, and instType params, returns CSV-formatted taker volume data
    def okx_taker_volume(
        symbol: str = Field("BTC", description="币种,格式: BTC 或 ETH"),
        period: str = Field("1h", description="时间粒度,仅支持: [5m/1H/1D] 注意大小写,仅分钟为小写m"),
        instType: str = Field("SPOT", description="产品类型 SPOT:现货 CONTRACTS:衍生品"),
    ):
        res = requests.get(
            f"{OKX_BASE_URL}/api/v5/rubik/stat/taker-volume",
            params={
                "ccy": symbol,
                "period": period,
                "instType": instType,
            },
            timeout=20,
        )
        data = res.json() or {}
        dfs = pd.DataFrame(data.get("data", []))
        if dfs.empty:
            return pd.DataFrame()
        dfs.columns = ["时间", "卖出量", "买入量"]
        dfs["时间"] = pd.to_datetime(dfs["时间"], errors="coerce", unit="ms")
        dfs["卖出量"] = pd.to_numeric(dfs["卖出量"], errors="coerce")
        dfs["买入量"] = pd.to_numeric(dfs["买入量"], errors="coerce")
        return dfs.to_csv(index=False, float_format="%.2f").strip()
  • Input parameters: symbol (default BTC), period (default 1h, supports 5m/1H/1D), instType (default SPOT, supports SPOT/CONTRACTS)
    symbol: str = Field("BTC", description="币种,格式: BTC 或 ETH"),
    period: str = Field("1h", description="时间粒度,仅支持: [5m/1H/1D] 注意大小写,仅分钟为小写m"),
    instType: str = Field("SPOT", description="产品类型 SPOT:现货 CONTRACTS:衍生品"),

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.3/5.0
Behavior2/5

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 only restates the basic read operation and does not reveal data latency, authentication requirements, return format, error behavior, or any side effects. The term '主动' adds nuance but no substantive behavioral context.

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

Conciseness5/5

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

The description is a single concise sentence that immediately conveys the tool's purpose without redundant words or filler. It is front-loaded and every word contributes to understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that this is a simple data retrieval tool with fully documented parameters and no output schema, the description is minimally viable. However, it could benefit from mentioning what the returned volume data looks like, any constraints on symbol format, or distinguishing it from related market data tools. It is adequate but not rich.

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

Parameters3/5

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

The input schema provides 100% coverage with detailed descriptions for period, symbol, and instType, including allowed values and formatting notes. The description itself adds no additional parameter meaning, so the baseline score of 3 is appropriate.

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 '获取OKX加密货币主动买入和卖出的交易量' clearly identifies the verb (获取/get), resource (OKX crypto taker buy/sell volume), and differentiates it from sibling tools like okx_prices (prices) and okx_loan_ratios (loan ratios). It is specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives, nor are there any exclusions, prerequisites, or contextual hints about appropriate invocation scenarios. The description merely states the function without usage direction.

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