Skip to main content
Glama
nadavgb-atom

ib-async-mcp

by nadavgb-atom

create_contract

Create trading contracts for stocks, options, futures, forex, indices, CFDs, cryptocurrencies, and bonds by specifying contract type and symbol.

Instructions

Create a contract for trading. Types: stock, option, future, forex, index, cfd, crypto, bond.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contract_typeYesContract type
symbolYesSymbol (e.g., AAPL, EURUSD)
exchangeNoExchangeSMART
currencyNoCurrencyUSD
expiryNoExpiry date for options/futures (YYYYMMDD)
strikeNoStrike price for options
rightNoOption right: C (call) or P (put)
multiplierNoContract multiplier

Implementation Reference

  • The create_contract function acts as a factory method to instantiate appropriate Contract objects based on the provided contract_type.
    def create_contract(contract_type: str, **kwargs) -> Contract:
        """Create a contract based on type."""
        contract_map = {
            'stock': Stock,
            'option': Option,
            'future': Future,
            'forex': Forex,
            'index': Index,
            'cfd': CFD,
            'crypto': Crypto,
            'bond': Bond,
        }
        contract_class = contract_map.get(contract_type.lower(), Contract)
        return contract_class(**kwargs)
  • The tool 'create_contract' is registered in the list_tools() function, providing its schema and description.
    Tool(
        name="create_contract",
        description="Create a contract for trading. Types: stock, option, future, forex, index, cfd, crypto, bond.",
        inputSchema={
            "type": "object",
            "properties": {
                "contract_type": {"type": "string", "description": "Contract type"},
                "symbol": {"type": "string", "description": "Symbol (e.g., AAPL, EURUSD)"},
                "exchange": {"type": "string", "default": "SMART", "description": "Exchange"},
Behavior2/5

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

With no annotations provided, the description carries full disclosure burden but fails to explain what 'create' actually produces (a local object vs. server registration), whether it validates symbol existence, what it returns, or if the created contract persists across sessions. No behavioral traits beyond the basic verb are disclosed.

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

Conciseness3/5

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

Extremely brief at two sentences. While not bloated, the second sentence is merely a flat list that could benefit from formatting or integration into usage guidance. Given the tool complexity, additional length would be warranted.

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

Completeness2/5

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

Inadequate for an 8-parameter trading tool with no output schema or annotations. The description omits critical trading context: return value format, validation behavior, whether the contract is validated against the exchange, and how it relates to order placement. Should explain the contract creation lifecycle.

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 description adds value by listing valid contract_type values (stock, option, future, etc.) which the schema does not enumerate. With 100% schema coverage for all 8 parameters, the baseline is met, though the description misses opportunity to explain conditional requirements (e.g., that expiry/strike are only relevant for options/futures).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States specific verb and resource ('Create a contract for trading') and enumerates the eight valid contract types. However, it does not explicitly differentiate from sibling tools like qualify_contracts or get_contract_details that also handle contract objects.

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?

Provides no guidance on when to use this tool versus alternatives, nor does it mention prerequisites (e.g., requiring an active connection) or its relationship to place_order. The description lacks any 'when-not' guidance or workflow context.

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

Install Server

Other Tools

Latest Blog Posts

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/nadavgb-atom/ib-async-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server