ctbcsec-api-mcp-server
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., "@ctbcsec-api-mcp-serverquery my stock positions"
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.
CTS Trading API MCP Server
A Model Context Protocol (MCP) server providing comprehensive access to CTBC Securities CTS Trading API. Enables LLMs like Claude to interact with the trading platform for stock, futures, and options trading operations.
Features
Stock Trading: Place, modify, and cancel stock orders
Futures/Options Trading: Full support for derivatives trading
Account Management: Query accounts, positions, orders, and matches
Type-Safe: Comprehensive Pydantic models for all operations
Event-Driven: Async response handling for query operations
MCP Resources: Access to configuration and connection status
Related MCP server: IBKR TWS MCP Server
Requirements
Operating System: Windows (COM object dependency)
Python: 3.10 or higher
CTS Trading API: Must be installed and registered on the system
Dependencies:
mcp >= 1.1.0pywin32 >= 306pydantic >= 2.0
Installation
Clone or download the repository
Install CTS Trading API (from CTBC Securities)
Ensure the
DJTRADEOBJLibCTS.TradeAppCOM object is registered
Install Python dependencies
# Using uv (recommended) uv pip install -e . # Or using pip pip install -e .Configure the server
Edit
appsetting.jsonwith your trading server endpoint:{ "TradeDas": "your.trading.server.com/tradedas" }
Usage
Testing with MCP Inspector
Test the server using the MCP development tools:
uv run mcp dev d:\ctbcsec-api-mcp-server\ctbcsec_mcp\server.pyThis launches the MCP Inspector where you can:
View all available tools
Test tool schemas
Execute tools interactively
Monitor responses
Integration with Claude Desktop
Install the server to Claude Desktop:
uv run mcp install d:\ctbcsec-api-mcp-server\ctbcsec_mcp\server.pyOr manually add to Claude Desktop configuration (%APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"ctbcsec-trading": {
"command": "uv",
"args": [
"--directory",
"d:\\ctbcsec-api-mcp-server",
"run",
"ctbcsec-mcp"
]
}
}
}Available Tools
Authentication & Connection
initialize: Initialize the CTS Trading API with server configurationlogin: Authenticate user with trading systemconnect: Connect to the trading serverdisconnect: Disconnect from trading serverlogout: Logout from trading systemget_accounts: Retrieve all available trading accountsget_connection_status: Get current connection statusset_lot_size: Set lot size data for specific stocks
Stock Trading
stock_new_order: Place a new stock orderstock_modify_order: Modify an existing stock orderstock_cancel_order: Cancel an existing stock orderstock_query_order: Query stock ordersstock_query_match: Query stock trade matchesstock_query_position: Query stock positions
Futures/Options Trading
futopt_new_order: Place a new futures/options orderfutopt_modify_order: Modify an existing futures/options orderfutopt_cancel_order: Cancel an existing futures/options orderfutopt_query_order: Query futures/options ordersfutopt_query_match: Query futures/options matchesfutopt_query_oi: Query futures/options open interestfutopt_query_equity: Query futures/options account equity
Resources
config://appsetting: Current server configurationstatus://connection: Current connection and authentication status
Example Usage Flow
# 1. Initialize the trading API
initialize(trade_das_url="apsit.ectest.ctbcsec.com/tradedas")
# 2. Login
login(user_id="your_user_id", password="your_password")
# 3. Connect to trading server
connect()
# 4. Get available accounts
accounts = get_accounts()
# 5. Place a stock order
stock_new_order(
account_id="1234567",
stock_id="2330",
quantity="1000",
price="500",
buy_sell=BuySell.BUY,
price_type=PriceType.LIMIT
)
# 6. Query positions
stock_query_position(account_id="1234567")
# 7. Cleanup
disconnect()
logout(user_id="your_user_id")Enumerations
TradeType (Stock)
REGULAR = 0: Regular tradingAFTER_HOURS_ODD_LOT = 1: After-hours odd lotAFTER_HOURS = 2: After-hoursEMERGING = 5: Emerging stockINTRADAY_ODD_LOT = 7: Intraday odd lot
OrderType (Stock)
CASH = 0: Cash orderMARGIN = 1: Margin tradingSHORT = 2: Short sellingDAY_TRADING_SELL_FIRST = 16: Day trading sell first
BuySell
BUY = 1: Buy orderSELL = 2: Sell order
PriceType
LIMIT = 0: Limit priceLIMIT_UP = 1: Limit upLIMIT_DOWN = 2: Limit downFLAT = 3: FlatMARKET = 4: Market price
OrderCondition
ROD = 0: Rest of DayIOC = 1: Immediate or CancelFOK = 2: Fill or Kill
ProductType (Futures/Options)
FUTURES = 0: FuturesOPTIONS = 1: OptionsCOMPLEX_OPTIONS = 2: Complex optionsCOMPLEX_FUTURES = 3: Complex futures
Architecture
Components
server.py: FastMCP server with tool definitions and lifespan managementmodels.py: Pydantic models for type-safe structured datawrapper.py: COM object wrapper with event handling and thread safety__init__.py: Package initialization
Data Flow
MCP tool receives request with typed parameters
Server validates input using Pydantic models
Wrapper executes COM object method with thread safety
Event handler queues async responses
Structured response returned to LLM
Thread Safety
The wrapper uses locks to ensure thread-safe access to the COM object, which is critical for concurrent operations.
Event Handling
Query operations use an event-driven architecture:
Responses arrive via
OnDataResponsecallbackEvents are queued for async processing
Tools wait for responses with configurable timeout
Troubleshooting
COM Object Not Found
Error: "Failed to create COM object"
Solution: Ensure CTS Trading API is installed and the COM object is registered. Run the CTS Trading client once to verify installation.
Connection Failures
Error: "Not connected to trading server"
Solution:
Verify
appsetting.jsonhas correct server URLCall
initialize()beforelogin()Call
login()beforeconnect()Check network connectivity
Query Timeout
Note: Query operations may timeout if the server is slow to respond. The default timeout is 5 seconds. This is normal for some operations.
Permission Errors
Ensure you have proper trading permissions and account authorization from CTBC Securities.
Development
Running Automated Tests
The project includes a comprehensive suite of automated tests using pytest and mock.
# Install dev dependencies
uv pip install -e ".[dev]"
# Run all tests
pytestThe tests cover:
Models: Validation and serialization of all data structures.
Wrapper: Logic for COM object interaction (using mocks).
Server: Tool registration and high-level logic.
Manual Testing with Scripts
Logging
The server uses Python's logging module. Set log level via environment variable:
# Windows PowerShell
$env:LOG_LEVEL="DEBUG"
uv run ctbcsec-mcp
# Windows CMD
set LOG_LEVEL=DEBUG
uv run ctbcsec-mcpSecurity Considerations
Credentials: Never commit credentials to version control
Production Use: Use appropriate authentication and authorization
Network Security: Ensure secure connection to trading server
Access Control: Restrict access to the MCP server appropriately
License
This MCP server is provided for reference and development purposes. Please refer to your CTBC Securities API license agreement for terms of use.
Support
For technical support and API questions, contact CTBC Securities technical support team.
References
Version: 0.1.0
Last Updated: January 21, 2026
Available Tools
21 toolsconnectB
Connect to the trading server.
Returns: Connection status
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| message | No | Response message or error description |
| success | Yes | Whether the operation succeeded |
| order_id | No | Order ID if successful |
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 disclosing behavioral traits. It only states the action and the return value ('Connection status'), but does not reveal whether the connection is persistent, if it requires prior initialization or authentication, or if it is idempotent. This lack of context could lead to misuse in sequence.
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 long and every word earns its place. It is front-loaded with the primary action and includes the expected return. No filler or redundant content is present, making it appropriately concise.
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?
The description is minimally sufficient for a simple tool with no parameters and an output schema, but it lacks contextual cues about the operation lifecycle. Given the siblings (e.g., 'login', 'disconnect', 'initialize'), it would benefit from clarifying whether 'connect' must be called first or whether it depends on other steps. The description is not fully complete for an agent making sequencing decisions.
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 tool has no parameters, so there is nothing to explain. Per the baseline rule for 0-parameter tools, this dimension is adequately handled; the description does not need to compensate for missing parameter information.
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 ('Connect to the trading server') with a specific verb and resource. It distinguishes this tool from siblings like 'disconnect' and 'get_connection_status', though it does not explicitly differentiate from 'login' or 'initialize', which may also involve establishing a connection. Overall, the purpose is easily understood.
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?
There is no guidance on when to use this tool versus alternatives. The description contains no mention of preconditions, ordering, or exclusions. Sibling tools like 'login', 'initialize', and 'get_connection_status' exist, but no relationships or recommendations are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
disconnectA
Disconnect from the trading server.
Returns: Status confirmation
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| message | No | Response message or error description |
| success | Yes | Whether the operation succeeded |
| order_id | No | Order ID if successful |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
There are no annotations, so the description must carry the behavioral disclosure burden. It only states the action and the fact that a status confirmation is returned. It does not describe side effects, prerequisites, or failure behavior, which for a disconnect operation could be relevant (e.g., pending orders, session state).
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, with two short sentences that directly state the purpose and the return. Both sentences serve a clear function and there is no filler.
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 simplicity of the tool (no parameters), an output schema exists, and the description provides the core action and return type, it is mostly complete. It could add a sentence about when it is appropriate to call this tool or how it relates to 'logout', but the current level is adequate for a simple disconnect action.
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 tool has zero parameters, so the schema is fully covered. The description does not need to add parameter meaning beyond stating the action, which is sufficient. The baseline of 4 applies because there are no 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 action (disconnect) and the target (trading server), making its purpose unambiguous. It distinguishes itself from siblings like 'connect' and 'get_connection_status' by specifying a distinct operation.
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 when the user wants to end the connection to the trading server, but it does not provide explicit when-to-use guidance or alternatives. It lacks contrast with related tools such as 'logout' or 'connect', so the usage context is only partially implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
futopt_cancel_orderB
Cancel an existing futures/options order.
Args: account_id: Account ID order_id: Original order ID order_number: Order number contract_id: Contract ID quantity: Order quantity current_quantity: Current remaining quantity matched_quantity: Matched quantity product_type: Product type trade_date: Trading date (defaults to today) contract_id2: Second leg contract ID pre_order: Pre-order flag
Returns: Cancellation confirmation
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | ||
| quantity | Yes | ||
| pre_order | No | ||
| account_id | Yes | ||
| trade_date | No | ||
| contract_id | Yes | ||
| contract_id2 | No | ||
| order_number | Yes | ||
| product_type | No | ||
| current_quantity | Yes | ||
| matched_quantity | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| message | No | Response message or error description |
| success | Yes | Whether the operation succeeded |
| order_id | No | Order ID if successful |
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 only states that it returns 'Cancellation confirmation,' which is vague. It does not mention that cancellation is irreversible, what permissions are required, whether it cancels the entire order or a partial quantity, or what happens if the order is already matched. This is a significant gap for a mutating 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 front-loaded with the purpose, then follows a clean Args/Returns structure. It is appropriately sized for the parameter count and contains no filler. Every line serves a purpose, even if some definitions are weak, making it efficient and easy to scan.
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 has 11 parameters, no annotations, and an output schema (implied, but return details are not described), the description is incomplete. It does not explain the cancellation semantics (full vs partial), the meaning of 'current_quantity' vs 'quantity', or the structure of the 'Cancellation confirmation.' For a complex financial tool, this leaves too many important questions unanswered.
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 has 0% description coverage, so the description must compensate. It lists all 11 parameters but many definitions are tautological (e.g., 'order_number: Order number', 'product_type: Product type'). It does add some value with 'current_quantity: Current remaining quantity' and 'trade_date: Trading date (defaults to today)', but several parameters like 'pre_order: Pre-order flag' remain unclear. The description fails to clarify the relationships between quantity, current_quantity, and matched_quantity, which are crucial for understanding cancellation semantics.
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 opens with a specific verb and resource: 'Cancel an existing futures/options order.' This clearly distinguishes the tool from siblings like futopt_new_order, futopt_modify_order, and stock_cancel_order, which operate on different resources or actions. The futures/options qualifier disambiguates from the stock cancel tool.
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 usage context is implied by the name and the one-line purpose, but there is no explicit guidance on when to use this tool versus alternatives, no prerequisites (e.g., order must exist), and no mention of edge cases like partial cancellation or already-filled orders. A clear 'when to use' statement would have raised this to a 4 or 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
futopt_modify_orderA
Modify an existing futures/options order.
Args: account_id: Account ID order_id: Original order ID order_number: Order number contract_id: Contract ID new_quantity: New quantity current_quantity: Current remaining quantity matched_quantity: Matched quantity new_price: New price product_type: Product type trade_date: Trading date (defaults to today) modify_type: Modification type price_type: Price type condition: Order condition contract_id2: Second leg contract ID pre_order: Pre-order flag
Returns: Modification result
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | ||
| condition | No | ||
| new_price | Yes | ||
| pre_order | No | ||
| account_id | Yes | ||
| price_type | No | ||
| trade_date | No | ||
| contract_id | Yes | ||
| modify_type | No | ||
| contract_id2 | No | ||
| new_quantity | Yes | ||
| order_number | Yes | ||
| product_type | No | ||
| current_quantity | Yes | ||
| matched_quantity | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| message | No | Response message or error description |
| success | Yes | Whether the operation succeeded |
| order_id | No | Order ID if successful |
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 only states the action and returns a vague 'Modification result.' It does not disclose side effects, prerequisites (e.g., order must be in modifiable state), reversibility, or the meaning of modification types. This is a mutation tool with zero 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.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is efficiently structured: a one-sentence purpose followed by a straightforward parameter list and return line. It wastes no words but is a bit terse; still, it earns its place for a parameter-heavy tool.
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?
With 15 parameters, 8 required, no annotations, and an output schema that is not shown here, the description is minimally adequate. It provides parameter names and one-liner definitions but omits critical details such as enum meanings, modification type semantics, ordering of operations, or example usage. It is not complete enough for an agent to confidently use the tool without additional knowledge.
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 description enumerates all 15 parameters with brief human-readable semantics (e.g., 'Original order ID', 'Current remaining quantity', 'Second leg contract ID') that go beyond the schema's bare titles. However, some parameters like modify_type, price_type, and condition lack explanation of their enum values or defaults, so it doesn't fully compensate for the 0% 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 opens with 'Modify an existing futures/options order,' which is a specific verb+resource statement that clearly differentiates it from sibling tools like futopt_new_order and futopt_cancel_order. The intent is unambiguous.
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?
Usage is implied by the tool name and purpose ('modify an existing order'), but there is no explicit guidance on when to choose this over alternatives or any exclusions (e.g., cannot modify fully filled orders). It doesn't compare to futopt_cancel_order or futopt_new_order.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
futopt_new_orderA
Place a new futures or options order.
Args: account_id: Account ID contract_id: Contract ID (e.g., "TXFJ4") quantity: Number of contracts price: Order price ("0" for market orders) buy_sell: Buy (1) or Sell (2) product_type: Product type (0=Futures, 1=Options) trade_date: Trading date (defaults to today) price_type: Price type (default: LIMIT) offset: Offset flag (0=Open, 1=Close) condition: Order condition (default: ROD) contract_id2: Second leg contract ID for complex orders buy_sell2: Second leg buy/sell pre_order: Pre-order flag
Returns: Order confirmation
| Name | Required | Description | Default |
|---|---|---|---|
| price | Yes | ||
| offset | No | ||
| buy_sell | Yes | ||
| quantity | Yes | ||
| buy_sell2 | No | ||
| condition | No | ||
| pre_order | No | ||
| account_id | Yes | ||
| price_type | No | ||
| trade_date | No | ||
| contract_id | Yes | ||
| contract_id2 | No | ||
| product_type | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| message | No | Response message or error description |
| success | Yes | Whether the operation succeeded |
| order_id | No | Order ID if successful |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It mentions placing an order and returning a confirmation, but it does not state that this is a live, likely irreversible trade order, nor does it mention prerequisites like authentication, account validity, or potential failure modes. This is a significant gap for a mutation tool with real-world consequences.
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 well-structured with a one-sentence purpose followed by an Args list and Returns line. It is appropriately sized for a 13-parameter tool, with no wasted words. The parameter list is readable and front-loaded with the key required fields first.
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 (13 parameters, zero schema descriptions, no annotations), the description is inadequate for safe and correct use. It lacks critical detail on enum value mappings, behavioral expectations, and prerequisites. The output schema exists, so the return confirmation is sufficient, but the parameter and behavioral gaps make the description 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 description lists all 13 parameters with brief explanations, which is essential given the schema has 0% description coverage. However, several explanations are vague or incomplete—for example, 'price_type: Price type (default: LIMIT)' does not enumerate the numeric enum values, and 'pre_order: Pre-order flag' lacks any detail. It provides a baseline but does not fully compensate for the schema's silence.
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 'Place a new futures or options order.' This uses a specific verb+resource construction that distinguishes it from stock_new_order and the modify/cancel/query siblings. The mention of 'futures or options' directly differentiates it from the stock order tool.
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 context by specifying 'new' and limiting to futures/options, which is clear given sibling tools like stock_new_order and modify/cancel/query. However, it does not explicitly state alternatives or when not to use this tool, so it misses the full top-tier guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
futopt_query_equityB
Query futures/options account equity.
Args: account_id: Account ID trade_date: Trading date (empty string for current, defaults to today)
Returns: Account equity details
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| trade_date | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| data | No | Query result data |
| message | No | Response message or error description |
| success | Yes | Whether the query succeeded |
| event_id | No | Event ID from response |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full responsibility. It does not disclose whether the tool is read-only, what permissions are needed, or any side effects. The verb 'Query' implies reading, but this is not explicit, and no additional behavioral context is given.
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-sentence purpose followed by clearly labeled Args and Returns sections. It is brief, well-structured, and contains no unnecessary information.
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 2-parameter tool with no annotations, the description under-delivers. It lacks usage guidance, behavioral transparency, and contains a contradictory default. While an output schema exists, the description does not reference what 'Account equity details' entails, leaving the return structure unexplained.
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 description adds meaning for trade_date by explaining the empty-string behavior and stating a default, but this conflicts with the schema's default of null. account_id is only described as 'Account ID', adding little beyond the schema. With 0% schema coverage, the description partially compensates but has an inconsistency.
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 queries futures/options account equity. This distinguishes it from siblings like futopt_query_order, futopt_query_match, and futopt_query_oi, which focus on orders, matches, and open interest respectively.
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?
Usage context is only implied by the resource name and the action 'query'. The description does not explicitly state when to use this tool over alternatives, nor does it provide exclusions or prerequisites. It is adequate but not explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
futopt_query_matchA
Query futures/options trade matches.
Args: account_id: Account ID force_query: True to force refresh, False to use cache
Returns: List of matched trades
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| force_query | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| data | No | Query result data |
| message | No | Response message or error description |
| success | Yes | Whether the query succeeded |
| event_id | No | Event ID from response |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavior. It mentions force_query for refresh vs cache, which is useful, but does not state if the operation is read-only, any side effects, or authentication requirements. Some transparency is present, but incomplete.
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 concise and front-loaded with the main verb. It includes the Args section and Returns, but could be slightly better structured with formatting. No wasted sentences, though it is minimal.
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?
An output schema exists, so return types are covered. However, the description lacks context on what constitutes a 'trade match', how it differs from futopt_query_order, or any preconditions. The cache behavior is useful, but overall completeness is adequate but not comprehensive.
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 coverage is 0%, so the description must compensate. It does explain force_query as 'True to force refresh, False to use cache', adding meaning beyond the schema's title/default. account_id is brief but acceptable. Adequate compensation for the missing schema descriptions.
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 'Query futures/options trade matches' with a specific verb (query) and resource (futures/options trade matches), distinguishing it from stock_query_match and other sibling tools.
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 futopt_query_order or futopt_query_oi. It only mentions the force_query cache behavior, but does not explain under what circumstances to choose this tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
futopt_query_oiA
Query futures/options open interest.
Args: account_id: Account ID trade_date: Trading date (defaults to today) force_query: True to force refresh, False to use cache
Returns: Open interest positions
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| trade_date | No | ||
| force_query | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| data | No | Query result data |
| message | No | Response message or error description |
| success | Yes | Whether the query succeeded |
| event_id | No | Event ID from response |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds behavioral context by explaining the force_query parameter ('True to force refresh, False to use cache') and the trade_date default ('defaults to today'). Since annotations are absent, this information helps the agent understand caching and default behavior.
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 compact docstring with a one-line purpose, followed by parameter explanations and return type. It is front-loaded, free of fluff, and every sentence contributes useful information.
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?
The description covers purpose, parameters, and returns. It does not mention prerequisites like login, but the sibling tools suggest connectivity is separate. With an output schema present and parameters well-covered, this is sufficiently complete for a simple query 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?
All three parameters are described in plain language, with meaningful interpretation for force_query (refresh vs cache) and trade_date (defaults to today). This adds value beyond the bare schema titles, though it does not detail formats or constraints.
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 function with a specific verb and resource: 'Query futures/options open interest.' This distinguishes it from sibling tools like futopt_query_order (queries orders) and futopt_query_match (queries matches).
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 usage is implied by the tool's name and description but no explicit guidance is given about when to choose this over alternatives, nor are any exclusions or prerequisites mentioned. A clear statement like 'use for checking open interest positions' would improve this.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
futopt_query_orderA
Query futures/options orders.
Args: account_id: Account ID product_type: Product type (0=Futures, 1=Options) force_query: True to force refresh, False to use cache
Returns: List of orders
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| force_query | No | ||
| product_type | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| data | No | Query result data |
| message | No | Response message or error description |
| success | Yes | Whether the query succeeded |
| event_id | No | Event ID from response |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose behavioral traits itself. It does reveal caching behavior through force_query ('True to force refresh, False to use cache'), which is useful. However, it does not explicitly state that this is a read-only operation, or mention potential stale data, pagination, or auth requirements, leaving 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 highly concise and well-structured, with a clear one-line purpose followed by Args and Returns sections. Every sentence earns its place, and there is no filler.
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 that there is an output schema, the return value is already defined. The description covers purpose, parameters, and caching behavior. However, it omits the full product_type enum values (2 and 3) and provides no usage context or prerequisites (e.g., login required). These are minor but notable gaps, making it slightly 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?
Schema description coverage is 0%, so the description must compensate. It provides one-line explanations for all three parameters, which adds meaning. However, the product_type mapping is incomplete (only 0 and 1 are listed while the schema enum includes 0-3), and account_id is minimally described as 'Account ID.' It helps but does not fully compensate for schema gaps.
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 opens with 'Query futures/options orders,' which is a specific verb+resource combination that clearly distinguishes this tool from siblings like futopt_query_match (queries matches) and futopt_new_order (creates orders). The purpose is unambiguous.
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 explicit guidance on when to use this tool versus alternatives. It does not mention exclusions or alternatives, such as 'for matches, use futopt_query_match.' Usage must be inferred from the name and context, leaving the agent without clear decision support.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_accountsA
Retrieve all available trading accounts.
Returns: List of account information objects
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries the full burden. It discloses the return format ('List of account information objects') and indicates a read-only operation via 'Retrieve'. However, it does not mention authentication requirements, potential errors, or whether a connection must be active.
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, directly stating the action and return format without any fluff or redundancy. It is well-structured and front-loaded.
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 zero-parameter, read-only list tool with an output schema, the description is sufficiently complete. It could mention prerequisites or relationship to other tools, but that is a minor gap given the simplicity.
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 tool has zero parameters, and the schema coverage is 100% by default. The baseline for zero parameters is 4, and the description does not need to add parameter information; there is no gap to compensate.
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 uses the specific verb 'Retrieve' and identifies the resource as 'all available trading accounts', clearly stating the tool's scope. It distinguishes itself from sibling tools, which focus on ordering, querying positions, and connection management.
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 does not explicitly state when to use this tool vs alternatives or mention prerequisites like login/connection. Usage is implied by the purpose—retrieving accounts—but no exclusions or alternative guidance is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_connection_statusB
Get current connection and authentication status.
Returns: Current connection status
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| user_id | No | Current logged-in user ID |
| connected | No | Whether connected to trading server |
| logged_in | No | Whether user is logged in |
| initialized | No | Whether Init() has been called |
| account_count | No | Number of available accounts |
| trade_das_url | No | Trading DAS server URL |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full responsibility for behavioral disclosure. It states that the tool returns connection and authentication status, which is the core behavior, but it does not elaborate on side effects (e.g., whether it's purely a read operation), error conditions, or the structure of the returned status. The behavior is not misleading, but the description is minimal.
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 very short and front-loaded, which is good. However, the 'Returns:' section is redundant with the first sentence ('Get current connection and authentication status' vs 'Current connection status'), wasting a line. It's concise but could be tighter by removing the duplication.
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?
The tool is simple with no parameters and an output schema is present, which reduces the need to describe return values. The description says enough to understand the basic purpose, but it lacks any contextual framing (e.g., when to use in the connection lifecycle relative to connect/login/disconnect). It's minimally complete but not enriched.
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 tool takes zero parameters, and the schema trivially covers this (100% coverage). According to the guidelines, a zero-parameter tool gets a baseline of 4, since the description cannot add parameter meaning beyond the empty schema. The description adds no param info, which is fine given there are none.
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's function: 'Get current connection and authentication status.' This distinguishes it from sibling tools like connect, disconnect, login, and logout by implying a read-only status check. However, it doesn't explicitly name those siblings, so it doesn't fully differentiate why it's not another status-like command.
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?
No guidance is provided on when to use this tool versus alternatives. The description only states what it does, not the situations where it's appropriate (e.g., before trading, after connect or login). There are no exclusions or alternative tool references, leaving the agent to infer usage from the name and getter semantics.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
initializeB
Initialize the CTS Trading API with server configuration.
Args: trade_das_url: Trading DAS server endpoint (e.g., "apsit.ectest.ctbcsec.com/tradedas")
Returns: Initialization result with success status and error details
| Name | Required | Description | Default |
|---|---|---|---|
| trade_das_url | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| success | Yes | Whether initialization succeeded |
| error_code | No | Error code |
| error_message | No | Error message if failed |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It mentions it returns success status and error details, but does not disclose side effects, whether re-initialization resets state, or any required permissions or preconditions. This is insufficient for a state-changing operation.
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 compact and well-structured with Args/Returns sections, making it easy to scan. It is not verbose, though the Args/Returns format slightly adds structure beyond plain prose, which is appropriate.
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?
Despite having an output schema, the description does not provide enough context around when and how to use this tool in the wider workflow. It lacks information about ordering relative to connect/login, prerequisites, or what state changes occur, leaving the agent underinformed for correct invocation.
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 has zero description coverage for the single parameter, but the description compensates by explaining 'trade_das_url' as a 'Trading DAS server endpoint' and providing a concrete example. This adds meaningful semantics beyond the bare schema.
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 initializes the CTS Trading API with server configuration, naming the specific resource and action. However, it does not explicitly differentiate itself from sibling tools like connect or login, so it stops short of a 5.
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?
There is no guidance on when to use this tool versus alternatives. It does not mention whether it should be called before connect or login, or any prerequisite ordering. This is a significant gap for a setup operation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
loginB
Authenticate user with the trading system.
Args: user_id: User account ID password: User password
Returns: Login result with account information
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes | ||
| password | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| success | Yes | Whether login succeeded |
| accounts | No | List of available accounts |
| error_code | No | Error code |
| error_message | No | Error message if failed |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description is the only behavioral disclosure. It does not mention side effects (e.g., establishing a session), security implications, or reversibility, and only states that it returns a login result.
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 concise and well-structured, with a clear purpose statement followed by Args and Returns sections. Every sentence is informative and there is no redundant text.
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 simple 2-parameter tool with an output schema, the description covers the core purpose and parameters. However, it omits contextual guidance about session behavior and the relationship to 'logout' or 'connect' siblings, leaving some gaps in operational understanding.
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 0%, so the description must compensate. The Arg descriptions ('User account ID', 'User password') only restate the property names without adding format, constraints, or example values.
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 states 'Authenticate user with the trading system' with a specific verb (authenticate) and resource (user/trading system), clearly distinguishing it from siblings like 'connect' and 'get_connection_status'. The action and scope are unambiguous.
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 login is a prerequisite for trading activities but does not explicitly state when to use this tool versus 'connect' or 'initialize'. No exclusion criteria or alternative tool references are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
logoutC
Logout from the trading system.
Args: user_id: User account ID
Returns: Logout confirmation
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| message | No | Response message or error description |
| success | Yes | Whether the operation succeeded |
| order_id | No | Order ID if successful |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must carry the full burden of behavioral disclosure. It only says 'Logout from the trading system' and mentions a return confirmation, but does not disclose side effects, session invalidation, idempotency, or prerequisites. This is insufficient for a state-changing operation.
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 concise and front-loaded. The 'Args' and 'Returns' sections add minor structure, but the return value is duplicated by the presence of an output schema, making one line slightly redundant. Overall it is 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?
The tool is simple, but the description is incomplete given the ambiguous relationship with 'disconnect'. It fails to explain when to logout, what happens to the session, or how it differs from disconnect, leaving a noticeable gap 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?
The schema coverage is 0%, and the description merely restates the parameter as 'User account ID' without adding meaningful details like format, purpose beyond identification, or constraints. It does not compensate for the lack of schema descriptions.
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 (Logout) and the resource (the trading system). While it doesn't explicitly distinguish from sibling 'disconnect', the purpose is specific enough to be understood. It is not a tautology or vague.
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?
No guidance is provided on when to use logout versus alternatives like disconnect or login. It only states what the tool does without context on when it should be invoked, making it hard for an agent to choose correctly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
set_lot_sizeA
Set lot size data for specific stocks.
Args: lot_size_data: Lot size configuration (e.g., "0050=1000|0028=1000")
Returns: Operation result
| Name | Required | Description | Default |
|---|---|---|---|
| lot_size_data | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| message | No | Response message or error description |
| success | Yes | Whether the operation succeeded |
| order_id | No | Order ID if successful |
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 states the action and gives an example format, but it does not disclose side effects (e.g., whether existing lot sizes are overwritten), permission requirements, reversibility, or error behavior. The return is only vaguely described as 'Operation result,' which adds little transparency.
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 compact, using a clear Args/Returns structure. Every sentence is informative: the action sentence, the parameter explanation with example, and the return line. There is no redundant or filler content, achieving excellent conciseness.
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 simple one-parameter tool with an output schema, the description covers the main purpose and parameter format adequately. However, it omits preconditions (e.g., requires login/connection) and does not clarify the behavior of the operation beyond the vague 'Operation result.' Since output schema exists, return details are not required, but the missing usage context leaves some 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 coverage is 0%, so the description must compensate. It provides a concrete example ('0050=1000|0028=1000') that clarifies the expected string format, which is a significant addition beyond the bare schema. However, it does not fully specify the syntax rules (e.g., separators, spaces), so it doesn't earn a 5.
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's function: 'Set lot size data for specific stocks.' This uses a specific verb ('Set') and resource ('lot size data') that distinguishes it from sibling tools, which are primarily for orders, queries, and connection management.
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?
Usage context is implied rather than explicit: the tool is for configuring lot sizes, and no alternatives are mentioned. There is no guidance on prerequisites such as being logged in or connected, nor any when-not-to-use caveats. This makes it minimally acceptable but lacking clear direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stock_cancel_orderB
Cancel an existing stock order.
Args: account_id: Account ID order_id: Original order ID order_number: Order number stock_id: Stock symbol buy_sell: Buy (1) or Sell (2) quantity: Order quantity current_quantity: Current remaining quantity matched_quantity: Matched quantity price: Order price trade_date: Trading date (defaults to today) trade_type: Trade type order_type: Order type price_type: Price type condition: Order condition pre_order: Pre-order flag
Returns: Cancellation confirmation
| Name | Required | Description | Default |
|---|---|---|---|
| price | Yes | ||
| buy_sell | Yes | ||
| order_id | Yes | ||
| quantity | Yes | ||
| stock_id | Yes | ||
| condition | No | ||
| pre_order | No | ||
| account_id | Yes | ||
| order_type | No | ||
| price_type | No | ||
| trade_date | No | ||
| trade_type | No | ||
| order_number | Yes | ||
| current_quantity | Yes | ||
| matched_quantity | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| message | No | Response message or error description |
| success | Yes | Whether the operation succeeded |
| order_id | No | Order ID if successful |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It states the action and that a confirmation is returned, but does not disclose that cancellation is destructive/irreversible, whether the order must be in a specific state, or any authorization requirements. The large parameter list implies validation logic that is not explained.
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 straightforward list of parameters and a return value, structured for readability. It is longer than typical, but the number of parameters justifies it. The purpose is front-loaded, and each line is concise.
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?
Even with an output schema, the description is incomplete for a tool with 15 parameters and many optional fields. It does not explain why all parameters are needed, what the defaults mean, or under what conditions cancellation might fail. The flat parameter list lacks workflow context, which is a significant gap given the tool's 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 0%, so the description must compensate. It provides a labeled list of all 15 parameters, adding some meaning like 'current_quantity: Current remaining quantity' and 'trade_date: Trading date (defaults to today).' However, many entries simply restate the parameter name (e.g., 'stock_id: Stock symbol') and it does not explain how the parameters relate to the cancellation process.
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 'Cancel an existing stock order,' which uses a specific verb and resource. This clearly distinguishes it from sibling tools like stock_new_order, stock_modify_order, and stock_query_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 the tool is for canceling stock orders, but it does not explicitly state when to use it versus alternatives or mention any prerequisites or exclusions. It does not say 'use this instead of futopt_cancel_order' or note that cancellation is irreversible.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stock_modify_orderB
Modify an existing stock order.
Args: account_id: Account ID order_id: Original order ID order_number: Order number stock_id: Stock symbol buy_sell: Buy (1) or Sell (2) current_quantity: Current remaining quantity matched_quantity: Matched quantity new_price: New price trade_date: Trading date (defaults to today) new_quantity: New quantity (0 to keep unchanged) trade_type: Trade type order_type: Order type price_type: Price type condition: Order condition modify_type: Modification type (0=Quantity, 2=Price) pre_order: Pre-order flag
Returns: Modification result
| Name | Required | Description | Default |
|---|---|---|---|
| buy_sell | Yes | ||
| order_id | Yes | ||
| stock_id | Yes | ||
| condition | No | ||
| new_price | Yes | ||
| pre_order | No | ||
| account_id | Yes | ||
| order_type | No | ||
| price_type | No | ||
| trade_date | No | ||
| trade_type | No | ||
| modify_type | No | ||
| new_quantity | No | ||
| order_number | Yes | ||
| current_quantity | Yes | ||
| matched_quantity | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| message | No | Response message or error description |
| success | Yes | Whether the operation succeeded |
| order_id | No | Order ID if successful |
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 of behavioral disclosure. It does not mention irreversibility, required permissions, side effects on matched/current quantities, or what 'modification result' means. The only behavioral hint is the modify_type parameter, but that is parameter semantics, not tool behavior.
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 well-structured: a one-sentence purpose, an Args list with one line per parameter, and a Returns line. It is reasonably concise and front-loaded with the key purpose. Some parameter lines are tautological, but the overall length is appropriate for a 16-parameter tool.
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 (16 parameters, 8 required), the description lacks critical context: no usage scenarios, no behavioral expectations, no error or success conditions. The Returns line is vague ('Modification result'). While an output schema may exist, the description still fails to provide enough guidance for correct tool selection and invocation without additional context.
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 0%, so the description must compensate. It lists all 16 parameters and adds minimal meaning for some (e.g., buy_sell: 'Buy (1) or Sell (2)', modify_type: '0=Quantity, 2=Price', new_quantity: '0 to keep unchanged'). However, many entries merely restate the parameter name (e.g., 'condition: Order condition', 'pre_order: Pre-order flag') without providing meaningful semantics, leaving the agent to infer from the schema enums.
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 opens with a clear, specific verb+resource: 'Modify an existing stock order.' This distinctly differentiates it from sibling tools like stock_new_order, stock_cancel_order, and stock_query_order. The purpose is unambiguous.
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?
No guidance is provided on when to use this tool versus alternatives. It does not mention scenarios like changing price or quantity on an open order, nor does it note exclusions (e.g., use stock_cancel_order for full cancellation). The description only states the operation without context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stock_new_orderB
Place a new stock order.
Args: account_id: Account ID stock_id: Stock symbol (e.g., "2330") quantity: Number of shares price: Order price ("0" for market orders) buy_sell: Buy (1) or Sell (2) trade_date: Trading date in YYYYMMDD format (defaults to today) trade_type: Trade type (default: REGULAR) order_type: Order type (default: CASH) price_type: Price type (default: LIMIT) condition: Order condition (default: ROD) broker: Broker code (default: empty) pay_type: Payment type (default: 0)
Returns: Order confirmation or error message
| Name | Required | Description | Default |
|---|---|---|---|
| price | Yes | ||
| broker | No | ||
| buy_sell | Yes | ||
| pay_type | No | ||
| quantity | Yes | ||
| stock_id | Yes | ||
| condition | No | ||
| account_id | Yes | ||
| order_type | No | ||
| price_type | No | ||
| trade_date | No | ||
| trade_type | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| message | No | Response message or error description |
| success | Yes | Whether the operation succeeded |
| order_id | No | Order ID if successful |
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 of behavioral disclosure. It states only the action and that a confirmation or error message is returned, but does not mention side effects, required authentication/connection state, or whether the order is immediately sent or staged. This is a significant gap for a financial action 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 well-structured as an Args list, with each parameter on its own line and the one-line purpose at the top. It is appropriately sized for a 12-parameter tool, but it somewhat duplicates schema information (e.g., parameter names and types), which could be trimmed. Still, it is efficient and readable.
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?
The description covers parameter meanings and defaults, which is essential given the low schema coverage. However, it lacks higher-level context: it does not mention that a connection/login may be required (given sibling tools like 'connect' and 'login'), does not describe error scenarios, and does not provide an example invocation. The output schema is present but not described, so the return line is the only clue.
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 has 0% description coverage, so the description's parameter list is essential. It adds meaningful detail such as stock symbol format ('2330'), price '0' for market orders, buy/sell values (1/2), date format (YYYYMMDD), and defaults for optional fields. This goes well beyond the schema's bare titles, though some terms like 'CASH' and 'LIMIT' are left unexplained.
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 opens with 'Place a new stock order,' which clearly specifies the action (place) and the resource (new stock order). This distinguishes it from sibling tools like 'stock_modify_order' and 'stock_cancel_order,' and the intent is immediately clear.
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 gives no explicit guidance on when to use this tool versus alternatives. It does not mention prerequisites, exclusions, or when to prefer a different tool such as 'stock_modify_order' for existing orders. The only hint is the name and the one-line purpose, which implies usage but does not articulate conditions or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stock_query_matchB
Query stock trade matches.
Args: account_id: Account ID force_query: True to force refresh from server, False to use cache
Returns: List of matched trades
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| force_query | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| data | No | Query result data |
| message | No | Response message or error description |
| success | Yes | Whether the query succeeded |
| event_id | No | Event ID from response |
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 the force_query cache/refresh behavior and the return type ('List of matched trades'), but omits auth requirements, error behavior, and further details about matches.
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 well-structured with a summary, an Args block, and a Returns line. It is concise, but the Args block largely duplicates schema information, and the Returns line is minimal.
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 simple 2-parameter query tool with an output schema, the description provides a basic overview. However, 'matched trades' is vague, and there is no info on pagination, result limits, or edge cases, making it barely sufficient.
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 0%, so the description must compensate. It adds meaning for force_query ('True to force refresh from server, False to use cache'), but account_id is only restated as 'Account ID', adding no value beyond the schema title.
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 says 'Query stock trade matches', which is a clear verb+resource combination. It distinguishes from futopt_query_match by specifying 'stock', but 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?
No guidance on when to use this tool versus alternatives. It does not reference sibling tools like stock_query_order or futopt_query_match, leaving usage to be inferred entirely from the tool name.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stock_query_orderA
Query stock orders.
Args: account_id: Account ID force_query: True to force refresh from server, False to use cache
Returns: List of current orders
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| force_query | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| data | No | Query result data |
| message | No | Response message or error description |
| success | Yes | Whether the query succeeded |
| event_id | No | Event ID from response |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description discloses the cache-vs-server behavior via the force_query parameter and indicates the return type as a list of current orders. However, it does not explicitly state that this is a read-only operation or mention prerequisites, error conditions, or real-time guarantees.
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 concise and well-structured with Args and Returns sections. Every sentence provides necessary information, and there is no unnecessary filler.
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 simple query tool, the description covers the essentials: purpose, parameters, and return type. An output schema exists, so not explaining the return structure in detail is acceptable. It could add usage context or prerequisites, but overall it is fairly complete.
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?
With 0% schema description coverage, the description fully compensates by explaining account_id as "Account ID" and force_query as "True to force refresh from server, False to use cache". This adds meaningful meaning beyond the schema's types and defaults.
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 "Query stock orders" with a specific verb and resource, distinguishing it from sibling tools like stock_new_order or futopt_query_order. It makes the tool's scope explicit (stock orders, not futures/options).
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?
No guidance is given on when to use this tool versus alternatives such as stock_query_match or futopt_query_order. The description only states what it does without contextual hints on when it should be preferred.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stock_query_positionA
Query stock positions.
Args: account_id: Account ID trade_date: Trading date in YYYYMMDD format (defaults to today) force_query: True to force refresh from server, False to use cache
Returns: Current positions with P&L data
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| trade_date | No | ||
| force_query | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| data | No | Query result data |
| message | No | Response message or error description |
| success | Yes | Whether the query succeeded |
| event_id | No | Event ID from response |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden of behavioral disclosure. It explains the force_query parameter's cache behavior and mentions returns include P&L data, which adds useful context. However, it does not explicitly state whether the operation is read-only or if it requires a connection, leaving some transparency 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 concise and well-structured with an Args/Returns format. It avoids fluff and presents all necessary information in a scannable way, though it could be slightly more polished by noting defaults inline.
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?
The description includes the key return value (positions with P&L data) and parameter semantics, and the output schema exists for detailed return structure. However, it omits any mention of required prerequisites like a valid connection or login status, which are relevant given the sibling tools for connect/login. This is a minor gap.
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?
Given the schema has 0% description coverage, the description compensates by explaining each parameter's meaning. It provides the format and default for trade_date, the behavior of force_query (cache vs server refresh), and identifies account_id. While account_id is somewhat redundant, the other parameters gain clarity beyond the schema's basic definitions.
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 'Query stock positions' with a specific verb and resource, and it distinguishes itself from sibling tools like stock_query_order and stock_query_match by focusing on positions. The purpose is unambiguous and directly tied to the tool name.
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?
No guidance is provided on when to use this tool versus alternatives. While the name implies it is for querying positions, there is no explicit context about prerequisites (e.g., being logged in) or exclusions compared to other query tools. The description only states what it does, not when to choose it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose, grouped by asset class (stocks vs. futures/options) and action (new, modify, cancel, query). Connection/login/logout and account tools are separate from trading operations. No two tools appear to do the same thing.
Tool names follow a consistent pattern: connection verbs (connect, login, disconnect) and asset-specific prefixes (stock_, futopt_) with action verbs (new, modify, cancel, query). Underscore-separated and lowercase throughout, making it easy to infer functionality.
21 tools is well-scoped for a trading API covering connection lifecycle, account management, and full order lifecycle for both stocks and futures/options. Each tool adds distinct value and the count is appropriate for the breadth of functionality.
The tool surface covers the full trading workflow: connect, authenticate, manage orders (new/modify/cancel/query), view matches, and check positions/equity for both asset classes. No obvious dead ends or missing core operations that would impede an agent.
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
Read-only China A-share data for AI agents: market, limit-up, capital flow and disclosures.
Provide access to Chinese stock market data including historical prices, real-time data, news, and…
Access real-time and historical market data for China A-shares and Hong Kong stocks, along with ne…
MCP server exposing the Backtest360 engine API as tools for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA server application that enables large language models to execute stock trading operations through QMT trading system, providing functionality for account queries, position management, and order placement.46
- FlicenseNot gradedqualityDmaintenanceEnables LLM clients to interact with Interactive Brokers Trader Workstation for automated trading workflows. Supports market data retrieval, portfolio management, and order execution through the TWS API.5
- FlicenseNot gradedqualityCmaintenanceEnables interaction with the Korea Investment & Securities (KIS) Open API for domestic and overseas stock trading, real-time market data, and automated strategy execution. It provides a structured interface for LLMs to perform trading operations, manage portfolios, and conduct backtesting.
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to access real-time market data, manage Moomoo trading accounts, and execute trades via the Moomoo platform.29Apache 2.0
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/Mofesto/ctbcsec-api-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server