qualify_contracts
Fill missing contract fields like conId by qualifying Interactive Brokers trading contracts using symbol and contract type.
Instructions
Qualify contracts to fill in missing fields like conId.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contract_type | Yes | ||
| symbol | Yes | ||
| exchange | No | SMART | |
| currency | No | USD |
Implementation Reference
- src/ib_async_mcp/server.py:530-538 (handler)The handler for the qualify_contracts tool, which creates a contract object and then uses ib_async's qualifyContractsAsync method to qualify it.
if name == "qualify_contracts": contract = create_contract( args["contract_type"], symbol=args["symbol"], exchange=args.get("exchange", "SMART"), currency=args.get("currency", "USD"), ) qualified = await ib.qualifyContractsAsync(contract) return [serialize_object(c) for c in qualified] - src/ib_async_mcp/server.py:165-178 (registration)The registration of the qualify_contracts tool, including its name, description, and input schema.
Tool( name="qualify_contracts", description="Qualify contracts to fill in missing fields like conId.", inputSchema={ "type": "object", "properties": { "contract_type": {"type": "string"}, "symbol": {"type": "string"}, "exchange": {"type": "string", "default": "SMART"}, "currency": {"type": "string", "default": "USD"}, }, "required": ["contract_type", "symbol"], }, ),