Skip to main content
Glama
simoneb

ibkr-risk-mcp

by simoneb

get_vol_surface

Read-onlyIdempotent

Fetch an options underlying's implied volatility surface as a grid of expiries and strikes, with implied vol, delta, and option prices, enabling deterministic local repricing and risk analysis.

Instructions

IB's implied volatility surface for an underlying: a grid of (expiry, strike) with impliedVol, delta, optPrice, undPrice and daysToExpiry.

This is the input that makes local repricing deterministic. With IB's own volatilities in hand, a constant-volatility scenario needs no proprietary model — only Black-76 arithmetic on top of numbers IB published.

Do not collapse the surface to one number. Volatility has a term structure: ES at 139 days can sit near 15% at the money while the front month prints 12%. Using the front month for a longer tenor understates a long-dated position badly. Read the tenor you need, and interpolate between tenors in total variance if you must.

daysToExpiry counts to the settlement date. For AM-settled expiries that is one day past the last trading date TWS shows.

Strikes with no published volatility come back under missing with the reason rather than being silently absent — a surface missing its left wing looks identical to one that has none.

Check which instrument you got. A bare root is ambiguous: ES is the E-mini S&P 500 future and Eversource Energy on NYSE, and with no sec_type the stock wins. The resolved contract comes back under underlying, any collision is listed in warnings, and a surface on the wrong instrument looks perfectly reasonable until you notice the strikes are two orders of magnitude off.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rightsNoPuts by default; pass both for the full smile.
strikesNoExplicit strikes. Each is snapped to the nearest listed one.
expiriesYesExpiries as YYYYMMDD or YYYY-MM-DD. Either the last trading date or the settlement date works; both resolve to the same contracts.
sec_typeNoWhich instrument the symbol means. Left empty the search tries STK, then IND, then FUT — so 'ES' returns Eversource Energy, not the E-mini S&P. Pass FUT for a futures root. Any collision is reported in `warnings` either way.
max_strikeNo
min_strikeNo
underlyingYesUnderlying root, e.g. 'ES' or 'SPY'.
trading_classNoNeeded when one underlying has two contracts expiring the same day, e.g. 'ES' (quarterly, AM-settled) against 'EW4' (weekly, PM-settled).
max_strikes_per_expiryNoCap per expiry. Each strike is one market data line and IB allows about fifty at once, so a wide grid over many expiries takes time.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description adds substantial behavioral context beyond the readOnly/idempotent/non-destructive annotations: missing strikes appear under 'missing' with reasons, daysToExpiry counts to settlement date (not just trading date), and instrument-root ambiguity is resolved via 'underlying' and 'warnings'. These are valuable behavioral traits not inferable from annotations alone, and there is no contradiction.

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

Conciseness5/5

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

The description is long but every section earns its place, with bolded headings breaking up distinct concepts (deterministic repricing, don't collapse, settlement dates, missing strikes, instrument ambiguity). It is front-loaded with the core definition and then layers critical warnings. No filler or redundant phrasing.

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

Completeness5/5

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

For a tool with 9 parameters and an output schema, the description covers the essential contextual pitfalls: settlement vs trading date, missing strike handling, root-symbol collisions, and usage cautions about term structure. The output schema exists, so return values need no elaboration. The tool is complex and the description fully equips the agent with the needed context.

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

Parameters4/5

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

Schema description coverage is 78%, so the schema already explains most parameters. The description adds meaningful context for several: it explains sec_type disambiguation with the 'ES' example, trading_class resolution for same-day expiries, strike snapping behavior, and the rate-limit implication of max_strikes_per_expiry. This goes beyond the schema's dry definitions, though not exhaustively for all parameters.

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

Purpose5/5

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

The description clearly states the tool returns IB's implied volatility surface for an underlying, with a grid of (expiry, strike) and specific fields. It uses a specific verb ('get') and resource ('volatility surface'), and the detailed behavior distinguishes it from sibling tools dealing with margin, greeks, stress, and orders.

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

Usage Guidelines5/5

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

Extensive usage guidance is provided: it explains when to use the surface for local repricing, warns against collapsing the surface to a single number, advises reading the correct tenor and interpolating in total variance, and tells users to check the underlying instrument to avoid ambiguity. It gives clear context and practical 'how to use' directions, though it doesn't name alternative tools explicitly.

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/simoneb/ibkr-risk-mcp'

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